/* Variables CSS pour une cohérence de design */
:root {
    --primary-color: #667eea;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-color: #f093fb;
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-color: #4facfe;
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-color: #ffecd2;
    --warning-gradient: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    --danger-color: #ff9a9e;
    --danger-gradient: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    --dark-color: #2c3e50;
    --light-color: #f8f9fa;
    --background-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
    --border-radius: 15px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --navbar-height: 70px;
    
    /* Couleurs spécifiques aux alertes */
    --alert-low: #e3f2fd;
    --alert-low-border: #2196f3;
    --alert-moderate: #fff3e0;
    --alert-moderate-border: #ff9800;
    --alert-high: #fce4ec;
    --alert-high-border: #e91e63;
    --alert-critical: #ffebee;
    --alert-critical-border: #f44336;
}

/* Animations */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes flash {
    0%, 50%, 100% {
        opacity: 1;
    }
    25%, 75% {
        opacity: 0.5;
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -8px, 0);
    }
    70% {
        transform: translate3d(0, -4px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

.pulse {
    animation: pulse 0.5s ease-in-out;
}

.slide-in-up {
    animation: slideInUp 0.3s ease-out;
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-up {
    animation: slideUp 0.4s ease-out;
}

.pulse-animation {
    animation: pulse 1s ease-in-out infinite;
}

.flash-animation {
    animation: flash 0.5s ease-in-out 4;
}

.bounce-animation {
    animation: bounce 0.6s ease-out;
}

/* Animations spécifiques aux alertes */
@keyframes alertBlink {
    0%, 50% { opacity: 1; }
    25%, 75% { opacity: 0.7; }
}

.alert-blink {
    animation: alertBlink 1s ease-in-out 3;
}

/* Transitions pour les cartes d'alertes */
.alert-card-enter {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.alert-card-enter-active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Badge d'alertes avec animation */
.badge.animate-pulse {
    animation: pulse 1s ease-in-out infinite;
}

/* Indicateur de mise à jour en temps réel */
.realtime-indicator {
    position: relative;
}

.realtime-indicator::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

/* Styles pour les notifications de mise à jour */
.update-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1060;
    max-width: 300px;
    animation: slideInUp 0.3s ease-out;
}

/* Amélioration des transitions pour les compteurs */
.counter-update {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.counter-update.changed {
    animation: pulse 0.5s ease-in-out;
}

/* Styles généraux modernisés */
body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    min-height: 100vh;
    padding-top: var(--navbar-height);
}

.container {
    max-width: 1200px;
}

/* Navigation moderne fixe */
.navbar-modern {
    background: var(--primary-gradient);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: var(--navbar-height);
    transition: var(--transition);
    z-index: 1030;
}

.navbar-modern .navbar-brand {
    color: white !important;
    font-weight: 700;
    font-size: 1.3rem;
    text-decoration: none;
    transition: var(--transition);
}

.navbar-modern .navbar-brand:hover {
    transform: scale(1.05);
    color: rgba(255, 255, 255, 0.9) !important;
}

.navbar-modern .brand-text {
    background: linear-gradient(45deg, #ffffff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-modern .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 500;
    padding: 0.75rem 1rem !important;
    border-radius: 10px;
    margin: 0 0.25rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.navbar-modern .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.navbar-modern .nav-link:hover::before {
    left: 100%;
}

.navbar-modern .nav-link:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.navbar-modern .nav-link.active {
    color: white !important;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

/* Bouton hamburger pour mobile */
.navbar-modern .navbar-toggler {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 0.5rem;
    transition: var(--transition);
}

.navbar-modern .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.navbar-modern .navbar-toggler:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
}

.navbar-modern .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    width: 1.5em;
    height: 1.5em;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-actions .btn {
    border-radius: 20px;
    font-weight: 500;
    transition: var(--transition);
}

.navbar-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

.status-indicator .badge {
    background: var(--success-gradient);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

/* Contenu principal avec marge pour navbar fixe */
.main-content {
    min-height: calc(100vh - var(--navbar-height));
    padding-top: 1rem;
}

/* Header modernisé */
header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header p {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* Cartes modernisées */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--card-shadow-hover);
}

.card-header {
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
    border-bottom: none;
    padding: 1rem 1.5rem;
    position: relative;
}

.card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
}

.card-body {
    padding: 1.5rem;
}

/* Carte d'état du système améliorée */
.status-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 250, 0.95));
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.status-card .card-body {
    padding: 2rem;
}

.status-info h5 {
    color: var(--primary-color);
    font-weight: 600;
}

.metric-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.metric-label {
    color: #6c757d;
    margin-right: 0.5rem;
}

.metric-value {
    font-weight: 600;
    color: var(--primary-color);
}

.quick-actions .btn {
    border-radius: 20px;
    font-weight: 500;
    transition: var(--transition);
}

.quick-actions .btn:hover {
    transform: translateY(-2px);
}

/* Cartes de capteurs améliorées */
.sensor-card {
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.sensor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.8s;
    z-index: 1;
}

.sensor-card:hover::before {
    left: 100%;
}

.sensor-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.2);
}

.sensor-actions .btn {
    border-radius: 25px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    z-index: 2;
}

/* Boutons modernisés */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: var(--transition);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary-gradient);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn-outline-secondary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-secondary:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-2px);
}

/* Navigation par onglets pour les paramètres */
.settings-nav {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.settings-nav .nav-link {
    border-radius: 10px;
    color: var(--dark-color);
    font-weight: 500;
    transition: var(--transition);
    border: none;
    background: transparent;
}

.settings-nav .nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.settings-nav .nav-link.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.settings-card {
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* État du système amélioré */
#sensors-count {
    background: var(--success-gradient);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

#last-update {
    font-weight: 600;
    color: var(--primary-color);
}

/* Styles pour l'analyse IA modernisés */
.analysis-result {
    transition: var(--transition);
    margin-top: 1rem;
}

.analysis-result .alert {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: var(--border-radius);
    backdrop-filter: blur(5px);
}

.analysis-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--dark-color);
}

.close-analysis-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    opacity: 0.7;
    transition: var(--transition);
}

.close-analysis-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.analyze-btn {
    background: var(--secondary-gradient);
    border: none;
    color: white;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
}

.analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.6);
}

.analyze-btn:disabled {
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

/* Styles pour les données de capteurs modernisés */
.sensor-data-list {
    margin-bottom: 0;
    padding: 0;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.sensor-item-container {
    border: none;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.4));
    margin-bottom: 0.5rem;
    border-radius: 10px;
    transition: var(--transition);
    backdrop-filter: blur(5px);
}

.sensor-item-container:hover {
    transform: translateX(5px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));
}

.sensor-item-container:last-child {
    margin-bottom: 0;
}

.sensor-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.sensor-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sensor-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-color);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Styles spécifiques par type de capteur avec dégradés */
[data-sensor-type="temperature"] .sensor-value {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-sensor-type="humidity"] .sensor-value {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-sensor-type="pm25"] .sensor-value {
    background: linear-gradient(135deg, #a29bfe, #6c5ce7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-sensor-type="voc"] .sensor-value {
    background: linear-gradient(135deg, #fd79a8, #e84393);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-sensor-type="battery"] .sensor-value {
    background: linear-gradient(135deg, #00b894, #00a085);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-sensor-type="co2"] .sensor-value {
    background: linear-gradient(135deg, #00cec9, #00b894);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-sensor-type="water_consumption"] .sensor-value {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-sensor-type="water_flow"] .sensor-value {
    background: linear-gradient(135deg, #00cec9, #00b894);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-sensor-type="gas_consumption"] .sensor-value {
    background: linear-gradient(135deg, #fdcb6e, #e17055);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-sensor-type="gas_power"] .sensor-value {
    background: linear-gradient(135deg, #fd79a8, #e84393);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Indicateurs de batterie modernisés */
.sensor-battery-low {
    background: var(--danger-gradient) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.sensor-battery-medium {
    background: var(--warning-gradient) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.sensor-battery-high {
    background: var(--success-gradient) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* Disposition des cartes responsives améliorée */
@media (min-width: 576px) {
    .sensor-data-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 0.75rem;
    }
    
    .sensor-item-container {
        margin-bottom: 0;
    }
}

/* Animations modernisées */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in {
    animation: slideInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Spinner modernisé */
.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
    border-color: var(--primary-color);
    border-right-color: transparent;
}

.loading-state {
    padding: 3rem;
    text-align: center;
}

/* Responsive amélioré */
@media (max-width: 768px) {
    .navbar-modern .brand-text {
        display: none;
    }
    
    .navbar-actions .btn span {
        display: none !important;
    }
    
    /* Menu mobile collapsé */
    .navbar-modern .navbar-collapse {
        background: var(--primary-gradient);
        border-radius: 10px;
        margin-top: 0.5rem;
        padding: 1rem;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    }
    
    .navbar-modern .navbar-nav {
        margin-bottom: 1rem;
    }
    
    .navbar-modern .nav-link {
        padding: 0.75rem 1rem !important;
        margin: 0.25rem 0;
        border-radius: 8px;
        text-align: center;
    }
    
    .navbar-modern .navbar-actions {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .main-content {
        padding-top: 0.5rem;
    }
    
    .container {
        padding: 0.75rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .status-card .card-body {
        padding: 1.5rem;
    }
    
    .quick-actions {
        text-align: center;
    }
    
    .quick-actions .btn {
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 576px) {
    .navbar-modern {
        height: 60px;
        padding: 0.5rem 0;
    }
    
    body {
        padding-top: 60px;
    }
    
    /* Amélioration du bouton hamburger sur petits écrans */
    .navbar-modern .navbar-toggler {
        padding: 0.4rem;
        border-width: 1px;
    }
    
    .navbar-modern .navbar-toggler-icon {
        width: 1.2em;
        height: 1.2em;
    }
    
    /* Menu mobile plus compact */
    .navbar-modern .navbar-collapse {
        margin-top: 0.25rem;
        padding: 0.75rem;
    }
    
    .navbar-modern .nav-link {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.9rem;
    }
    
    .navbar-modern .navbar-actions .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .sensor-card:hover {
        transform: translateY(-3px) scale(1.01);
    }
    
    .settings-nav .nav-link {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Styles pour la gestion des modèles modernisés */
.model-entry {
    transition: var(--transition);
    border-radius: 10px;
    overflow: hidden;
}

.model-entry:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.model-name {
    border-radius: 10px 0 0 10px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    transition: var(--transition);
}

.model-name:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.remove-model {
    background: var(--danger-gradient);
    border: none;
    color: white;
    border-radius: 0 10px 10px 0;
    transition: var(--transition);
}

.remove-model:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 154, 158, 0.4);
}

#add-model-btn {
    background: var(--success-gradient);
    border: none;
    color: white;
    border-radius: 20px;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

#add-model-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.5);
}

/* Effets de glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-gradient);
}

/* Styles spécifiques pour la page d'alertes */

/* Cartes d'alerte avec niveaux de sévérité */
.alert-card {
    border-left: 4px solid;
    transition: var(--transition);
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.alert-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.8s;
}

.alert-card:hover::before {
    left: 100%;
}

.alert-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
}

/* Niveaux de sévérité */
.alert-severity-0 {
    background: var(--alert-low);
    border-left-color: var(--alert-low-border);
}

.alert-severity-1 {
    background: var(--alert-moderate);
    border-left-color: var(--alert-moderate-border);
}

.alert-severity-2 {
    background: var(--alert-high);
    border-left-color: var(--alert-high-border);
}

.alert-severity-3 {
    background: var(--alert-critical);
    border-left-color: var(--alert-critical-border);
}

/* Badges de sévérité */
.severity-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.severity-0 {
    background: var(--alert-low-border);
    color: white;
}

.severity-1 {
    background: var(--alert-moderate-border);
    color: white;
}

.severity-2 {
    background: var(--alert-high-border);
    color: white;
}

.severity-3 {
    background: var(--alert-critical-border);
    color: white;
    animation: pulse 2s infinite;
}

/* Actions d'alerte */
.alert-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.alert-actions .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
}

.alert-acknowledge-btn {
    background: var(--success-gradient);
    border: none;
    color: white;
    transition: var(--transition);
}

.alert-acknowledge-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

.alert-delete-btn {
    background: var(--danger-gradient);
    border: none;
    color: white;
    transition: var(--transition);
}

.alert-delete-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 154, 158, 0.4);
}

/* Analyse IA des alertes */
.ai-analysis-section {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 1rem 0;
}

.ai-analysis-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.ai-analysis-header i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.ai-analysis-content {
    line-height: 1.6;
}

.ai-analysis-content h6 {
    color: var(--primary-color);
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.ai-analysis-content ul {
    padding-left: 1.5rem;
}

.ai-analysis-content li {
    margin-bottom: 0.25rem;
}

/* Configuration des seuils */
.threshold-item {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: var(--transition);
}

.threshold-item:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.threshold-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.threshold-title {
    font-weight: 600;
    color: var(--dark-color);
}

.threshold-status {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
}

.threshold-enabled {
    background: var(--success-color);
    color: white;
}

.threshold-disabled {
    background: #6c757d;
    color: white;
}

.threshold-details {
    font-size: 0.9rem;
    color: #6c757d;
}

.threshold-actions {
    margin-top: 0.5rem;
}

.threshold-actions .btn {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    margin-right: 0.25rem;
}

/* Historique des alertes */
.history-item {
    border-left: 3px solid #dee2e6;
    padding: 1rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 0 10px 10px 0;
    transition: var(--transition);
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateX(5px);
}

.history-item.resolved {
    border-left-color: var(--success-color);
    background: rgba(79, 172, 254, 0.05);
}

.history-item.acknowledged {
    border-left-color: var(--warning-color);
    background: rgba(255, 152, 0, 0.05);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.history-title {
    font-weight: 600;
    color: var(--dark-color);
}

.history-timestamp {
    font-size: 0.8rem;
    color: #6c757d;
}

.history-message {
    font-size: 0.9rem;
    color: #495057;
    margin-bottom: 0.5rem;
}

.history-status {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    text-transform: uppercase;
    font-weight: 600;
}

/* Indicateurs de statut */
.status-indicator {
    display: inline-flex;
    align-items: center;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-weight: 500;
}

.status-active {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.status-resolved {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.status-acknowledged {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

/* Animations spécifiques aux alertes */
@keyframes alertPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

.critical-alert {
    animation: alertPulse 2s infinite;
}

/* Responsive pour les alertes */
@media (max-width: 768px) {
    .alert-actions {
        justify-content: center;
    }
    
    .threshold-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .ai-analysis-section {
        padding: 1rem;
    }
}

/* États vides améliorés */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h4 {
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.empty-state p {
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* Boutons d'action rapide */
.quick-action-btn {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: 1px solid rgba(102, 126, 234, 0.2);
    color: var(--primary-color);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: var(--transition);
}

.quick-action-btn:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Compteurs d'alertes */
.alert-counter {
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.alert-counter.critical {
    background: var(--danger-gradient);
    animation: pulse 2s infinite;
}

/* Transitions fluides pour les onglets */
.tab-content .tab-pane {
    transition: opacity 0.3s ease-in-out;
}

.tab-content .tab-pane:not(.show) {
    opacity: 0;
}

.tab-content .tab-pane.show {
    opacity: 1;
}

/* Styles pour les nouvelles alertes */
.alert-card.new-alert {
    border-left: 4px solid #dc3545;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
    animation: slideUp 0.5s ease-out, pulse 2s ease-in-out;
}

/* Styles pour les badges d'alertes */
.badge.alert-badge {
    transition: all 0.3s ease;
}

.badge.alert-badge:hover {
    transform: scale(1.1);
}

/* Styles pour l'analyse IA */
#ai-analysis-container {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#ai-analysis-container.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.analysis-text {
    line-height: 1.6;
    font-size: 0.95rem;
}

.analysis-text strong {
    color: #495057;
    font-weight: 600;
}

/* Styles pour les notifications */
.alert.position-fixed {
    animation: slideUp 0.3s ease-out;
    transition: all 0.3s ease;
}

.alert.position-fixed:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* Amélioration des cartes d'alertes */
.card.alert-card {
    transition: all 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
}

.card.alert-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Styles pour les badges de sévérité */
.badge.severity-critical {
    background: linear-gradient(45deg, #dc3545, #c82333);
    animation: pulse 2s ease-in-out infinite;
}

.badge.severity-high {
    background: linear-gradient(45deg, #fd7e14, #e55a00);
}

.badge.severity-medium {
    background: linear-gradient(45deg, #ffc107, #e0a800);
}

.badge.severity-low {
    background: linear-gradient(45deg, #28a745, #1e7e34);
}

/* Responsive design pour les animations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Styles pour les icônes d'alertes */
.alert-icon {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.alert-icon.critical {
    color: #dc3545;
    animation: pulse 1.5s ease-in-out infinite;
}

.alert-icon.high {
    color: #fd7e14;
}

.alert-icon.medium {
    color: #ffc107;
}

.alert-icon.low {
    color: #28a745;
}

/* Styles pour les accordéons de configuration */
.accordion-item {
    border: none !important;
    margin-bottom: 1rem;
    border-radius: var(--border-radius) !important;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: var(--transition);
}

.accordion-item:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.accordion-button {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%) !important;
    border: none !important;
    padding: 1.25rem 1.5rem !important;
    font-weight: 600 !important;
    color: var(--dark-color) !important;
    border-radius: var(--border-radius) !important;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%) !important;
    color: var(--primary-color) !important;
    box-shadow: none !important;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25) !important;
    border-color: transparent !important;
}

.accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23667eea'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e") !important;
    transition: transform 0.3s ease !important;
}

.accordion-button:not(.collapsed)::after {
    transform: rotate(180deg) !important;
}

.accordion-body {
    padding: 1.5rem !important;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* Styles pour les indicateurs de statut dans les accordéons */
.accordion-button .badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    border-radius: 50px;
    font-weight: 500;
    transition: var(--transition);
}

/* Amélioration des sections de configuration TTS */
#piper-config, #elevenlabs-config {
    border: 2px solid transparent !important;
    transition: var(--transition);
}

#piper-config:hover, #elevenlabs-config:hover {
    border-color: rgba(102, 126, 234, 0.3) !important;
    transform: translateY(-1px);
}

/* Styles pour les champs obligatoires */
.form-label .text-danger {
    font-size: 1.1em;
    font-weight: bold;
}

/* Amélioration des boutons de test */
.btn-outline-primary, .btn-outline-info, .btn-outline-success {
    border-width: 2px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-outline-primary:hover, .btn-outline-info:hover, .btn-outline-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Styles pour les badges de statut */
.badge.bg-success {
    background: var(--success-gradient) !important;
}

.badge.bg-danger {
    background: var(--danger-gradient) !important;
}

.badge.bg-warning {
    background: var(--warning-gradient) !important;
    color: var(--dark-color) !important;
}

.badge.bg-info {
    background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%) !important;
}

/* Animation pour les changements de statut */
.badge {
    transition: all 0.3s ease;
}

.badge.status-change {
    animation: pulse 0.6s ease-in-out;
}

/* Responsive pour les accordéons */
@media (max-width: 768px) {
    .accordion-button {
        padding: 1rem !important;
        font-size: 0.9rem !important;
    }
    
    .accordion-body {
        padding: 1rem !important;
    }
    
    .accordion-button .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Correction pour la page de login */
.login-page body, body.login-page {
    padding-top: 0 !important;
} 