/* Search Container - Similar to languageContainer */
.searchContainer {
    background-color: #F5F5F5;
    width: 100%;
    max-width: unset;
    height: 0;
    position: fixed;
    z-index: 100;
    left: 0;
    overflow: hidden;
    transition: height 0.5s ease;
    display: block;
    padding: 0 1.5rem;
    /*padding-top: 10px;*/
}


@media (min-width: 900px) {
    .searchContainer {
        padding: 0 5rem;
    }
}

@media (min-width: 1200px) {
    .searchContainer {
        padding: 0 5rem;
    }
}

.searchContainer.active {
    /* height and top will be set dynamically by JavaScript */
    overflow-y: auto;
}

/* Prevent body scroll when search is open - with highest specificity */
html body.search-open {
    overflow: hidden !important;
    margin-right: var(--scrollbar-width, 15px) !important;
    padding-right: 0 !important;
}

/* Prevent header jump when search is open */
body.search-open header {
    padding-right: calc(1.5rem + var(--scrollbar-width, 15px)) !important;
}

/* Prevent main jump when search is open */
body.search-open main {
    padding-right: calc(1.5rem + var(--scrollbar-width, 15px)) !important;
}

/* Prevent page jump by adding margin to html element */
html:has(body.search-open) {
    margin-right: var(--scrollbar-width, 15px) !important;
}

.searchContent {
    max-width: 71.25rem;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    width: 100%;
    padding: 2rem 0;
}

.searchContainer.active .searchContent {
    opacity: 1;
    transform: translateY(0);
}

/* Search Input Section */
.searchInputSection {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    position: relative;
}

.searchInputSection h2 {
    font-size: 2rem;
    margin: 0;
    color: #000;
    font-weight: 300;
    flex-shrink: 0;
}

.searchInputGroup {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background: white;
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    position: relative;
}

.searchInputGroup input[type="text"] {
    flex: 1;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: 6px;
    outline: none;
}

.searchInputGroup button {
    background: #FF0002;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.searchInputGroup button:hover {
    background: #cc0001;
}

/* Clear button inside search input */
.searchClearButton {
    background: none !important;
    border: none !important;
    color: #999 !important;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.searchClearButton:hover {
    color: #666 !important;
    background: #f0f0f0 !important;
}

.searchClearButton svg {
    width: 16px;
    height: 16px;
}

/* Show clear button when input has content */
.searchInputGroup.has-content .searchClearButton {
    display: flex;
}

/* Search Close Button */
.searchCloseButton {
    position: absolute;
    top: 50%;
    right: -1rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
    z-index: 10;
}

.searchCloseButton:hover {
    background: #f0f0f0;
    color: #FF0002;
}

.searchCloseButton:active {
    background: #e0e0e0;
}

.searchCloseButton svg {
    width: 28px;
    height: 28px;
}

/* Search Results */
.searchResults {
    margin-top: 2rem;
}

.searchResult {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid #FF0002;
    transition: transform 0.2s, box-shadow 0.2s;
}

.searchResult:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}

.searchResult h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    line-height: 1.4;
}

.searchResult h3 a {
    color: #FF0002;
    text-decoration: none;
    transition: color 0.2s;
}

.searchResult h3 a:hover {
    color: #cc0001;
    text-decoration: underline;
}

.searchResult-content {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.searchResult-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.85rem;
    color: #999;
}

.searchResult-type {
    background: #FF0002;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.8rem;
}

/* Loading State */
.searchLoading {
    text-align: center;
    color: #666;
    padding: 2rem;
    font-size: 1.1rem;
}

.searchLoading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top: 2px solid #FF0002;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Results */
.searchNoResults {
    text-align: center;
    color: #666;
    padding: 3rem 1rem;
    font-size: 1.1rem;
}

.searchNoResults h3 {
    color: #000;
    margin-bottom: 1rem;
    font-weight: 300;
}

/* Search Suggestions */
.searchSuggestions {
    margin-top: 1rem;
}

.searchSuggestions h4 {
    color: #666;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.searchSuggestion {
    display: inline-block;
    background: #f0f0f0;
    color: #666;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    margin: 0.25rem;
    cursor: pointer;
    font-size: 0.9rem;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.searchSuggestion:hover {
    background: #FF0002;
    color: white;
}

/* Search Highlight */
.search-term-highlight {
    background: #fff3cd;
    padding: 0.1rem 0.2rem;
    border-radius: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .searchContainer {
        padding: 0 1rem;
    }
    
    .searchInputSection {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .searchInputSection h2 {
        font-size: 1.5rem;
        text-align: center;
    }
    
    /* Position close button at h2 height on mobile */
    .searchCloseButton {
        position: absolute;
        top: -8px;
        right: 0;
        transform: none;
    }
    
    .searchInputGroup {
        flex-direction: column;
        gap: 0.75rem;
        max-width: none;
    }
    
    .searchInputGroup input[type="text"],
    .searchInputGroup button {
        width: 100%;
    }
    
    .searchResult {
        padding: 1rem;
    }
    
    .searchResult-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* Close search when clicking outside */
.searchContainer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: -1;
}

/* Language Container Fixes */
.languageContainer {
    background-color: #F5F5F5 !important;
    width: 100% !important;
    max-width: unset !important;
    height: 0;
    position: fixed !important;
    z-index: 100 !important;
    left: 0 !important;
    overflow: hidden !important;
    transition: height 0.5s ease !important;
    display: block !important;
}


.languageContainer.active {
    /* height and top will be set dynamically by JavaScript - no !important here */
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Prevent body scroll when language selector is open - with highest specificity */
html body.language-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
    margin-right: var(--scrollbar-width, 15px) !important;
    padding-right: 0 !important;
    left: 0 !important;
}

/* Prevent header jump when language selector is open */
body.language-open header {
    padding-right: calc(1.5rem + var(--scrollbar-width, 15px)) !important;
}

/* Prevent main jump when language selector is open */
body.language-open main {
    padding-right: calc(1.5rem + var(--scrollbar-width, 15px)) !important;
}

/* Language Close Button */
.languageCloseButton {
    position: absolute !important;
    top: -1rem !important;
    right: -1rem !important;
    background: none !important;
    border: none !important;
    color: #666 !important;
    cursor: pointer !important;
    padding: 0.75rem !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background-color 0.2s ease, color 0.2s ease !important;
    z-index: 101 !important;

}

.languageCloseButton:hover {
    background: #f0f0f0 !important;
    color: #FF0002 !important;
}

.languageCloseButton:active {
    background: #e0e0e0 !important;
}

.languageCloseButton svg {
    width: 28px !important;
    height: 28px !important;
}

@media (max-width: 768px) {
    .languageCloseButton {
        top: -0.5rem !important;
        right: -0.5rem !important;
    }
} 