/* ========================================
   FIXES FINAUX - RESPONSIVE COMPLET V3
   ======================================== */

/* ========================================
   FIX 1: LOGO NAVIGATION - FORCE LA TAILLE
   ======================================== */

/* Desktop - Taille normale du logo */
.logo,
.logo a {
    font-size: 1.8rem !important;
    font-family: 'Mrs Saint Delafield', sans-serif !important;
    color: #ffffff !important;
    font-weight: bold !important;
    transition: all 0.3s ease;
    line-height: 1 !important;
}

.logo:hover {
    color: #7b00ff !important;
    text-shadow: 0 0 5px rgb(123, 0, 255);
    transform: scale(1.1);
}



/* Mobile - Logo légèrement plus petit mais lisible */
@media (max-width: 768px) {
    .logo {
        font-size: unset; 
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: unset; 
    }
}

/* ========================================
   FIX 2: SECTION ABOUT - LARGEUR ET RESPONSIVE
   ======================================== */

/* Desktop - Code window et Game Boy côte à côte */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.about-text,
.about-visual {
    width: 100%;
    max-width: 100%;
}

.about-visual {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

/* Assurer que la Game Boy ne déborde pas */
.gameboy-container {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
    width: 100%;
    max-width: 100%;
}

/* Code window responsive */
.code-window {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* ========================================
   FIX 3: CACHER LE SCROLL INDICATOR SUR MOBILE
   ======================================== */

.scroll-indicator {
    display: block;
}

@media (max-width: 768px) {
    .scroll-indicator {
        display: none !important;
    }
}

/* ========================================
   RESPONSIVE COMPLET AVEC FIX 572PX
   ======================================== */

/* Tablette Large (1024px et moins) */
@media (max-width: 1024px) {
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-visual {
        order: 2; /* Game Boy après le texte */
    }
    
    .code-window {
        max-width: 100%;
    }
    
    .gameboy-container {
        margin-top: 30px;
    }
}

/* Tablette (768px et moins) */
@media (max-width: 768px) {
    .about-content {
        gap: 1.5rem;
    }
    
    .gameboy {
        width: 260px;
    }
    
    .game-display {
        height: 180px;
    }
    
    .dpad {
        width: 70px;
        height: 70px;
    }
    
    .action-btn {
        width: 45px;
        height: 45px;
        font-size: 14px;
    }
    
    .game-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .info-item {
        padding: 8px 16px;
    }
    
    .info-value {
        font-size: 20px;
    }
    
    /* Ajuster le code window */
    .window-content {
        max-height: 300px;
        font-size: 11px;
    }
    
    .pixel-text {
        font-size: 20px;
    }
    
    .pixel-subtitle {
        font-size: 16px;
    }
    
    .press-start {
        font-size: 10px;
    }
    
    /* Navigation hamburger */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: rgba(0, 0, 0, 0.98);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
        gap: 1.5rem;
        backdrop-filter: blur(10px);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-social {
        display: none;
    }
    
    .nav-social.active {
        display: flex;
        justify-content: center;
        gap: 1rem;
        top: -17px;
    }
}

/* Mobile (600px et moins) */
@media (max-width: 600px) {
    .about-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 2.5rem !important;
    }
    
    .gameboy {
        width: 240px;
        padding: 15px;
    }
    
    .game-display {
        height: 160px;
    }
    
    .dpad {
        width: 65px;
        height: 65px;
    }
    
    .action-btn {
        width: 40px;
        height: 40px;
        font-size: 13px;
    }
    
    .action-buttons {
        gap: 10px;
    }
    
    .menu-btn {
        padding: 5px 15px;
        font-size: 8px;
    }
    
    .gameboy-speaker {
        padding: 0 30px;
    }
    
    .speaker-hole {
        height: 6px;
    }
    
    .gameboy-logo {
        margin-top: 10px;
    }
    
    .gameboy-logo .logo-text {
        font-size: 10px !important;
    }
    
    .gameboy-logo .logo-color {
        font-size: 8px !important;
    }
    
    .pixel-text {
        font-size: 18px;
    }
    
    .pixel-subtitle {
        font-size: 14px;
    }
    
    .game-over-text {
        font-size: 18px;
    }
    
    .game-over-score {
        font-size: 12px;
    }
    
    .restart-text {
        font-size: 10px;
    }
}

/* FIX CRITIQUE: 572px - Zone problématique */
@media (max-width: 572px) {
    /* About section */
    .about-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .about-text {
        width: 100%;
    }
    
    .about-visual {
        width: 100%;
    }
    
    /* Game Boy adaptée */
    .gameboy {
        width: 230px;
        padding: 14px;
    }
    
    .game-display {
        height: 155px;
    }
    
    .dpad {
        width: 62px;
        height: 62px;
    }
    
    .action-btn {
        width: 42px;
        height: 42px;
        font-size: 13px;
    }
    
    /* Code window */
    .code-window {
        max-width: 100%;
        width: 100%;
    }
    
    .window-content {
        max-height: 280px;
        font-size: 10.5px;
    }
    
    /* Skills grid */
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Projects grid */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Container */
    .container {
        width: 95%;
        padding: 0 0.75rem;
    }
    
    /* Stats */
    .about-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .stat-number {
        font-size: 2.3rem !important;
    }
    
    /* Hero */
    .hero-title {
        font-size: 1.9rem;
    }
    
    .typing-text {
        font-size: 1.1rem;
    }
}

/* Très petit mobile (480px et moins) */
@media (max-width: 480px) {
    .gameboy-container {
        padding: 10px;
    }
    
    .gameboy {
        width: 220px;
        padding: 12px;
    }
    
    .game-display {
        height: 140px;
    }
    
    .dpad {
        width: 60px;
        height: 60px;
    }
    
    .dpad-btn {
        font-size: 16px;
    }
    
    .action-btn {
        width: 38px;
        height: 38px;
        font-size: 12px;
    }
    
    .gameboy-controls {
        margin: 20px 0;
    }
    
    .info-item {
        padding: 6px 12px;
    }
    
    .info-label {
        font-size: 9px;
    }
    
    .info-value {
        font-size: 18px;
    }
    
    /* Code window encore plus petit */
    .window-content {
        max-height: 250px;
        font-size: 10px;
    }
    
    .window-content pre {
        padding: 8px;
    }
    
    .about-text h3 {
        font-size: 1.2rem;
    }
    
    .about-text p {
        font-size: 0.9rem;
    }
}

/* ========================================
   FIX GRILLES PROJETS RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-card {
        max-width: 500px;
        margin: 0 auto;
    }
}

@media (max-width: 572px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .project-card {
        max-width: 100%;
        width: 100%;
    }
}

/* ========================================
   FIX SKILLS GRID RESPONSIVE
   ======================================== */

@media (max-width: 900px) {
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 600px) {
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 572px) {
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 0.875rem;
    }
    
    .skill-card {
        padding: 1rem;
    }
}

/* ========================================
   FIX HERO RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .hero-content {
        padding: 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .typing-text {
        font-size: 1.2rem;
    }
}

@media (max-width: 572px) {
    .hero-title {
        font-size: 1.9rem;
    }
    
    .typing-text {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .typing-text {
        font-size: 1rem;
    }
}

/* ========================================
   FIX CONTAINER GLOBAL
   ======================================== */

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 0 0.5rem;
    }
}

@media (max-width: 572px) {
    .container {
        width: 96%;
        padding: 0 0.75rem;
    }
}

/* ========================================
   AMÉLIORATION ANIMATIONS SUR MOBILE
   ======================================== */

@media (max-width: 768px) {
    /* Désactiver l'animation de flottaison du code window sur mobile */
    .code-window {
        animation: none !important;
    }
    
    /* Réduire les effets de parallax */
    .about-visual {
        transform: none !important;
    }
    
    /* Simplifier les hovers sur mobile */
    .project-card:hover,
    .skill-card:hover {
        transform: translateY(-3px) !important;
    }
}

/* ========================================
   FIX SPACING SECTIONS
   ======================================== */

section {
    padding: 4rem 0;
}

@media (max-width: 768px) {
    section {
        padding: 3rem 0;
    }
}

@media (max-width: 572px) {
    section {
        padding: 2.5rem 0;
    }
}

@media (max-width: 480px) {
    section {
        padding: 2rem 0;
    }
}

/* ========================================
   FIX BOUTONS RESPONSIVE
   ======================================== */

.btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 572px) {
    .btn {
        padding: 0.65rem 1.1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
}

/* ========================================
   FIX FOOTER RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .footer-social {
        justify-content: center;
    }
}

/* ========================================
   FIX HAMBURGER MENU
   ======================================== */

@media (max-width: 768px) {
    .hamburger {
        display: flex;
        flex-direction: column;
        cursor: pointer;
        padding: 10px;
    }

    .hamburger span {
    width: 25px;
    height: 3px;
    background: var(--color-text);
    border-radius: 2px;
    display: block;
    transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .hamburger.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}

/* ========================================
   FIX OVERFLOW GÉNÉRAL
   ======================================== */

html {
    overflow-x: hidden;
}

* {
    max-width: 100%;
}

/* Assurer qu'aucune section ne déborde */
section {
    overflow-x: hidden;
}

.about,
.skills,
.projects,
.contact {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* ========================================
   FIX SPÉCIAL POUR ÉVITER LE RÉTRÉCISSEMENT
   ======================================== */

/* Empêcher tous les éléments de rapetisser anormalement */
@media (max-width: 572px) {
    /* Glass cards */
    .glass-card {
        padding: 1.5rem;
        width: 100%;
    }
    
    /* Project cards */
    .project-card {
        width: 100%;
        max-width: 100%;
    }
    
    /* Skill cards */
    .skill-card {
        width: 100%;
        min-height: 120px;
    }
    
    /* Textes */
    body {
        font-size: 15px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.35rem;
    }
    
    p {
        font-size: 0.95rem;
        line-height: 1.6;
    }
}

/* ========================================
   FIX NAVIGATION RESPONSIVE À 572PX
   ======================================== */

@media (max-width: 572px) {
    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-menu {
        top: 65px;
        padding: 1.5rem 0;
    }
    
    .nav-menu li a {
        font-size: 1rem;
        padding: 0.75rem;
    }
}

/* ========================================
   FIX ABOUT SECTION - RESPONSIVE
   Problème racine : les enfants d'un CSS Grid ont min-width:auto
   par défaut, ce qui leur permet de déborder hors du grid.
   Le fix est dans style.css (min-width:0 + overflow:hidden).
   Ici on gère uniquement la mise en page responsive.
   ======================================== */

/* ---- BASE (toutes tailles) ---- */

/* La about-visual empile code-window + gameboy verticalement */
.about-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

/* Game-info : supprime le translateY négatif du CSS de base */
.game-info {
    transform: none !important;
    display: flex;
    gap: 20px;
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
}

.info-item {
    top: 0 !important;
}

/* Code window */
.code-window {
    width: 100%;
    max-width: 500px;
    box-sizing: border-box;
    min-width: 0;
}

/* ---- TABLETTE LARGE (≤1024px) ---- */
@media (max-width: 1024px) {
    .about-content {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }

    .about-text,
    .about-visual {
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    .about-visual {
        order: 2;
        align-items: center;
    }

    .code-window {
        max-width: 100%;
        margin: 0 auto;
    }

    .gameboy {
        width: 320px !important;
        top: 0 !important;
    }

    .game-display {
        height: 215px !important;
    }

    .gameboy-container {
        margin-top: 10px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

/* ---- TABLETTE / MOBILE (≤768px) ---- */
@media (max-width: 768px) {
    /* Fusée hero : on la garde mais petite et statique */
    .hero-visual {
        order: -1;
        margin-bottom: -20px;
    }

    .floating-card {
        width: 180px !important;
        height: 180px !important;
        animation: none !important; /* stop float animation */
    }

    .astronaut {
        font-size: 110px !important;
    }

    .card-glow {
        opacity: 0.4;
        filter: blur(30px);
    }

    /* About */
    .about-content {
        gap: 1.5rem;
        padding: 0;
    }

    .about-text,
    .about-visual {
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    .code-window {
        max-width: 100%;
        width: 100%;
    }

    .window-content {
        max-height: 260px;
    }

    .window-content pre {
        font-size: 11px;
    }

    /* Game Boy */
    .gameboy-container {
        margin-top: 0;
        padding: 10px;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .gameboy {
        width: 310px !important;
        top: 0 !important;
    }

    .game-display {
        height: 210px !important;
    }

    .game-info {
        flex-direction: row;
        gap: 15px;
        padding: 0 10px;
        margin-top: 10px;
    }

    .info-item {
        flex: 1;
        max-width: 130px;
        padding: 8px 12px !important;
    }

    .info-value {
        font-size: 20px !important;
    }

    .about-stats {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.75rem;
    }

    .stat-number {
        font-size: 1.8rem !important;
    }
}

/* ---- MOBILE (≤600px) ---- */
@media (max-width: 600px) {
    .about-visual {
        gap: 0.75rem;
        align-items: center;
        width: 100%;
        overflow: hidden;
    }

    .code-window {
        border-radius: 12px;
        max-width: 100%;
    }

    .window-content {
        padding: 0.75rem;
        max-height: 220px;
    }

    .window-content pre {
        font-size: 10px;
        line-height: 1.6;
    }

    .gameboy {
        width: 290px !important;
        padding: 16px !important;
        top: 0 !important;
    }

    .game-display {
        height: 195px !important;
    }

    .game-info {
        gap: 10px;
    }

    .info-item {
        padding: 6px 10px !important;
    }

    .info-label {
        font-size: 9px !important;
    }

    .info-value {
        font-size: 18px !important;
    }

    .about-stats {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.5rem;
    }

    .stat-number {
        font-size: 1.6rem !important;
    }

    .stat-label {
        font-size: 0.75rem;
    }
}

/* ---- TRÈS PETIT MOBILE (≤480px) — iPhone SE etc. ---- */
@media (max-width: 480px) {
    .floating-card {
        width: 150px !important;
        height: 150px !important;
    }

    .astronaut {
        font-size: 90px !important;
    }

    .window-content {
        max-height: 200px;
        padding: 0.6rem;
    }

    .window-content pre {
        font-size: 9.5px;
    }

    .gameboy {
        width: 270px !important;
        padding: 14px !important;
        top: 0 !important;
    }

    .game-display {
        height: 180px !important;
    }

    .dpad {
        width: 65px !important;
        height: 65px !important;
    }

    .action-btn {
        width: 42px !important;
        height: 42px !important;
        font-size: 13px !important;
    }

    .game-info {
        gap: 8px;
    }

    .info-value {
        font-size: 16px !important;
    }

    .about-stats {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .stat-number {
        font-size: 1.5rem !important;
    }
}

/* ---- ULTRA PETIT (≤380px) ---- */
@media (max-width: 380px) {
    .gameboy {
        width: 250px !important;
        padding: 12px !important;
        top: 0 !important;
    }

    .game-display {
        height: 165px !important;
    }

    .dpad {
        width: 58px !important;
        height: 58px !important;
    }

    .action-btn {
        width: 38px !important;
        height: 38px !important;
        font-size: 12px !important;
    }

    .action-buttons {
        gap: 8px !important;
    }

    .gameboy-controls {
        padding: 0 5px !important;
    }

    .about-stats {
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 0.4rem;
    }

    .stat-number {
        font-size: 1.3rem !important;
    }

    .stat-label {
        font-size: 0.7rem;
    }
}