/**
 * Global Search Modal Premium Styles
 * public/assets/css/global-search-modal.css
 * 
 * Design: Dark Glassmorphism, Premium Red Accents, Outfit Typography
 */

/* ===================================================================
   MODAL OVERLAY & CONTAINER
   =================================================================== */

.search-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-modal-overlay.show {
    display: flex;
    opacity: 1;
}

.search-modal {
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.8);
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'Outfit', sans-serif;
}

.search-modal-overlay.show .search-modal {
    transform: scale(1);
}

/* ===================================================================
   HEADER (Input Area)
   =================================================================== */

.search-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 28px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.search-modal-icon {
    font-size: 28px;
    color: #e50914;
    filter: drop-shadow(0 0 8px rgba(229, 9, 20, 0.4));
    flex-shrink: 0;
}

.search-modal-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 20px;
    font-weight: 500;
    color: #fff;
    background: transparent;
    letter-spacing: 0.5px;
}

.search-modal-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.search-modal-close {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.search-modal-close:hover {
    background: rgba(229, 9, 20, 0.1);
    color: #e50914;
    border-color: rgba(229, 9, 20, 0.2);
    transform: rotate(90deg);
}

/* ===================================================================
   BODY (Results Area)
   =================================================================== */

.search-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
    min-height: 300px;
}

.search-modal-body::-webkit-scrollbar {
    width: 6px;
}

.search-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.search-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.search-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===================================================================
   QUICK ACTIONS
   =================================================================== */

.quick-actions-section {
    margin-bottom: 32px;
}

.section-label {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 8px;
}

.quick-action:hover,
.quick-action.focused {
    background: rgba(229, 9, 20, 0.1);
    border-color: rgba(229, 9, 20, 0.3);
    transform: translateX(8px);
}

.quick-action-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #e50914 0%, #b20710 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3);
}

.quick-action-label {
    flex: 1;
    font-weight: 700;
    color: #fff;
    font-size: 15px;
}

.quick-action-arrow {
    color: rgba(255, 255, 255, 0.2);
    font-size: 20px;
    transition: transform 0.3s;
}

.quick-action:hover .quick-action-arrow {
    color: #e50914;
    transform: translateX(4px);
}

/* ===================================================================
   SEARCH HISTORY
   =================================================================== */

.search-history-section {
    margin-bottom: 32px;
}

.clear-history-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    padding: 4px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.clear-history-btn:hover {
    background: #ef4444;
    color: #fff;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 6px;
}

.history-item:hover,
.history-item.focused {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.history-icon {
    color: rgba(255, 255, 255, 0.3);
    font-size: 20px;
}

.history-query {
    flex: 1;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-size: 14px;
}

.history-remove {
    color: rgba(255, 255, 255, 0.2);
    font-size: 18px;
    opacity: 0;
    transition: all 0.2s;
    padding: 4px;
}

.history-item:hover .history-remove {
    opacity: 1;
}

.history-remove:hover {
    color: #ef4444;
    transform: scale(1.1);
}

/* ===================================================================
   SEARCH RESULTS
   =================================================================== */

.search-section {
    margin-bottom: 32px;
}

.section-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-result-item:hover,
.search-result-item.focused {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: scale(1.01);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.result-poster {
    width: 56px;
    height: 84px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-title {
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-title mark {
    background: transparent;
    color: #e50914;
    padding: 0;
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.result-type {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #e50914;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-year {
    color: rgba(255, 255, 255, 0.4);
}

.result-rating {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 12px;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.result-arrow {
    color: rgba(255, 255, 255, 0.1);
    font-size: 22px;
    transition: all 0.3s;
}

.search-result-item:hover .result-arrow {
    color: #e50914;
    transform: translateX(4px);
}

/* ===================================================================
   FOOTER (Keyboard Hints)
   =================================================================== */

.search-modal-footer {
    padding: 16px 28px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.search-modal-hints {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    flex-wrap: wrap;
}

.search-modal-hints span {
    display: flex;
    align-items: center;
    gap: 8px;
}

kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 2px 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ===================================================================
   LOADING & EMPTY STATES
   =================================================================== */

.search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
}

.search-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top-color: #e50914;
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    filter: drop-shadow(0 0 10px rgba(229, 9, 20, 0.5));
}

.search-empty {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.3);
}

.search-empty i {
    font-size: 64px;
    margin-bottom: 20px;
    color: #e50914;
    opacity: 0.5;
}

.search-empty p {
    font-size: 16px;
    font-weight: 500;
}

/* ===================================================================
   ANIMATIONS
   =================================================================== */

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

/* ===================================================================
   MOBILE RESPONSIVE (<768px)
   =================================================================== */

@media (max-width: 768px) {
    .search-modal-overlay {
        padding: 0;
        align-items: flex-start;
    }

    .search-modal {
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        border: none;
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .search-modal-overlay.show .search-modal {
        transform: translateY(0);
    }

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

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

    .search-modal-input {
        font-size: 18px;
    }

    .result-poster {
        width: 48px;
        height: 72px;
    }

    .search-modal-hints {
        display: none;
    }
}