/* Responsive Design - Design cohérent pour tous les écrans d'ordinateur */

/* ===== DESIGN FIXE POUR TOUS LES ÉCRANS D'ORDINATEUR (1024px+) ===== */
@media (min-width: 1024px) {
    /* Hero Section - Design identique sur tous les écrans d'ordinateur */
    .hero-container {
        max-width: 1200px;
        gap: 4rem;
        grid-template-columns: 1fr 1fr;
        align-items: center;
    }
    
    .hero-title {
        font-size: 3.5rem;
        line-height: 1.1;
        margin-bottom: 1.5rem;
        font-weight: 700;
    }
    
    .hero-description {
        font-size: 1.2rem;
        margin-bottom: 2rem;
        color: rgba(255, 255, 255, 0.9);
    }
    
    .hero-buttons {
        gap: 1rem;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
    }
    
    .hero-buttons .btn {
        padding: 14px 28px;
        font-size: 1rem;
        font-weight: 600;
    }
    
    .hero-img {
        height: 400px;
        width: 100%;
        object-fit: cover;
        border-radius: 20px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    }
    
    .hero-left {
        text-align: left;
    }
    
    .hero-right {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    /* Conteneur principal - Taille fixe */
    .container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 20px;
    }
    
    /* Navigation - Taille fixe */
    .nav-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 20px;
    }
    
    /* Typographie fixe */
    h1 { font-size: 3.5rem; }
    h2 { font-size: 3rem; }
    h3 { font-size: 2.5rem; }
    
    /* Présentation Institut */
    .institute-presentation {
        background-image: url('../images/institute-background.jpg');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }
    
    .presentation-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
        align-items: center;
    }
    
    .presentation-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    .presentation-title {
        font-size: 3rem;
        color: #ED1516;
        margin-bottom: 1.5rem;
        font-weight: 700;
        line-height: 1.2;
    }
    
    .presentation-description {
        font-size: 1.1rem;
        color: #64748b;
        line-height: 1.6;
        margin-bottom: 2rem;
    }
    
    /* Filières */
    .filiere-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
        gap: 3rem;
        margin-top: 3rem;
    }
    
    /* Features */
    .features-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 2rem;
    }
    
    /* Programs */
    .programs-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 2rem;
    }
    
    /* News */
    .news-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 2rem;
    }
    
    /* Stats */
    .stats-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 2rem;
        text-align: center;
    }
    
    /* Footer */
    .footer-content {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 2rem;
        margin-bottom: 2rem;
    }
}

/* ===== TABLETTES LANDSCAPE (768px - 1023px) ===== */
@media (min-width: 768px) and (max-width: 1023px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
        max-width: 800px;
    }
    
    .hero-left {
        text-align: center;
    }
    
    .hero-title {
        font-size: 3rem;
        line-height: 1.2;
    }
    
    .hero-description {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }
    
    .hero-buttons {
        justify-content: center;
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    .hero-buttons .btn {
        padding: 0.75rem 1.2rem;
        font-size: 0.9rem;
        min-width: 200px;
    }
    
    .hero-img {
        height: 350px;
        max-width: 600px;
        margin: 0 auto;
    }
    
    .presentation-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .presentation-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    .filiere-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .programs-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .news-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

/* ===== TABLETTES PORTRAIT (481px - 767px) ===== */
@media (min-width: 481px) and (max-width: 767px) {
    .hero {
        padding: 100px 0 60px;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
        padding: 0 20px;
    }
    
    .hero-left {
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.8rem;
        line-height: 1.2;
    }
    
    .hero-description {
        font-size: 1.05rem;
        margin-bottom: 1.8rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 280px;
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .hero-img {
        height: 300px;
        max-width: 500px;
        margin: 0 auto;
    }
    
    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
        padding: 2rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active .bar:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active .bar:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Typography */
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }
    
    .presentation-title {
        font-size: 2.2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .programs-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
}

/* ===== MOBILES (320px - 480px) ===== */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .nav-container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 80px 0 50px;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
        padding: 0 15px;
    }
    
    .hero-left {
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.2rem;
        line-height: 1.2;
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
        width: 100%;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 250px;
        padding: 0.75rem 1.2rem;
        font-size: 0.85rem;
    }
    
    .hero-img {
        height: 250px;
        max-width: 100%;
        margin: 0 auto;
    }
    
    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
        padding: 1.5rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    /* Typography */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.4rem; }
    
    .presentation-title {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .presentation-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .feature-card,
    .program-content,
    .news-content {
        padding: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .cta-title {
        font-size: 1.8rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-large {
        width: 100%;
        max-width: 250px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-bottom-links {
        justify-content: center;
    }
}

/* ===== ORIENTATION LANDSCAPE MOBILE ===== */
@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        padding: 60px 0 40px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-img {
        height: 200px;
    }
    
    .hero-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero-buttons .btn {
        width: auto;
        min-width: 150px;
        margin: 0.25rem;
    }
}

/* ===== OPTIMISATIONS POUR HAUTE DENSITÉ ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo,
    .hero-img,
    .program-image img,
    .news-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ===== STYLES D'IMPRESSION ===== */
@media print {
    .header,
    .footer,
    .cta,
    .hero-buttons {
        display: none;
    }
    
    .hero {
        background: none;
        color: #333;
        padding: 20px 0;
    }
    
    .hero-title {
        color: #333;
    }
    
    .hero-description {
        color: #666;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    .feature-card,
    .program-card,
    .news-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ===== ACCESSIBILITÉ ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* ===== MODE SOMBRE ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #ffffff;
        --secondary-text: #cccccc;
        --card-bg: #2a2a2a;
        --border-color: #333333;
    }
    
    body {
        background-color: var(--bg-color);
        color: var(--text-color);
    }
    
    .header {
        background: rgba(26, 26, 26, 0.95);
    }
    
    .feature-card,
    .program-card,
    .news-card {
        background: var(--card-bg);
        color: var(--text-color);
    }
    
    .feature-title,
    .program-title,
    .news-title {
        color: var(--text-color);
    }
    
    .feature-description,
    .program-description,
    .news-excerpt {
        color: var(--secondary-text);
    }
    
    .nav-link {
        color: var(--text-color);
    }
    
    .nav-menu {
        background: var(--card-bg);
    }
}