/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #8B5CF6;
    --secondary-color: #06B6D4;
    --accent-color: #F59E0B;
    --bg-color: #0F0F23;
    --bg-light: #1E1E3F;
    --text-color: #E5E7EB;
    --text-light: #9CA3AF;
    --border-color: #374151;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --error-color: #EF4444;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Orbitron', monospace;
    background: linear-gradient(135deg, var(--bg-color) 0%, var(--bg-light) 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: rgba(30, 30, 63, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Language selector */
.language-selector {
    display: flex;
    gap: 10px;
}

.lang-btn {
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 5px 10px;
    cursor: pointer;
    transition: var(--transition);
}

.lang-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.lang-btn.active {
    border-color: var(--primary-color);
    background: rgba(139, 92, 246, 0.1);
}

.flag {
    width: 24px;
    height: 16px;
    object-fit: cover;
}

/* Main content */
.main {
    flex: 1;
    padding: 2rem 0;
}

/* Hero section */
.hero {
    text-align: center;
    margin-bottom: 4rem;
    padding: 2rem 0;
}

.hero-title {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Site Statistics */
.site-stats {
    margin-bottom: 4rem;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.stat-card {
    background: rgba(30, 30, 63, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Section titles */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

/* Grid layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Console cards */
.console-card {
    background: rgba(30, 30, 63, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.console-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(139, 92, 246, 0.05), transparent);
    opacity: 0;
    transition: var(--transition);
}

.console-card:hover::before {
    opacity: 1;
}

.console-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

/* S'assurer que les liens dans les cartes sont cliquables */
.console-card .btn-primary {
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.console-card a {
    position: relative;
    z-index: 10;
}

.console-stats {
    margin: 1rem 0;
}

.game-count {
    display: inline-block;
    background: rgba(139, 92, 246, 0.2);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(139, 92, 246, 0.3);
    transition: var(--transition);
}

.game-count.real-count {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
    border-color: rgba(16, 185, 129, 0.3);
}

/* Styles pour les compteurs de sections */
.section-count {
    display: block;
    background: rgba(139, 92, 246, 0.2);
    color: var(--primary-color);
    padding: 0.4rem 0.8rem;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(139, 92, 246, 0.3);
    transition: var(--transition);
    margin: 0.8rem auto 1rem auto;
    text-align: center;
    width: fit-content;
    max-width: 150px;
}

.section-count.loaded {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
    border-color: rgba(16, 185, 129, 0.3);
}

.section-count.empty {
    background: rgba(107, 114, 128, 0.2);
    color: var(--text-light);
    border-color: rgba(107, 114, 128, 0.3);
}

.console-image {
    margin-bottom: 1.5rem;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.console-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.console-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.console-description {
    color: var(--text-light);
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
}

.console-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.console-info .console-name {
    order: 1;
}

.console-info .console-description {
    order: 2;
}

.console-info .section-count {
    order: 3;
}

.console-info .btn-primary {
    order: 4;
    margin-top: 0.5rem;
}

/* Buttons */
.btn-primary {
    display: inline-block;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    display: inline-block;
    background: transparent;
    color: var(--primary-color);
    padding: 12px 24px;
    text-decoration: none;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
    margin-right: 10px;
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* Navigation */
.nav-breadcrumb {
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(30, 30, 63, 0.3);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.nav-breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    margin-right: 10px;
}

.nav-breadcrumb a:hover {
    text-decoration: underline;
}

.nav-breadcrumb span {
    color: var(--text-light);
    margin-right: 10px;
}

/* File listing */
.file-listing {
    background: rgba(30, 30, 63, 0.3);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    gap: 15px;
}

.file-item:last-child {
    border-bottom: none;
}

.file-item:hover {
    background: rgba(139, 92, 246, 0.1);
}

.file-icon {
    width: 24px;
    height: 24px;
    opacity: 0.7;
    flex-shrink: 0;
}

.file-name {
    flex: 1;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    min-width: 0; /* Pour permettre la troncature */
}

.file-name:hover {
    color: var(--primary-color);
}

.file-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.file-size {
    color: var(--text-light);
    font-size: 0.9rem;
}

.file-downloads {
    color: var(--secondary-color);
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* États de chargement et d'erreur */
.file-item.loading {
    opacity: 0.7;
    animation: pulse 1.5s ease-in-out infinite;
}

.file-item.error {
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid var(--error-color);
}

.file-item.error .file-name {
    color: var(--error-color);
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* Style pour les fichiers téléchargeables */
.file-item .file-name[download] {
    cursor: pointer;
}

.file-item .file-name[download]:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Footer */
.footer {
    background: rgba(30, 30, 63, 0.9);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-text {
    text-align: center;
    color: var(--text-light);
}

/* Responsive design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .console-card {
        padding: 1rem;
    }
    
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    /* Statistiques responsive */
    .stats-container {
        grid-template-columns: 1fr;
        gap: 1rem;
        max-width: 400px;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
}

/* Media query pour tablettes */
@media (max-width: 1024px) and (min-width: 769px) {
    .stats-container {
        gap: 1rem;
        max-width: 750px;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .console-image {
        height: 80px;
    }
    
    .btn-primary {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    /* Ajustements pour les listes de fichiers sur mobile */
    .file-item {
        padding: 0.8rem;
        gap: 10px;
    }
    
    .file-info {
        align-items: flex-end;
        min-width: 80px;
    }
    
    .file-downloads {
        font-size: 0.75rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.console-card {
    animation: fadeIn 0.6s ease-out;
}

.console-card:nth-child(1) { animation-delay: 0.1s; }
.console-card:nth-child(2) { animation-delay: 0.2s; }
.console-card:nth-child(3) { animation-delay: 0.3s; }
.console-card:nth-child(4) { animation-delay: 0.4s; }
.console-card:nth-child(5) { animation-delay: 0.5s; }
.console-card:nth-child(6) { animation-delay: 0.6s; }

/* Placeholders pour les images manquantes */
.console-img[src*="placeholder"] {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    width: 100px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    border-radius: 4px;
}