/* ========================================
   RESPONSIVE DASHBOARD CSS - USERS/999
   ======================================== */

/* Variables CSS pour la responsive */
:root {
    --sidebar-width: 310px;
    --sidebar-collapsed-width: 60px;
    --content-padding: 1.5rem;
    --mobile-padding: 1rem;
    --tablet-padding: 1.25rem;
    
    /* Breakpoints */
    --breakpoint-xs: 576px;
    --breakpoint-sm: 768px;
    --breakpoint-md: 992px;
    --breakpoint-lg: 1200px;
    --breakpoint-xl: 1400px;
}

/* ========================================
   LAYOUT PRINCIPAL RESPONSIVE
   ======================================== */

.wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

#content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--content-padding);
    background: var(--light-bg);
    min-height: 100vh;
    transition: all 0.3s ease;
    width: calc(100% - var(--sidebar-width));
    box-sizing: border-box;
}

.container-fluid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
    width: 100%;
}

/* ========================================
   HEADER DU PROFIL RESPONSIVE
   ======================================== */

.profile-header-v2 {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.profile-info-v2 {
    flex: 1;
    min-width: 0;
}

.profile-name-v2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    color: white;
    line-height: 1.2;
    word-wrap: break-word;
}

.profile-status-v2 {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.profile-details-v2 {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    opacity: 0.9;
}

.profile-detail-item-v2 {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}

/* ========================================
   GRILLE DE CONTENU RESPONSIVE
   ======================================== */

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
}

.col-lg-8, .col-lg-4, .col-md-6, .col-12 {
    padding: 0 0.75rem;
    box-sizing: border-box;
}

.col-lg-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
}

.col-lg-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
}

/* ========================================
   CARTES DE CONTENU RESPONSIVE
   ======================================== */

.content-card-v2 {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
    margin-bottom: 1rem;
    width: 100%;
}

.card-header-v2 {
    background: var(--light-bg);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card-title-v2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.card-body-v2 {
    padding: 1.25rem;
}

/* ========================================
   BOUTONS RESPONSIVE
   ======================================== */

.btn-v2 {
    border-radius: var(--radius-md);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    line-height: 1;
    white-space: nowrap;
    text-align: center;
    justify-content: center;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

/* ========================================
   TABLEAUX RESPONSIVE
   ======================================== */

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.table-v2 {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    min-width: 600px;
}

.table-v2 th,
.table-v2 td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table-v2 th {
    background: var(--light-bg);
    font-weight: 600;
    color: var(--text-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

/* ========================================
   BADGES ET ALERTES RESPONSIVE
   ======================================== */

.badge-v2 {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    text-align: center;
}

.alert-v2 {
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

/* ========================================
   PROGRESS BARS RESPONSIVE
   ======================================== */

.progress-v2 {
    width: 100%;
    height: 0.5rem;
    background-color: var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.progress-bar-v2 {
    height: 100%;
    border-radius: var(--radius-sm);
    transition: width 0.3s ease;
}

/* ========================================
   DOCUMENTS RESPONSIVE
   ======================================== */

.document-list-v2 {
    max-height: 400px;
    overflow-y: auto;
}

.document-item-v2 {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.uploaded-document-item {
    padding: 1rem;
    border: 1px solid var(--success-color);
    border-radius: var(--radius-md);
    background-color: rgba(16, 185, 129, 0.05);
    margin-bottom: 0.75rem;
}

/* ========================================
   TESTS DE NIVEAU RESPONSIVE
   ======================================== */

.test-item-v2 {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--light-bg);
    margin-bottom: 0.75rem;
    transition: var(--transition);
}

.test-item-v2 .row {
    margin: 0;
}

.test-item-v2 .col-md-6 {
    padding: 0.5rem;
}

/* ========================================
   MEDIA QUERIES - TABLETTE (768px - 991px)
   ======================================== */

@media (max-width: 991px) {
    #content {
        margin-left: var(--sidebar-collapsed-width);
        width: calc(100% - var(--sidebar-collapsed-width));
        padding: var(--tablet-padding);
    }
    
    .container-fluid {
        padding: 0;
    }
    
    .profile-header-v2 {
        padding: 1.25rem;
        gap: 1rem;
    }
    
    .profile-name-v2 {
        font-size: 1.25rem;
    }
    
    .profile-details-v2 {
        gap: 0.75rem;
        font-size: 0.8rem;
    }
    
    .col-lg-8 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .col-lg-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .card-header-v2 {
        padding: 0.875rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .card-body-v2 {
        padding: 1rem;
    }
    
    .btn-v2 {
        padding: 0.5rem 0.875rem;
        font-size: 0.8rem;
    }
    
    .table-v2 {
        font-size: 0.8rem;
    }
    
    .table-v2 th,
    .table-v2 td {
        padding: 0.5rem;
    }
}

/* ========================================
   MEDIA QUERIES - MOBILE (max-width: 767px)
   ======================================== */

@media (max-width: 767px) {
    #content {
        margin-left: 0;
        width: 100%;
        padding: var(--mobile-padding);
    }
    
    .container-fluid {
        padding: 0;
    }
    
    .profile-header-v2 {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .profile-name-v2 {
        font-size: 1.125rem;
        text-align: center;
    }
    
    .profile-status-v2 {
        justify-content: center;
        font-size: 0.875rem;
    }
    
    .profile-details-v2 {
        justify-content: center;
        gap: 0.5rem;
        font-size: 0.75rem;
    }
    
    .profile-detail-item-v2 {
        justify-content: center;
        flex: 1 1 auto;
        min-width: 120px;
    }
    
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .card-header-v2 {
        padding: 0.75rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .card-title-v2 {
        font-size: 1rem;
        justify-content: center;
    }
    
    .card-body-v2 {
        padding: 0.75rem;
    }
    
    .btn-v2 {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
        width: 100%;
        justify-content: center;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .table-responsive {
        border: none;
        border-radius: 0;
    }
    
    .table-v2 {
        font-size: 0.75rem;
        min-width: 500px;
    }
    
    .table-v2 th,
    .table-v2 td {
        padding: 0.375rem;
    }
    
    .badge-v2 {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .alert-v2 {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    .document-item-v2 {
        padding: 0.5rem;
    }
    
    .uploaded-document-item {
        padding: 0.75rem;
    }
    
    .test-item-v2 {
        padding: 0.75rem;
    }
    
    .test-item-v2 .col-md-6 {
        padding: 0.25rem;
    }
    
    /* Amélioration de l'espacement sur mobile */
    .mb-3 {
        margin-bottom: 0.5rem !important;
    }
    
    .mt-3 {
        margin-top: 0.5rem !important;
    }
    
    .p-2 {
        padding: 0.375rem !important;
    }
    
    .gap-2 {
        gap: 0.375rem !important;
    }
}

/* ========================================
   MEDIA QUERIES - TRÈS PETIT ÉCRAN (max-width: 575px)
   ======================================== */

@media (max-width: 575px) {
    #content {
        padding: 0.75rem;
    }
    
    .profile-header-v2 {
        padding: 0.875rem;
        border-radius: var(--radius-md);
    }
    
    .profile-name-v2 {
        font-size: 1rem;
    }
    
    .profile-details-v2 {
        flex-direction: column;
        align-items: center;
        gap: 0.375rem;
    }
    
    .profile-detail-item-v2 {
        width: 100%;
        justify-content: center;
    }
    
    .card-header-v2 {
        padding: 0.5rem;
    }
    
    .card-body-v2 {
        padding: 0.5rem;
    }
    
    .btn-v2 {
        padding: 0.5rem;
        font-size: 0.7rem;
    }
    
    .table-v2 {
        font-size: 0.7rem;
        min-width: 400px;
    }
    
    .table-v2 th,
    .table-v2 td {
        padding: 0.25rem;
    }
    
    .badge-v2 {
        font-size: 0.65rem;
        padding: 0.15rem 0.3rem;
    }
    
    .alert-v2 {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .document-item-v2,
    .uploaded-document-item,
    .test-item-v2 {
        padding: 0.5rem;
    }
    
    /* Optimisation des marges et paddings */
    .mb-2 {
        margin-bottom: 0.375rem !important;
    }
    
    .mt-1 {
        margin-top: 0.25rem !important;
    }
    
    .p-2 {
        padding: 0.25rem !important;
    }
}

/* ========================================
   ORIENTATION PAYSAGE SUR MOBILE
   ======================================== */

@media (max-width: 767px) and (orientation: landscape) {
    .profile-header-v2 {
        flex-direction: row;
        text-align: left;
        padding: 0.75rem;
    }
    
    .profile-name-v2 {
        text-align: left;
    }
    
    .profile-status-v2 {
        justify-content: flex-start;
    }
    
    .profile-details-v2 {
        justify-content: flex-start;
        flex-direction: row;
    }
    
    .profile-detail-item-v2 {
        justify-content: flex-start;
    }
}

/* ========================================
   AMÉLIORATIONS D'ACCESSIBILITÉ
   ======================================== */

/* Focus visible pour l'accessibilité */
.btn-v2:focus,
.nav-link:focus,
.card-header-v2:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Amélioration du contraste sur mobile */
@media (max-width: 767px) {
    .text-muted {
        color: #6c757d !important;
    }
    
    .badge-v2 {
        font-weight: 600;
    }
}

/* ========================================
   ANIMATIONS RESPONSIVE
   ======================================== */

@media (prefers-reduced-motion: no-preference) {
    .content-card-v2 {
        animation: fadeInUp 0.5s ease-out;
    }
    
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ========================================
   IMPRESSION
   ======================================== */

@media print {
    #sidebar,
    .btn-v2,
    .card-header-v2 button {
        display: none !important;
    }
    
    #content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 0 !important;
    }
    
    .content-card-v2 {
        box-shadow: none !important;
        border: 1px solid #000 !important;
        break-inside: avoid;
    }
    
    .profile-header-v2 {
        background: #fff !important;
        color: #000 !important;
        border: 2px solid #000 !important;
    }
} 
