/* =====================================================
   GLOBAL SEARCH DROPDOWN - Styling för startsidan
   =====================================================
   Lägg till i styles.css eller som separat fil
   ===================================================== */

/* Dropdown Container */
.global-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    min-width: 350px;
    max-width: 450px;
    background: rgba(20, 20, 30, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    overflow: hidden;
    
    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.global-search-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Results List */
.search-results-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
}

/* Scrollbar styling */
.search-results-list::-webkit-scrollbar {
    width: 6px;
}

.search-results-list::-webkit-scrollbar-track {
    background: transparent;
}

.search-results-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.search-results-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Result Item */
.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result-item:hover,
.search-result-item.active {
    background: rgba(255, 255, 255, 0.08);
}

.search-result-item.active {
    background: rgba(229, 9, 20, 0.15);
}

/* Thumbnail */
.search-result-thumbnail {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.search-result-play {
    font-size: 16px;
    color: white;
    opacity: 0.9;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Info Section */
.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-title mark {
    background: rgba(229, 9, 20, 0.4);
    color: white;
    padding: 0 2px;
    border-radius: 2px;
}

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.search-result-subject {
    padding: 2px 8px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-result-duration {
    color: rgba(255, 255, 255, 0.5);
}

/* Footer */
.search-results-footer {
    padding: 10px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

/* No Results */
.search-no-results {
    padding: 30px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.search-no-results span {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
}

.search-no-results p {
    margin: 0;
    font-size: 14px;
}

/* Loading State */
.search-loading {
    padding: 30px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.search-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: #e50914;
    border-radius: 50%;
    animation: searchSpin 0.8s linear infinite;
}

@keyframes searchSpin {
    to { transform: rotate(360deg); }
}

/* =====================================================
   LIGHT MODE
   ===================================================== */

body.light-mode .global-search-dropdown {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

body.light-mode .search-result-item:hover,
body.light-mode .search-result-item.active {
    background: rgba(0, 0, 0, 0.05);
}

body.light-mode .search-result-item.active {
    background: rgba(229, 9, 20, 0.1);
}

body.light-mode .search-result-title {
    color: #1d1d1f;
}

body.light-mode .search-result-title mark {
    background: rgba(229, 9, 20, 0.2);
    color: #1d1d1f;
}

body.light-mode .search-result-duration {
    color: rgba(0, 0, 0, 0.5);
}

body.light-mode .search-results-footer {
    border-top-color: rgba(0, 0, 0, 0.06);
    color: rgba(0, 0, 0, 0.5);
}

body.light-mode .search-no-results,
body.light-mode .search-loading {
    color: rgba(0, 0, 0, 0.5);
}

body.light-mode .search-spinner {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: #e50914;
}

body.light-mode .search-results-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}

body.light-mode .search-results-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* =====================================================
   MOBILE RESPONSIVE
   ===================================================== */

@media (max-width: 768px) {
    .global-search-dropdown {
        position: fixed;
        top: 70px;
        left: 10px;
        right: 10px;
        min-width: auto;
        max-width: none;
        border-radius: 12px;
    }
    
    .search-results-list {
        max-height: 60vh;
    }
    
    .search-result-item {
        padding: 12px;
    }
    
    .search-result-thumbnail {
        width: 45px;
        height: 45px;
        min-width: 45px;
    }
    
    .search-result-title {
        font-size: 13px;
    }
}
