/* ========================================
   RESPONSIVE.CSS - Styles responsifs
   Portfolio TI EPHEC - Mohamed El Mazani
   ======================================== */

/* ========================================
   BREAKPOINTS:
   - Mobile: < 576px
   - Tablet: 576px - 768px
   - Desktop Small: 768px - 1024px
   - Desktop: > 1024px
   ======================================== */

/* ========================================
   TABLET LANDSCAPE & SMALL DESKTOP (1024px)
   ======================================== */
@media screen and (max-width: 1024px) {
    /* Container */
    .container {
        max-width: 960px;
    }
    
    /* Navigation */
    .nav-menu {
        gap: var(--spacing-xl);
    }
    
    /* Hero */
    .hero-title {
        font-size: 2.5rem;
    }
    
    /* Info Grid */
    .info-grid {
        grid-template-columns: 1fr;
        max-width: 600px;
        margin: 0 auto;
    }
    
    /* Activities Grid */
    .activities-grid {
        grid-template-columns: 1fr;
    }
    
    /* Portfolio Activities Page */
    .portfolio-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* CV Page */
    .cv-content {
        grid-template-columns: 1fr;
    }
    
    .cv-sidebar {
        order: 2;
    }
    
    .cv-main {
        order: 1;
    }
}

/* ========================================
   TABLET PORTRAIT (768px)
   ======================================== */
@media screen and (max-width: 768px) {
    /* Root adjustments */
    :root {
        --spacing-3xl: 3rem;
    }
    
    /* Typography */
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.35rem;
    }
    
    /* Container */
    .container {
        padding: 0 var(--spacing-lg);
    }
    
    /* Navigation Mobile */
    .navbar {
        padding: 0;
    }
    
    .nav-container {
        padding: 1rem var(--spacing-lg);
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        width: 100%;
        text-align: center;
        transition: var(--transition-base);
        box-shadow: 0 10px 27px rgba(41, 41, 102, 0.1);
        padding: var(--spacing-xl) 0;
        gap: var(--spacing-lg);
        z-index: calc(var(--z-navbar) - 1);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        display: block;
        padding: var(--spacing-sm) var(--spacing-xl);
        font-size: 1.125rem;
    }
    
    .nav-link::after {
        display: none;
    }
    
    .nav-link:hover,
    .nav-link.active {
        background: var(--primary);
    }
    
    /* Hamburger Menu */
    .hamburger {
        display: flex;
    }
    
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
    
    /* Hero Section */
    .hero {
        min-height: calc(100vh - 70px);
        padding: var(--spacing-2xl) 0;
    }
    
    .hero-content {
        padding: 0 var(--spacing-md);
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.3;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    /* Hero Shapes */
    .shape-1 {
        width: 200px;
        height: 200px;
        right: -50px;
    }
    
    .shape-2 {
        width: 150px;
        height: 150px;
        left: -30px;
    }
    
    .shape-3 {
        width: 120px;
        height: 120px;
    }
    
    /* Sections */
    section {
        padding: var(--spacing-2xl) 0;
    }
    
    /* Activities Preview */
    .activities-preview {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    /* Contact CTA */
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
    
    /* CV Page Specific */
    .cv-header {
        flex-direction: column;
        text-align: center;
    }
    
    .cv-photo {
        margin: 0 auto var(--spacing-xl);
    }
    
    .experience-timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        padding-left: 50px;
    }
    
    .timeline-dot {
        left: 14px;
    }
    
    /* Portfolio Activities Page */
    .portfolio-header {
        padding: var(--spacing-xl) 0;
    }
    
    .portfolio-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    .stat-card {
        padding: var(--spacing-md);
    }
    
    .activities-filters {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .activity-card {
        padding: var(--spacing-lg);
    }
    
    /* Tables */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
    
    /* Modals */
    .modal-content {
        width: 95%;
        margin: var(--spacing-md);
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ========================================
   MOBILE LARGE (576px)
   ======================================== */
@media screen and (max-width: 576px) {
    /* Typography */
    body {
        font-size: 0.95rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* Container */
    .container {
        padding: 0 var(--spacing-md);
    }
    
    /* Navigation */
    .nav-logo {
        font-size: 1.25rem;
    }
    
    /* Hero */
    .hero-badge {
        font-size: 0.75rem;
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-description {
        font-size: 0.95rem;
        line-height: 1.7;
    }
    
    /* Buttons */
    .btn {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: 0.95rem;
    }
    
    /* Info Cards */
    .info-card {
        padding: var(--spacing-lg);
    }
    
    /* Portfolio Stats */
    .portfolio-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    /* Activity Cards */
    .activity-card {
        padding: var(--spacing-md);
    }
    
    .activity-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }
    
    /* Forms */
    input, 
    textarea, 
    select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Footer */
    .footer {
        padding: var(--spacing-lg) 0;
    }
    
    .footer-content {
        font-size: 0.875rem;
    }
}

/* ========================================
   MOBILE SMALL (400px)
   ======================================== */
@media screen and (max-width: 400px) {
    /* Root adjustments */
    :root {
        --spacing-xl: 1.5rem;
        --spacing-2xl: 2rem;
        --spacing-3xl: 2.5rem;
    }
    
    /* Typography */
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.35rem;
    }
    
    h3 {
        font-size: 1.15rem;
    }
    
    /* Hero */
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-description {
        font-size: 0.9rem;
    }
    
    /* Scroll indicator */
    .scroll-indicator {
        display: none;
    }
    
    /* Activity Tags */
    .activity-tag {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
    
    /* CV Contact Info */
    .contact-info {
        font-size: 0.875rem;
    }
    
    .contact-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ========================================
   LANDSCAPE MOBILE
   ======================================== */
@media screen and (max-height: 600px) and (orientation: landscape) {
    /* Hero adjustments for landscape mobile */
    .hero {
        min-height: 100vh;
        padding: var(--spacing-xl) 0;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-description {
        margin-bottom: var(--spacing-lg);
    }
    
    .scroll-indicator {
        display: none;
    }
    
    /* Navigation */
    .nav-menu {
        top: 60px;
        padding: var(--spacing-lg) 0;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    /* Hide navigation and non-essential elements */
    .navbar,
    .hamburger,
    .scroll-indicator,
    .hero-visual,
    .contact-cta,
    .footer,
    .btn-secondary,
    .activity-preview-more {
        display: none !important;
    }
    
    /* Reset backgrounds */
    body {
        background: white;
        color: black;
    }
    
    .hero {
        background: none;
        min-height: auto;
        padding: 0;
    }
    
    /* Typography adjustments */
    h1, h2, h3, h4, h5, h6 {
        color: black;
        page-break-after: avoid;
    }
    
    p {
        color: #333;
    }
    
    /* Links */
    a {
        color: black;
        text-decoration: underline;
    }
    
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.8rem;
    }
    
    /* Page breaks */
    section {
        page-break-inside: avoid;
    }
    
    /* CV specific */
    .cv-content {
        grid-template-columns: 1fr;
    }
    
    .cv-sidebar {
        page-break-before: always;
    }
    
    /* Portfolio activities */
    .activity-card {
        page-break-inside: avoid;
        border: 1px solid #ccc;
        margin-bottom: 10px;
    }
}

/* ========================================
   ACCESSIBILITY - REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .hero-shape {
        animation: none;
    }
    
    .scroll-down::after {
        animation: none;
    }
}

/* ========================================
   HIGH CONTRAST MODE
   ======================================== */
@media (prefers-contrast: high) {
    :root {
        --primary: #E6E6FF;
        --primary-dark: #B3B3E6;
        --secondary: #6666CC;
        --accent: #000066;
    }
    
    .navbar {
        border-bottom: 2px solid var(--accent);
    }
    
    .btn {
        border: 2px solid currentColor;
    }
    
    .card,
    .info-card,
    .activity-card {
        border: 2px solid var(--accent);
    }
}

/* ========================================
   DARK MODE SUPPORT (Optional)
   ======================================== */
@media (prefers-color-scheme: dark) {
    /* Uncomment and adjust if dark mode is desired
    :root {
        --white: #1a1a1a;
        --light: #2d2d2d;
        --gray: #b0b0b0;
        --dark: #f0f0f0;
    }
    */
}  

/* Ajoutez dans responsive.css */
@media (max-width: 576px) {
    .cv-header-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .cv-contact {
        flex-direction: column;
        align-items: center;
    }

    div.cv-photo {
        margin-top: 15px;
    }
}
