/* ============================================
   ESTIVAGE PRO 2025 - DESIGN MODERNE
   ============================================ */

/* === VARIABLES COULEURS === */
:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --info: #06b6d4;
    --info-light: #cffafe;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* === CARTES STATISTIQUES AMÉLIORÉES === */
.stat-card {
    animation: fadeIn 0.5s ease-out backwards;
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary);
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:nth-child(1) {
    animation-delay: 0s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.2s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.3s;
}

.stat-card:nth-child(5) {
    animation-delay: 0.4s;
}

.stat-card-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.stat-card-change {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.stat-card-change.positive {
    color: var(--success);
}

.stat-card-change.negative {
    color: var(--danger);
}

.stat-card-change svg {
    width: 18px;
    height: 18px;
}

/* === TABLEAUX MODERNES === */
.table-responsive {
    animation: fadeIn 0.6s ease-out;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table thead {
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--gray-100) 100%);
    border-bottom: 2px solid var(--gray-200);
}

.table thead th {
    padding: 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--gray-300);
    position: relative;
    user-select: none;
}

.table thead th:hover:not(:last-child) {
    background: var(--gray-200);
    cursor: pointer;
}

.table thead th .sort-indicator {
    margin-left: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-400);
    transition: all 0.2s;
}

.table thead th:hover .sort-indicator {
    color: var(--primary);
}

.table tbody tr {
    border-bottom: 1px solid var(--gray-100);
    transition: all 0.2s ease;
}

/* ZEBRA STRIPING - lignes alternées */
.table tbody tr:nth-child(even) {
    background-color: var(--gray-50);
}

.table tbody tr:nth-child(odd) {
    background-color: white;
}

.table tbody tr:hover {
    background-color: var(--info-light) !important;
    transform: scale(1.01);
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 1;
}

.table tbody td {
    padding: 1rem;
    color: var(--gray-900);
    font-size: 0.875rem;
}

.table tbody td a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.table tbody td a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.table tbody td.text-right {
    text-align: right;
}

/* === BADGES STATUTS === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    transition: all 0.2s;
}

.badge-success {
    background-color: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success);
}

.badge-danger {
    background-color: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.badge-warning {
    background-color: var(--warning-light);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.badge-info {
    background-color: var(--info-light);
    color: var(--info);
    border: 1px solid var(--info);
}

.badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* === BOUTONS AMÉLIORÉS === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #1d4ed8 100%);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
}

.btn svg {
    width: 18px;
    height: 18px;
}

/* Bouton Filtrer agrandi */
.btn.btn-filter {
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 700;
    box-shadow: var(--shadow-md);
}

.btn.btn-filter:hover {
    box-shadow: var(--shadow-lg);
}

/* === ICÔNES D'ACTION === */
.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.action-icon:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--shadow-md);
}

.action-icon svg {
    width: 20px;
    height: 20px;
}

.action-icon.edit {
    color: var(--primary);
    background-color: rgba(59, 130, 246, 0.1);
}

.action-icon.edit:hover {
    background-color: rgba(59, 130, 246, 0.2);
}

.action-icon.delete {
    color: var(--danger);
    background-color: rgba(239, 68, 68, 0.1);
}

.action-icon.delete:hover {
    background-color: rgba(239, 68, 68, 0.2);
}

.action-icon.view {
    color: var(--info);
    background-color: rgba(6, 182, 212, 0.1);
}

.action-icon.view:hover {
    background-color: rgba(6, 182, 212, 0.2);
}

.action-icon.add {
    color: var(--success);
    background-color: rgba(16, 185, 129, 0.1);
}

.action-icon.add:hover {
    background-color: rgba(16, 185, 129, 0.2);
}

/* === CARDS AMÉLIORÉES === */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease-out;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 1.5rem;
    background: linear-gradient(180deg, var(--gray-50) 0%, white 100%);
    border-bottom: 1px solid var(--gray-200);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

/* === FORMULAIRES === */
select, input[type="text"], input[type="search"] {
    padding: 0.625rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s;
    background: white;
}

select:hover, input[type="text"]:hover, input[type="search"]:hover {
    border-color: var(--gray-400);
}

select:focus, input[type="text"]:focus, input[type="search"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* === EN-TÊTE PAGE === */
.page-header {
    margin-bottom: 2rem;
    animation: slideIn 0.5s ease-out;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
    margin: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--info) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === ALERTS === */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid;
}

.alert-success {
    background-color: var(--success-light);
    border-left-color: var(--success);
    color: var(--success);
}

.alert-danger {
    background-color: var(--danger-light);
    border-left-color: var(--danger);
    color: var(--danger);
}

.alert-warning {
    background-color: var(--warning-light);
    border-left-color: var(--warning);
    color: var(--warning);
}

.alert-info {
    background-color: var(--info-light);
    border-left-color: var(--info);
    color: var(--info);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .stat-card-value {
        font-size: 1.5rem;
    }
    
    .table {
        font-size: 0.8125rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }
    
    .badge {
        font-size: 0.6875rem;
        padding: 0.25rem 0.625rem;
    }
}

/* === LOADING SPINNER === */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === MENU LATÉRAL AMÉLIORÉ === */
.sidebar-nav-link {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.sidebar-nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.sidebar-nav-link:hover::before,
.sidebar-nav-link.active::before {
    transform: scaleY(1);
}

.sidebar-nav-link:hover {
    padding-left: 1.5rem;
    background: rgba(59, 130, 246, 0.05);
}

/* === COMPTEUR NOTIFICATIONS === */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    min-width: 18px;
    text-align: center;
    box-shadow: var(--shadow-md);
    animation: bounce 2s infinite;
}
