/* assets/css/responsive.css */

/* ==========================================================================
   BREAKPOINTS - MOBILE FIRST
   ========================================================================== */

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    /* Header adjustments */
    .header-section .form-title {
        font-size: var(--font-size-xl);
    }
    
    .header-section .annee-universitaire {
        font-size: var(--font-size-base);
    }
    
    .logo-placeholder {
        padding: var(--spacing-sm);
    }
    
    /* Form sections */
    .form-section-continu {
        padding: var(--spacing);
        margin-bottom: var(--spacing);
    }
    
    .section-indicator {
        position: static;
        display: inline-block;
        margin-bottom: var(--spacing);
        transform: none;
    }
    
    /* Navigation */
    .nav-ancre {
        position: static;
        margin-bottom: var(--spacing);
    }
    
    /* Field groups */
    .field-group {
        padding: var(--spacing);
    }
    
    /* Grid adjustments */
    .row {
        margin-right: -0.25rem;
        margin-left: -0.25rem;
    }
    
    .row > * {
        padding-right: 0.25rem;
        padding-left: 0.25rem;
    }
    
    /* Buttons */
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: var(--font-size-base);
    }
    
    /* Resident options */
    .resident-option {
        flex-direction: column;
        text-align: center;
        padding: var(--spacing);
    }
    
    .resident-option label {
        margin-top: var(--spacing-sm);
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .header-section .form-title {
        font-size: var(--font-size-xxl);
    }
    
    .form-section-continu {
        padding: var(--spacing-lg);
    }
    
    .section-indicator {
        right: 15px;
        top: 15px;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Navigation */
    .nav-ancre {
        position: sticky;
        top: 10px;
    }
    
    /* Form adjustments */
    .form-section-continu {
        padding: var(--spacing-lg);
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    /* Standard desktop styles already in main CSS */
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* XX-Large devices (larger desktops, 1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */
@media print {
    .btn-retour-haut,
    .save-status,
    .alert-message,
    .nav-ancre,
    .section-indicator,
    .btn,
    .manual-input-btn,
    .progress-line {
        display: none !important;
    }
    
    .form-section-continu {
        border: 1px solid #000;
        box-shadow: none;
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    body {
        background: white;
        color: black;
        font-size: 12pt;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    .header-section {
        background: white !important;
        color: black !important;
        border-bottom: 2px solid black;
    }
    
    .header-section .form-title {
        color: black !important;
    }
    
    .header-section .annee-universitaire {
        color: black !important;
    }
}

/* ==========================================================================
   DARK MODE SUPPORT
   ========================================================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --color-light: #1a1a1a;
        --color-dark: #f8f9fa;
        --color-white: #212529;
        --color-gray: #adb5bd;
    }
    
    body {
        background-color: #121212;
        color: var(--color-dark);
    }
    
    .form-section-continu {
        background-color: #2d2d2d;
        border-left-color: var(--suptech-light-blue);
    }
    
    .field-group {
        background-color: #1e1e1e;
        border-color: #444;
    }
    
    .form-control,
    .form-select {
        background-color: #333;
        color: var(--color-dark);
        border-color: #555;
    }
    
    .form-control:focus,
    .form-select:focus {
        background-color: #333;
        color: var(--color-dark);
    }
    
    .card {
        background-color: #2d2d2d;
        border-color: #444;
    }
    
    .alert-info {
        background-color: #083344;
        border-color: #0c4a6e;
        color: #cff4fc;
    }
    
    .alert-warning {
        background-color: #422006;
        border-color: #854d0e;
        color: #ffecb5;
    }
}

/* ==========================================================================
   HIGH CONTRAST MODE
   ========================================================================== */
@media (prefers-contrast: high) {
    .form-control,
    .form-select {
        border-width: 2px;
    }
    
    .btn {
        border-width: 2px;
    }
    
    .form-section-continu {
        border-width: 2px;
    }
    
    .resident-option {
        border-width: 2px;
    }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .progress-fill {
        transition: none;
    }
    
    .form-section-continu {
        transition: none;
    }
    
    .resident-option {
        transition: none;
    }
    
    .btn-retour-haut {
        transition: none;
    }
}