/* ========================================
   ARCHIMAERA SEARCH OVERLAY - LIST VIEW
======================================== */

/* Overlay Container */
.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;

    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-overlay.active {
    opacity: 1;
    pointer-events: all;
    visibility: visible;
}

/* Search Modal Container */
.search-modal {
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Search Header Row */
.search-header-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Search Input */
.search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 300;
    font-family: var(--font-heading);
    outline: none;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Close Button */
.close-search {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease, transform 0.3s ease;
    flex-shrink: 0;
}

.close-search:hover {
    color: #fff;
    transform: rotate(90deg);
}

/* Results Container */
.search-results-grid {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: calc(90vh - 120px);
    padding: 0 30px 30px 30px;
}

/* Custom Scrollbar */
.search-results-grid::-webkit-scrollbar {
    width: 6px;
}

.search-results-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.search-results-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.search-results-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Result Row */
.search-result-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.3s ease;
}

.search-result-row:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.search-result-row:last-child {
    border-bottom: none;
}

/* Thumbnail */
.search-thumb {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
}

.search-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Details Container */
.search-details {
    flex: 1;
    min-width: 0;
    /* Allow text truncation */
}

/* Category Label */
.search-category {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-family: var(--font-body);
}

.search-meta {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    margin: 0 0 6px 0;
}

/* Title */
.search-title {
    font-size: 1.1rem;
    font-weight: 400;
    color: #fff;
    margin: 0 0 4px 0;
    font-family: var(--font-heading);
    line-height: 1.3;
}

/* Description */
.search-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* No Results State */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1rem;
}

/* Dynamic states created by search.js */
.search-results-grid .loading {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1rem;
}

.search-results-grid .search-error {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 1rem;
}

.search-results-grid mark {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    padding: 0 0.08em;
}

.search-title .external-icon {
    color: inherit;
}

/* Responsive */
@media (max-width: 768px) {
    .search-overlay {
        padding: 20px;
    }

    .search-modal {
        max-height: 95vh;
    }

    .search-header-row {
        padding: 20px;
        gap: 15px;
    }

    .search-input {
        font-size: 1.3rem;
    }

    .close-search {
        font-size: 1.5rem;
        width: 30px;
        height: 30px;
    }

    .search-results-grid {
        padding: 0 20px 20px 20px;
        max-height: calc(95vh - 100px);
    }

    .search-result-row {
        gap: 15px;
        padding: 15px 0;
    }

    .search-thumb {
        width: 60px;
        height: 45px;
    }

    .search-title {
        font-size: 1rem;
    }

    .search-desc {
        font-size: 0.8rem;
    }
}
