/* ============================================
   🎨 MODERN ENHANCEMENTS - EntityAlbum
   ============================================ */

/* === VARIABLES CSS MODERNES === */
:root {
    /* Couleurs principales avec gradients */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --accent-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    
    /* Couleurs solides */
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --accent-color: #f5576c;
    --text-dark: #2d3748;
    --text-light: #718096;
    
    /* Ombres dynamiques */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
    --shadow-glow: 0 0 20px rgba(14, 165, 233, 0.4);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Border radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* === ANIMATIONS KEYFRAMES === */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

/* === AMÉLIORATION DU BODY === */
body {
    background: 
        linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, transparent 100%),
        linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #f1f3f5 100%);
    background-attachment: fixed;
    min-height: 100vh;
    transition: background var(--transition-slow);
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(245, 87, 108, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* === AMÉLIORATION DU MAIN ET ARTICLE === */
main {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.9) 0%, 
        rgba(248, 249, 250, 0.95) 50%, 
        rgba(241, 243, 245, 0.9) 100%);
    min-height: calc(100vh - 3.5rem);
    backdrop-filter: blur(10px);
}

article {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(5px);
}

/* === AMÉLIORATION DES TITRES === */
h1, h2, h3, h4, h5, h6 {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 2.5rem;
    animation: fadeIn 0.5s ease;
}

h2 {
    font-size: 2rem;
    animation: fadeIn 0.6s ease;
}

h3 {
    font-size: 1.5rem;
    animation: fadeIn 0.7s ease;
}

/* === AMÉLIORATION DES BOUTONS === */
.btn,
button:not(.navbar-toggler),
input[type="button"],
input[type="submit"] {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
    font-weight: 500;
    letter-spacing: 0.025em;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.btn::before,
button:not(.navbar-toggler)::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width var(--transition-base), height var(--transition-base);
}

.btn:hover::before,
button:not(.navbar-toggler):hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover,
button:not(.navbar-toggler):hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active,
button:not(.navbar-toggler):active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Forcer les boutons primaires en bleu */
.btn-primary,
.e-btn.e-primary,
.e-control.e-btn.e-lib.e-primary,
button.btn-primary {
    background: linear-gradient(135deg, #0284C7 0%, #0EA5E9 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3) !important;
}

.btn-primary:hover,
.e-btn.e-primary:hover,
button.btn-primary:hover {
    background: linear-gradient(135deg, #0369a1 0%, #0284C7 100%) !important;
    filter: brightness(1.05) !important;
    color: white !important;
}

/* Forcer les boutons secondaires en jaune */
.btn-secondary,
.e-btn.e-secondary,
button.btn-secondary {
    background: linear-gradient(135deg, #FCD34D 0%, #FBBF24 100%) !important;
    border: none !important;
    color: #1E3A8A !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(252, 211, 77, 0.3) !important;
}

.btn-secondary:hover,
.e-btn.e-secondary:hover {
    background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%) !important;
    color: #1E3A8A !important;
}

/* Boutons de succès en bleu ciel */

.btn-success {
    background: linear-gradient(135deg, #0EA5E9 0%, #06B6D4 100%);
    border: none;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #0284C7 0%, #0EA5E9 100%);
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    border: none;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #FCD34D 0%, #FBBF24 100%);
    border: none;
    color: #1E3A8A;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(252, 211, 77, 0.3);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
    box-shadow: 0 6px 16px rgba(252, 211, 77, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, #38BDF8 0%, #0EA5E9 100%);
    border: none;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.btn-info:hover {
    background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%);
    box-shadow: 0 6px 16px rgba(56, 189, 248, 0.4);
}

/* === AMÉLIORATION DES CARTES === */
.card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    animation: fadeIn 0.5s ease;
    background: white;
}

.card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

.card-header {
    background: linear-gradient(135deg, #0284C7 0%, #0EA5E9 100%);
    color: white;
    border: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    font-weight: 700;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.2);
    letter-spacing: 0.025em;
}

.card-body {
    color: #1E3A8A;
}

/* === AMÉLIORATION DES INPUTS === */
.form-control,
.form-select {
    border-radius: var(--radius-md);
    border: 2px solid #e2e8f0;
    transition: all var(--transition-fast);
    padding: 0.625rem 0.875rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
    transform: translateY(-1px);
}

.form-label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

/* === AMÉLIORATION DE LA NAVIGATION === */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 3s ease-in-out infinite;
}

.nav-link {
    position: relative;
    transition: all var(--transition-base);
    border-radius: var(--radius-md);
    margin: 0.25rem 0;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--accent-gradient);
    transition: height var(--transition-base);
    border-radius: 0 3px 3px 0;
}

.nav-link:hover::before {
    height: 70%;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
    padding-left: 1.5rem;
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    font-weight: 600;
}

.nav-link.active::before {
    height: 70%;
}

/* === AMÉLIORATION DES ICÔNES BOOTSTRAP === */
[class*="bi-"]::before {
    transition: all var(--transition-base);
    display: inline-block;
}

.nav-link:hover [class*="bi-"]::before {
    transform: scale(1.2);
}

/* === AMÉLIORATION DU SIDEBAR === */
.sidebar {
    box-shadow: var(--shadow-lg);
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    animation: slideInLeft 0.5s ease;
}

/* === AMÉLIORATION DU CONTENU PRINCIPAL === */
main {
    animation: fadeIn 0.6s ease;
}

.content {
    animation: fadeIn 0.7s ease;
}

/* === AMÉLIORATION DES TABLEAUX === */
.table {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table thead {
    background: var(--primary-gradient);
    color: white;
}

.table tbody tr {
    transition: all var(--transition-fast);
}

.table tbody tr:hover {
    background: rgba(14, 165, 233, 0.05);
    transform: scale(1.01);
    box-shadow: var(--shadow-sm);
}

/* === AMÉLIORATION DES BADGES === */
.badge {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    letter-spacing: 0.025em;
    animation: fadeIn 0.3s ease;
}

/* === AMÉLIORATION DES ALERTS === */
.alert {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border-left: 4px solid;
    animation: slideInRight 0.4s ease;
}

.alert-success {
    background: linear-gradient(135deg, #d4f8e8 0%, #a8e6cf 100%);
    border-left-color: #00f2fe;
}

.alert-danger {
    background: linear-gradient(135deg, #ffe5e5 0%, #ffd1d1 100%);
    border-left-color: #f5576c;
}

.alert-warning {
    background: linear-gradient(135deg, #fef9c3 0%, #fde68a 100%);
    border-left-color: #FCD34D;
}

.alert-info {
    background: linear-gradient(135deg, #e5f5ff 0%, #b4e0ff 100%);
    border-left-color: #4facfe;
}

/* === AMÉLIORATION DES MODALS === */
.modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    animation: fadeIn 0.3s ease;
}

.modal-header {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-footer {
    border: none;
    background: #f8f9fa;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* === AMÉLIORATION DES BREADCRUMBS === */
.breadcrumb {
    background: white;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    animation: slideInRight 0.4s ease;
}

.breadcrumb-item {
    color: #475569;
}

.breadcrumb-item.active {
    color: #0EA5E9;
    font-weight: 700;
}

.breadcrumb-item a {
    color: #0284C7;
    text-decoration: none;
    transition: all 0.3s ease;
}

.breadcrumb-item a:hover {
    color: #FCD34D;
    text-decoration: none;
}

/* === AMÉLIORATION DES SPINNERS/LOADERS === */
.spinner-border {
    animation: spin 0.75s linear infinite, pulse 2s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === SCROLLBAR PERSONNALISÉE === */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-gradient);
}

/* === AMÉLIORATION DES LIENS === */
a:not(.btn):not(.nav-link) {
    color: var(--primary-color);
    text-decoration: none;
    position: relative;
    transition: all var(--transition-base);
}

a:not(.btn):not(.nav-link)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: width var(--transition-base);
}

a:not(.btn):not(.nav-link):hover::after {
    width: 100%;
}

a:not(.btn):not(.nav-link):hover {
    color: var(--primary-dark);
}

/* === EFFET DE CHARGEMENT === */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* === AMÉLIORATION DES LISTES === */
.list-group-item {
    border: 1px solid #e9ecef;
    transition: all var(--transition-base);
    margin-bottom: 0.5rem;
    border-radius: var(--radius-md) !important;
}

.list-group-item:hover {
    background: rgba(102, 126, 234, 0.05);
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

/* === TOOLTIPS AMÉLIORÉS === */
.tooltip-inner {
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    box-shadow: var(--shadow-lg);
}

/* === EFFET DE FOCUS GÉNÉRAL === */
*:focus-visible {
    outline: 3px solid rgba(102, 126, 234, 0.4);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* === AMÉLIORATION DES CHECKBOX ET RADIO === */
.form-check-input {
    cursor: pointer;
    transition: all var(--transition-base);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.form-check-input:hover {
    transform: scale(1.1);
}

/* === AMÉLIORATION DES DROPDOWNS === */
.dropdown-menu {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    animation: fadeIn 0.2s ease;
}

.dropdown-item {
    transition: all var(--transition-fast);
    border-radius: var(--radius-md);
    margin: 0.25rem 0.5rem;
}

.dropdown-item:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateX(5px);
}

/* === AMÉLIORATION DE LA PAGE (RESPONSIVE) === */
.page {
    animation: fadeIn 0.5s ease;
}

/* === UTILITAIRES === */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hover-lift {
    transition: transform var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
}

/* === DARK MODE READY === */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #e2e8f0;
        --text-light: #cbd5e0;
    }
    
    body {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    }
    
    .card {
        background: #2d3748;
        color: #e2e8f0;
    }
}

/* === ANIMATIONS AU SCROLL === */
@media (prefers-reduced-motion: no-preference) {
    .animate-on-scroll {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.6s ease, transform 0.6s ease;
    }
    
    .animate-on-scroll.visible {
        opacity: 1;
        transform: translateY(0);
    }
}
