/* Responsive Design pour mobile */

@media (max-width: 991.98px) {

    /* Ajustements Barre de Navigation Bootstrap */
    .navbar-collapse {
        background: white;
        padding: 1rem;
        border-radius: 8px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        margin-top: 0.5rem;
    }


    .nav-item {
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .nav-item:last-child {
        border-bottom: none;
    }

    .nav-link {
        padding: 0.8rem 1rem !important;
    }
}

@media (max-width: 768px) {

    /* Forms mobile */
    .form-container {
        padding: 1rem;
        margin: 0.5rem;
    }

    /* Tables mobile transformation en "Cards" */
    .table-responsive {
        border: none;
    }

    .table-responsive table {
        display: block;
        width: 100%;
    }

    .table-responsive thead {
        display: none;
    }

    .table-responsive tbody,
    .table-responsive tr,
    .table-responsive td {
        display: block;
        width: 100%;
    }

    .table-responsive tr {
        margin-bottom: 1.5rem;
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: 12px;
        padding: 0.5rem;
        background: white;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .table-responsive td {
        text-align: right;
        padding: 0.75rem 1rem;
        position: relative;
        border: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .table-responsive td:last-child {
        border-bottom: none;
        text-align: center;
        padding-top: 1rem;
    }

    .table-responsive td:before {
        content: attr(data-label);
        position: absolute;
        left: 1rem;
        width: 120px;
        text-align: left;
        font-weight: 700;
        color: var(--secondary-color);
        font-size: 0.85rem;
        text-transform: uppercase;
    }

    /* Dashboard grids */
    .dashboard-container {
        padding: 1rem;
    }

    .stats-card {
        margin-bottom: 0.5rem;
    }

    /* Boutons et actions */
    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    .btn-group .btn {
        width: 100%;
        margin: 0 !important;
    }

    .w-100-mobile {
        width: 100% !important;
    }
}

/* Pour les très petits écrans (iPhone SE, etc.) */
@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem !important;
    }

    .card-title {
        font-size: 1.2rem !important;
    }

    .table-responsive td:before {
        width: 100px;
        font-size: 0.75rem;
    }

    .table-responsive td {
        padding-left: 110px;
    }
}

/* Orientation paysage */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
    }

    .form-container {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Support du dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #2c3e50;
        --dark-color: #ecf0f1;
    }

    body {
        background-color: #1a1a1a;
        color: #ffffff;
    }

    .card,
    .form-container,
    .stat-card {
        background-color: #2d2d2d;
        color: #ffffff;
    }

    table,
    th,
    td {
        background-color: #2d2d2d;
        color: #ffffff;
        border-color: #444;
    }
}