:root {
    --vmvs-bg: rgba(10, 10, 10, 0.95);
    --vmvs-glass: rgba(255, 255, 255, 0.05);
    --vmvs-accent: #e6b91e;
    --vmvs-text: #ffffff;
    --vmvs-text-muted: #aaaaaa;
}

#vmvs-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.vmvs-overlay-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--vmvs-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.vmvs-search-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 85vh;
    background: var(--vmvs-glass);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Header */
.vmvs-search-header {
    padding: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
}

.vmvs-search-input-wrap {
    flex-grow: 1;
    position: relative;
}

.vmvs-search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: var(--vmvs-accent);
}

#vmvs-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    padding: 15px 15px 15px 60px;
    border-radius: 12px;
    color: #fff;
    font-size: 28px;
    font-weight: 300;
    outline: none;
    transition: all 0.3s ease;
}

#vmvs-search-input:focus {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 2px var(--vmvs-accent);
}

.vmvs-close-btn {
    background: none;
    border: none;
    color: var(--vmvs-text-muted);
    font-size: 40px;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.vmvs-close-btn:hover {
    color: #fff;
}

/* Body */
.vmvs-search-body {
    flex-grow: 1;
    display: grid;
    grid-template-columns: 280px 1fr;
    overflow: hidden;
}

/* Filters */
.vmvs-filters {
    padding: 30px;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    color: #fff;
    overflow-y: auto;
}

.vmvs-filters h3 {
    font-size: 18px;
    margin-bottom: 25px;
    color: var(--vmvs-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.vmvs-filter-group {
    margin-bottom: 30px;
}

.vmvs-filter-group h4 {
    font-size: 14px;
    margin-bottom: 15px;
    color: var(--vmvs-text-muted);
}

.vmvs-filter-group label {
    display: block;
    margin-bottom: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #ddd;
    transition: color 0.2s;
}

.vmvs-filter-group label:hover {
    color: #fff;
}

.vmvs-filter-group input {
    margin-right: 10px;
    accent-color: var(--vmvs-accent);
}

.vmvs-filter-scroll {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 10px;
}

.vmvs-filter-scroll::-webkit-scrollbar {
    width: 4px;
}

.vmvs-filter-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

#vmvs-year-filter {
    width: 100%;
    background: #222;
    color: #fff;
    border: 1px solid #333;
    padding: 8px;
    border-radius: 4px;
}

/* Results */
.vmvs-results {
    padding: 30px;
    overflow-y: auto;
}

.vmvs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
}

.vmvs-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 100px 0;
    color: var(--vmvs-text-muted);
    font-size: 20px;
}

/* Item Card */
.vmvs-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, background 0.3s ease;
    text-decoration: none;
    display: block;
}

.vmvs-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
}

.vmvs-item-thumb {
    aspect-ratio: 1/1;
    background-size: cover;
    background-position: center;
    position: relative;
}

.vmvs-item-type {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    text-transform: uppercase;
    color: var(--vmvs-accent);
}

.vmvs-item-info {
    padding: 15px;
}

.vmvs-item-title {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vmvs-item-meta {
    color: var(--vmvs-text-muted);
    font-size: 12px;
}

/* Loading Spinner */
.vmvs-loader {
    width: 48px;
    height: 48px;
    border: 5px solid #FFF;
    border-bottom-color: var(--vmvs-accent);
    border-radius: 50%;
    display: block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    margin: 50px auto;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Results Animation */
.vmvs-grid .vmvs-item {
    animation: itemReveal 0.4s ease forwards;
    opacity: 0;
}

@keyframes itemReveal {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Staggered Delay for grid items */
.vmvs-grid .vmvs-item:nth-child(1) {
    animation-delay: 0.05s;
}

.vmvs-grid .vmvs-item:nth-child(2) {
    animation-delay: 0.1s;
}

.vmvs-grid .vmvs-item:nth-child(3) {
    animation-delay: 0.15s;
}

.vmvs-grid .vmvs-item:nth-child(4) {
    animation-delay: 0.2s;
}

.vmvs-grid .vmvs-item:nth-child(5) {
    animation-delay: 0.25s;
}

.vmvs-grid .vmvs-item:nth-child(6) {
    animation-delay: 0.3s;
}

.vmvs-grid .vmvs-item:nth-child(7) {
    animation-delay: 0.35s;
}

.vmvs-grid .vmvs-item:nth-child(8) {
    animation-delay: 0.4s;
}

/* Animations */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

#vmvs-search-overlay.active {
    display: flex !important;
    animation: fadeIn 0.3s ease;
}

.vmvs-search-container {
    animation: fadeInScale 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .vmvs-search-body {
        grid-template-columns: 1fr;
        padding-bottom: 20px;
        /* Add padding for scrolling */
    }

    .vmvs-search-container {
        width: 100%;
        height: 100%;
        max-width: none;
        border-radius: 0;
        border: none;
    }

    .vmvs-filters {
        display: none;
        /* Hide filters on mobile for now or make them a toggle */
    }

    .vmvs-search-header {
        padding: 15px;
    }

    #vmvs-search-input {
        font-size: 18px;
        padding-left: 45px;
    }

    .vmvs-search-icon {
        font-size: 18px;
        left: 15px;
    }

    /* 2 Column Grid for Mobile */
    .vmvs-grid,
    .vmvs-section-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }

    /* Adjust cards for 2 columns */
    .vmvs-item-title {
        font-size: 13px;
    }

    .vmvs-item-info {
        padding: 10px;
    }

    /* Fix Header Spacing - Aggressive Space Saving */
    .vmvs-search-header {
        padding: 15px 5px 15px 10px;
        /* Reduced right padding significantly */
        gap: 5px;
        /* Minimal gap */
    }

    .vmvs-search-input-wrap {
        flex: 1;
        width: auto;
        /* Allow flex to control width */
    }

    #vmvs-search-input {
        width: 100% !important;
        max-width: none !important;
        padding-right: 10px;
        /* Reduce internal right padding if needed */
    }

    .vmvs-close-btn {
        font-size: 32px;
        /* Smaller close button on mobile */
        padding: 0 5px;
        /* Ensure clickable area but visually tight */
    }
}

/* Search Result Sections */
.vmvs-section {
    margin-bottom: 40px;
    position: relative;
}

.vmvs-section:last-child {
    margin-bottom: 0;
}

.vmvs-section-title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--vmvs-accent);
    /* Gold accent */
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
}

.vmvs-section-title::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background: linear-gradient(to right, rgba(230, 185, 30, 0.3), transparent);
    margin-left: 20px;
}

.vmvs-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
}