/* Styles pour la gestion des utilisateurs et des rôles */

.user-management-container,
.role-management-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Styles pour les tableaux */
.table-responsive {
    /* border-radius: 8px; */
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.table thead th {
    background-color: #343a40;
    color: white;
    border: none;
    font-weight: 600;
    padding: 15px 12px;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: #FCF1E6;
}

.table tbody td {
    padding: 12px;
    vertical-align: middle;
    border-top: 1px solid #dee2e6;
}

/* Styles pour les badges */
.badge {
    font-size: 0.75em;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
}

.badge.bg-success {
    background-color: #28a745 !important;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
}

.badge.bg-secondary {
    background-color: #6c757d !important;
}

/* Styles pour les boutons d'action */
.btn-group .btn {
    margin-right: 2px;
}

.btn-outline-primary:hover {
    background-color: #2F4F4F;
    border-color: #2F4F4F;
    color: white;
}

.btn-outline-warning:hover {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.btn-outline-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* Styles pour les modales */
.modal {
    z-index: 1050;
}

.modal-dialog {
    margin: 1.75rem auto;
}

.modal-content {
    border: none;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background-color: #FCF1E6;
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
}

.modal-title {
    font-weight: 600;
    color: #495057;
}

.modal-footer {
    background-color: #FCF1E6;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 8px 8px;
}

/* Styles pour les formulaires */
.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.2rem;
}

.form-control,
.form-select {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 0.75rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus,
.form-select:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.text-danger {
    font-size: 0.875em;
    margin-top: 0.25rem;
}

/* Styles pour les cartes de rôles */
.card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.card-body {
    padding: 1rem;
	overflow-y: auto;   /* scroll vertical */
	border: 1px solid #dee2e6;
}

.card-title {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.card-text {
    color: #6c757d;
    line-height: 1.5;
}

/* Styles pour les alertes */
.alert {
    border: none;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* Styles pour les spinners */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Styles pour les icônes */
.oi {
    font-size: 0.875em;
}

/* Responsive design */
@media (max-width: 768px) {
    .user-management-container,
    .role-management-container {
        padding: 10px;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-group .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Styles pour les états de chargement */
.text-center .spinner-border {
    width: 3rem;
    height: 3rem;
    color: #2F4F4F;
}

/* Styles pour les boutons principaux */
.btn-primary {
    background-color: #2F4F4F;
    border-color: #2F4F4F;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    transform: none;
}

/* Styles pour les en-têtes de section */
.d-flex.justify-content-between.align-items-center h2 {
    color: #495057;
    font-weight: 700;
    margin: 0;
}

/* Styles pour les statistiques des rôles */
.text-muted {
    color: #6c757d !important;
    font-size: 0.875em;
}

/* Amélioration de l'accessibilité */
.btn:focus {
    outline: 2px solid #80bdff;
    outline-offset: 2px;
}

.form-control:focus,
.form-select:focus {
    outline: 2px solid #80bdff;
    outline-offset: 2px;
}

/* Styles pour AuthView */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 500px;
}

.auth-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.auth-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.auth-header h2 {
    margin: 0 0 0.5rem 0;
    font-weight: 700;
}

.auth-header p {
    margin: 0;
    opacity: 0.9;
}

.user-info {
    padding: 2rem;
}

.info-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.info-item .label {
    font-weight: 600;
    color: #495057;
    min-width: 140px;
    margin-right: 1rem;
}

.info-item .value {
    color: #6c757d;
    flex: 1;
}

.info-item .roles {
    flex: 1;
}

.auth-actions {
    padding: 0 2rem 2rem 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.auth-actions .btn {
    flex: 1;
}

/* Styles pour AuthGuard */
.container.mt-5 .card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.container.mt-5 .card-body {
    padding: 3rem;
    text-align: center;
}

.container.mt-5 .card-title {
    color: #dc3545;
    font-weight: 700;
    margin-bottom: 1rem;
}

.container.mt-5 .card-text {
    color: #6c757d;
    margin-bottom: 2rem;
}

/* Styles pour les boutons de déconnexion */
.btn-outline-danger {
    color: #dc3545;
    border-color: #dc3545;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-outline-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
    transform: translateY(-1px);
}

/* Responsive pour AuthView */
@media (max-width: 768px) {
    .auth-wrapper {
        padding: 10px;
    }
    
    .auth-header,
    .user-info,
    .auth-actions {
        padding: 1.5rem;
    }
    
    .auth-actions {
        flex-direction: column;
    }
    
    .auth-actions .btn {
        width: 100%;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .info-item .label {
        min-width: auto;
        margin-right: 0;
        margin-bottom: 0.25rem;
    }
}

/* Styles pour la page d'accueil */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.welcome-section {
    padding: 4rem 0;
    background: #FCF1E6;
    min-height: 100vh;
}

.display-3,
.display-4 {
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.lead {
    font-size: 1.25rem;
    font-weight: 300;
    margin-bottom: 2rem;
}

.feature-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
    color: white;
    font-size: 2rem;
}

.feature-card h4 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 1rem;
}

.feature-card p {
    color: #6c757d;
    margin: 0;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.alert-heading {
    color: #0c5460;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.125rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-lg:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-outline-primary {
    color: white;
    border-color: white;
}

.btn-outline-primary:hover {
    background-color: white;
    color: #667eea;
    border-color: white;
}

/* Responsive pour la page d'accueil */
@media (max-width: 768px) {
    .hero-section,
    .welcome-section {
        padding: 2rem 0;
    }
    
    .display-3 {
        font-size: 2.5rem;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .lead {
        font-size: 1.1rem;
    }
    
    .feature-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .d-grid.gap-2.d-md-flex {
        flex-direction: column;
    }
    
    .btn-lg {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Styles pour CornerManagement */
.corner-management-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #FCF1E6;
}

.corner-navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.navbar-left,
.navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-center {
    text-align: center;
}

.corner-info h4 {
    margin: 0;
    font-weight: 700;
}

.corner-info p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.caisse-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.caisse-ouverte {
    background-color: rgba(40, 167, 69, 0.2);
    border: 1px solid #28a745;
}

.caisse-fermee {
    background-color: rgba(220, 53, 69, 0.2);
    border: 1px solid #dc3545;
}

.corner-main-content {
    flex: 1;
    display: flex;
    height: calc(100vh - 200px);
}

.corner-left-panel {
    width: 40%;
    background: white;
    border-right: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.corner-right-panel {
    width: 60%;
    background: #FCF1E6;
    overflow: hidden;
}

.basket-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

.basket-header h5 {
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.basket-items {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.basket-items .table {
    margin: 0;
    border: none;
}

.basket-items .table thead th {
    background-color: #FCF1E6;
    color: #495057;
    border: none;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.75rem 0.5rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.basket-items .table tbody td {
    padding: 0.75rem 0.5rem;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
    vertical-align: middle;
}

.basket-items .table tbody tr:hover {
    background-color: #FCF1E6;
}

.totaux-section {
    background: #FCF1E6;
    border-top: 2px solid #dee2e6;
    padding: 1rem 1.5rem;
}

.total-row,
.taxe-row,
.articles-count-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.total-row {
    font-size: 1.1rem;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}

.taxe-row,
.articles-count-row {
    font-size: 0.9rem;
    color: #6c757d;
}

.total-value,
.taxe-value,
.count-value {
    font-weight: 700;
}

.total-value {
    color: #28a745;
    font-size: 1.2rem;
}

.articles-navigation {
    height: 100%;
    padding: 1rem;
}

/* Styles pour les items cliquables du catalogue */
.cn-item-tile {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    background: white;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cn-item-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-color: #2F4F4F;
}

.cn-item-tile:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cn-item-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
}

.cn-item-image {
    transition: transform 0.2s ease;
}

.cn-item-tile:hover .cn-item-image {
    transform: scale(1.05);
}

.cn-item-name {
    margin-top: 0.5rem;
    text-align: center;
    color: #495057;
}

/* Animation pour l'ajout d'articles */
@keyframes itemAdded {
    0% { background-color: #d4edda; }
    100% { background-color: transparent; }
}

.cn-item-tile.item-added {
    animation: itemAdded 0.5s ease-out;
}

/* Styles pour les boutons d'action dans le panier */
.basket-items .btn-outline-danger {
    border-color: #dc3545;
    color: #dc3545;
    transition: all 0.2s ease;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.basket-items .btn-outline-danger:hover {
    background-color: #dc3545;
    color: white;
    transform: scale(1.1);
}

.basket-items .btn-outline-danger:active {
    transform: scale(0.95);
}

/* Animation pour la suppression d'articles */
@keyframes itemRemoved {
    0% { 
        background-color: #f8d7da; 
        opacity: 1;
    }
    100% { 
        background-color: transparent; 
        opacity: 0;
    }
}

.basket-items tr.item-removing {
    animation: itemRemoved 0.3s ease-out forwards;
}

/* Responsive pour CornerManagement */
@media (max-width: 768px) {
    .corner-navbar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .navbar-left,
    .navbar-right {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .corner-main-content {
        flex-direction: column;
        height: auto;
    }
    
    .corner-left-panel,
    .corner-right-panel {
        width: 100%;
    }
    
    .corner-left-panel {
        height: 50vh;
    }
    
    .corner-right-panel {
        height: 50vh;
    }
    
    .basket-items .table {
        font-size: 0.8rem;
    }
    
    .basket-items .table thead th,
    .basket-items .table tbody td {
        padding: 0.5rem 0.25rem;
    }
    
    .cn-item-tile {
        width: 100%;
        max-width: 200px;
    }
    
    .cn-item-content {
        padding: 0.25rem;
    }
}
