/* Search Modal Styles */

.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.search-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.search-modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.search-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px 24px;
}

.search-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #040D81;
    margin: 0;
}

.search-modal-close {
    background: none;
    border: none;
    color: #6B7280;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.search-modal-close:hover {
    color: #040D81;
    background-color: #f3f4f6;
}

.search-modal-content {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

/* Search Menu Button Styles */

.menu-item-search {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.search-menu-button {
    background: none;
    border: none;
    color: #040D81;
    font-size: 0.96rem;
    cursor: pointer;
    padding: 6.4px 9.6px;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: auto;
    flex-shrink: 0;
}

.search-menu-button:hover {
    background: rgba(0, 102, 204, 0.15);
}

/* Search Component Styles */

.search-container {
    position: relative;
    width: 100%;
}

.search-input-wrapper {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 50px 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    color: #1F2937;
    background-color: #ffffff;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: #040D81;
}

.search-input::placeholder {
    color: #9CA3AF;
}

.search-submit-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #040D81;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 8px 12px;
    font-size: 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.search-submit-button:hover {
    background: #003366;
}

.search-results {
    position: relative;
    top: 16px;
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-results.active {
    opacity: 1;
    visibility: visible;
}

.search-result-item {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
}

.search-result-item:hover,
.search-result-item.selected {
    background-color: #f9fafb;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #040D81;
    margin-bottom: 4px;
}

.search-result-subtitle {
    font-size: 0.8rem;
    color: #6B7280;
    margin-bottom: 4px;
}

.search-result-type {
    font-size: 0.72rem;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-no-results {
    padding: 24px;
    text-align: center;
    color: #6B7280;
    font-size: 0.88rem;
}

.search-highlight {
    color: #22C55E;
    text-decoration: underline;
    text-decoration-color: #22C55E;
    text-underline-offset: 2px;
    text-decoration-thickness: 2px;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .search-modal-container {
        width: 95%;
        max-height: 90vh;
    }

    .search-modal-header {
        padding: 20px 20px 12px 20px;
    }

    .search-modal-header h2 {
        font-size: 1.25rem;
    }

    .search-modal-content {
        padding: 20px;
    }

    .search-input {
        padding: 12px 50px 12px 16px;
        font-size: 16px; /* Prevent iOS zoom on focus */
    }

    .search-results {
        max-height: 50vh;
    }
}

