:root {
    --primary-purple: #8B5CF6;
    --primary-pink: #EC4899;
    --accent-coral: #F97316;
    --dark-bg: #1F2937;
    --light-bg: #F8FAFC;
    --text-dark: #1F2937;
    --text-light: #6B7280;
    --border-color: #E5E7EB;
}

.main-content {
    /* background: linear-gradient(135deg, #FDF2F8 0%, #F3E8FF 50%, #EDE9FE 100%); */
    min-height: 100vh;
    font-family: 'Poppins', sans-serif;
}

.search-section {
    background: transparent;
    padding: 0.75rem 0;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 1rem;
    border: none;
}

.search-bar .input-group {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}

.search-bar .form-select {
    border: none;
    padding: 0.65rem 1rem;
    font-size: 1rem;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    color: var(--text-dark);
    border-radius: 0;
}

.search-bar .form-select:focus {
    box-shadow: none;
    background: white;
}

.search-bar .form-control {
    border: none;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    color: var(--text-dark);
}

.search-bar .form-control:focus {
    box-shadow: none;
    background: white;
}

.search-bar .btn {
    padding: 0.75rem 1.5rem;
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.search-bar .btn-outline-secondary {
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-pink));
    color: white;
    border: none;
}

.search-bar .btn-outline-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

.search-bar .btn-outline-danger {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
    border: none;
}

.search-bar .btn-outline-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.intro-card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background: white;
    cursor: pointer;
}

.intro-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(139, 92, 246, 0.3);
}

.intro-image {
    height: 160px;
    object-fit: cover;
    transition: all 0.3s ease;
}

.intro-image:hover {
    transform: scale(1.05);
}

.card-title {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.card-body {
    padding: 0.75rem;
}

.results-info {
    background: rgba(255, 255, 255, 0.8);
    padding: .5rem 1.0rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.results-info .text-muted {
    color: var(--text-light) !important;
    font-weight: 500;
}

.pagination .page-link {
    border: none;
    color: var(--primary-purple);
    padding: 0.75rem 1rem;
    margin: 0 0.25rem;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-pink));
    color: white;
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-pink));
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-pink));
    color: white;
    border: none;
}

.modal-xl {
    max-width: 95vw;
}

.emulator-container {
    background: #000;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    position: relative;
}

.emulator-frame {
    width: 100%;
    height: 60vh;
    border: none;
    border-radius: 8px;
    background: #000;
}

.main-content .container-fluid {
    padding: 2rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .main-content .container-fluid {
        padding: 1rem;
    }

    .intro-info-banner {
        padding: 1.5rem;
    }

    .search-section {
        padding: 0.5rem;
    }

    .card-body {
        padding: 0.5rem;
    }

    .emulator-frame {
        height: 50vh;
    }

    .modal-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
}

.intro-card {
    transition: transform 0.3s ease;
}

.intro-card:hover {
    transform: translateY(-5px);
}

.intro-image {
    cursor: pointer;
    transition: opacity 0.3s ease;
    height: 140px; /* Reduced from default */
    object-fit: cover;
}

.intro-card:hover .intro-image {
    opacity: 0.8;
}

.icon-btn {
    background: none;
    border: none;
    color: #007bff;
    font-size: 1.1rem; /* Slightly smaller */
    cursor: pointer;
    padding: 3px 6px; /* Reduced padding */
    line-height: 1;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    color: #0056b3;
    text-decoration: none;
    transform: scale(1.1);
}

/* Smaller play button */
.play-btn {
    font-size: 1.3rem; /* Reduced size */
    color: #28a745;
}

.play-btn:hover {
    color: #1e7e34;
}

/* Smaller card body */
.card-body {
    padding: 0.5rem 0.75rem;
}

.card-title {
    font-size: 0.9rem; /* Smaller title */
    margin-bottom: 0.3rem; /* Reduced from 0.5rem */
    line-height: 1.3;
}

/* Lightbox styles */
.lightbox {
    position: fixed;
    inset: 0; /* top:0; right:0; bottom:0; left:0; */
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;

    /* hidden by default */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    position: relative;
    width: 75vw;
    height: 65vh;
    max-width: 1200px;
    background: transparent; /* No blur on iframe container */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    z-index: 10;
}

.lightbox iframe {
    width: 100%;
    height: 100%;
    border: 2px solid white; /* 2px white border */
    border-radius: 12px;
    box-sizing: border-box; /* Padding/border won't affect size */
    display: block;
}

.lightbox-close {
    position: absolute;
    top: -10px;
    right: -10px;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 20;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .lightbox {
        padding: 10px;
    }

    .lightbox-content {
        width: 95vw;
        height: 70vh;
    }

    .lightbox-close {
        top: -5px;
        right: -5px;
        width: 30px;
        height: 30px;
        font-size: 20px;
    }
}

/* Custom column size for 5-across (20%) */
@media (min-width: 1200px) {
    .col-xl-2-4 {
        flex: 0 0 auto;
        width: 20%;
    }
}
