/* ═══════════════════════════════════════════════════════════
   PREMIUM SITE SEARCH - FULL OVERLAY SEARCH
   Ultra-premium search experience with keyword matching
   ═══════════════════════════════════════════════════════════ */

/* Search Trigger Button in Nav */
.nav-search-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #1F2937;
    font-size: 17px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    flex-shrink: 0;
}

.nav-search-btn:hover {
    background: rgba(58, 123, 213, 0.08);
    color: #3A7BD5;
}

.nav-search-btn::after {
    content: 'Search';
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 500;
    color: #3A7BD5;
    letter-spacing: 0.5px;
    opacity: 0;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    pointer-events: none;
}

.nav-search-btn:hover::after {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════
   SEARCH OVERLAY - FULL SCREEN
   ═══════════════════════════════════════════════════════════ */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(10, 15, 28, 0.97);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Close button */
.search-overlay-close {
    position: absolute;
    top: 28px;
    right: 40px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.search-overlay-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Search Container */
.search-container {
    width: 100%;
    max-width: 720px;
    padding: 0 24px;
    margin-top: 15vh;
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

.search-overlay.active .search-container {
    transform: translateY(0);
    opacity: 1;
}

/* Search Label */
.search-label {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 20px;
    display: block;
}

/* Search Input Wrapper */
.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-input-wrapper i.search-icon {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    color: rgba(255, 255, 255, 0.3);
    transition: color 0.3s ease;
    pointer-events: none;
}

.search-input-wrapper:focus-within i.search-icon {
    color: #3A7BD5;
}

.search-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.12);
    padding: 16px 50px 16px 42px;
    font-size: 28px;
    font-weight: 300;
    color: #ffffff;
    letter-spacing: -0.3px;
    outline: none;
    transition: border-color 0.3s ease;
    caret-color: #3A7BD5;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
    font-weight: 300;
}

.search-input:focus {
    border-bottom-color: #3A7BD5;
}

/* Clear button */
.search-clear-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: none;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.search-clear-btn.visible {
    display: flex;
}

.search-clear-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

/* Keyboard shortcut hint */
.search-shortcut-hint {
    margin-top: 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-shortcut-hint kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    font-size: 11px;
    font-family: inherit;
    color: rgba(255, 255, 255, 0.5);
}

/* ═══════════════════════════════════════════════════════════
   SEARCH RESULTS
   ═══════════════════════════════════════════════════════════ */
.search-results {
    width: 100%;
    max-width: 720px;
    padding: 0 24px;
    margin-top: 32px;
    max-height: 45vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.search-results::-webkit-scrollbar {
    width: 4px;
}

.search-results::-webkit-scrollbar-track {
    background: transparent;
}

.search-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Result count */
.search-results-count {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 16px;
    letter-spacing: 0.3px;
}

.search-results-count span {
    color: #3A7BD5;
    font-weight: 600;
}

/* Result Item */
.search-result-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.search-result-item:hover {
    background: rgba(58, 123, 213, 0.08);
    border-color: rgba(58, 123, 213, 0.2);
    transform: translateX(4px);
}

.search-result-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(58, 123, 213, 0.15) 0%, rgba(0, 210, 255, 0.1) 100%);
    color: #3A7BD5;
    font-size: 16px;
    flex-shrink: 0;
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 4px;
    line-height: 1.3;
}

.search-result-title mark {
    background: transparent;
    color: #3A7BD5;
    font-weight: 600;
}

.search-result-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.search-result-tag {
    font-size: 10.5px;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.3px;
}

.search-result-arrow {
    color: rgba(255, 255, 255, 0.15);
    font-size: 14px;
    align-self: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.search-result-item:hover .search-result-arrow {
    color: #3A7BD5;
    transform: translateX(4px);
}

/* No results */
.search-no-results {
    text-align: center;
    padding: 40px 0;
}

.search-no-results i {
    font-size: 40px;
    color: rgba(255, 255, 255, 0.1);
    margin-bottom: 16px;
}

.search-no-results p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 300;
}

.search-no-results span {
    display: block;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.2);
    margin-top: 8px;
}

/* Popular / Quick Links (shown when empty) */
.search-popular {
    width: 100%;
    max-width: 720px;
    padding: 0 24px;
    margin-top: 40px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
}

.search-overlay.active .search-popular {
    opacity: 1;
    transform: translateY(0);
}

.search-popular-title {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.search-popular-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-popular-tag {
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.search-popular-tag:hover {
    background: rgba(58, 123, 213, 0.12);
    border-color: rgba(58, 123, 213, 0.3);
    color: #ffffff;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .search-container {
        margin-top: 10vh;
    }

    .search-input {
        font-size: 20px;
        padding: 12px 40px 12px 36px;
    }

    .search-input-wrapper i.search-icon {
        font-size: 18px;
    }

    .search-overlay-close {
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .search-result-item {
        padding: 14px 16px;
        gap: 12px;
    }

    .search-result-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .search-result-title {
        font-size: 14px;
    }

    .search-result-desc {
        font-size: 12px;
    }

    .search-shortcut-hint {
        display: none;
    }

    .search-popular-tag {
        padding: 6px 14px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .search-container {
        margin-top: 8vh;
    }

    .search-input {
        font-size: 18px;
    }

    .search-label {
        font-size: 11px;
    }

    .search-result-tags {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════════
   PRINT - HIDE
   ═══════════════════════════════════════════════════════════ */
@media print {
    .search-overlay,
    .nav-search-btn {
        display: none !important;
    }
}
