/* Loader styles */
.loader {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

#checkLoader {
    overflow: hidden;
}

body.loader-active {
    position: relative;
    overflow: hidden;
    height: 100vh;
    box-sizing: border-box;
}

.car {
    filter: drop-shadow(0 10px 20px rgba(59, 130, 246, 0.3));
    display: block;
    margin: 0 auto;
}

.car__body {
    animation: shake 0.2s ease-in-out infinite alternate;
}

.car__line {
    transform-origin: center right;
    stroke-dasharray: 22;
    animation: line 0.8s ease-in-out infinite;
    animation-fill-mode: both;
}

.car__line--top {
    animation-delay: 0s;
}

.car__line--middle {
    animation-delay: 0.2s;
}

.car__line--bottom {
    animation-delay: 0.4s;
}

.loading-text {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    animation: text-pulse 2s ease-in-out infinite;
}

/* Animations */
@keyframes shake {
    0% {
        transform: translateY(-1%);
    }
    100% {
        transform: translateY(3%);
    }
}

@keyframes line {
    0% {
        stroke-dashoffset: 22;
    }
    
    25% {
        stroke-dashoffset: 22;
    }
    
    50% {
        stroke-dashoffset: 0;
    }
    
    51% {
        stroke-dashoffset: 0;
    }
    
    80% {
        stroke-dashoffset: -22;
    }
    
    100% {
        stroke-dashoffset: -22;
    }
}

@keyframes text-pulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* Responsive table */
@media (max-width: 768px) {
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
    }
    
    table th,
    table td {
        min-width: 120px;
        white-space: nowrap;
    }
    
    .loading-text {
        font-size: 1.1rem;
        padding: 0 1rem;
        text-align: center; 
        width: 100%;
    }
    
    .car {
        width: fit-content;
        height: 32px;
        margin: 0 auto;
    }
    
    .loader > div {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
}

/* Animation pour les cartes de statut */
.pulse-dot {
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { 
        transform: scale(1); 
        opacity: 1; 
    }
    50% { 
        transform: scale(1.1); 
        opacity: 0.8; 
    }
}

/* Hover effects pour le tableau */
#testsTable tbody tr {
    transition: background-color 0.2s ease;
}

#testsTable tbody tr:hover {
    background-color: rgba(249, 250, 251, 1);
}

/* Amélioration de l'accessibilité */
button:focus,
input:focus,
select:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Animation pour les boutons */
button {
    transition: all 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

/* Style pour les badges de statut */
.rounded-full {
    transition: all 0.2s ease;
}

.rounded-full:hover {
    transform: scale(1.05);
}

/* Hero section gradient */
.bg-gradient-to-br {
    background: linear-gradient(to bottom right, var(--tw-gradient-stops));
}

/* Card shadows améliorés */
.shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.shadow-2xl {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Input focus effects */
input:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Password toggle button */
#togglePassword {
    transition: color 0.2s ease;
}

#togglePassword:hover {
    color: #3b82f6;
}

/* Modal backdrop animation */
.backdrop-blur-sm {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Table header sticky */
@media (min-width: 768px) {
    #testsTable thead {
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    }
}

/* Gradient button hover effect */
.bg-gradient-to-r:hover {
    background-size: 150% 150%;
    transition: background-size 0.3s ease;
}

/* Circuit breaker button special styling */
.OpenCircuitBreakerModal {
    position: relative;
    overflow: hidden;
}

.OpenCircuitBreakerModal::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 0.6s, height 0.6s;
}

.OpenCircuitBreakerModal:hover::before {
    width: 300px;
    height: 300px;
}

/* Warning box pulse */
.bg-yellow-50 {
    animation: warning-pulse 3s ease-in-out infinite;
}

@keyframes warning-pulse {
    0%, 100% {
        background-color: rgb(254, 252, 232);
    }
    50% {
        background-color: rgb(254, 249, 195);
    }
}

/* Footer link hover */
footer a {
    position: relative;
}

footer a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: #3b82f6;
    transition: width 0.3s ease;
}

footer a:hover::after {
    width: 100%;
}

/* Skeleton loading animation (si besoin) */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Modal animation */
#detailsModal.hidden,
#circuitBreakerModal.hidden {
    animation: fadeOut 0.3s ease-out;
}

#detailsModal:not(.hidden),
#circuitBreakerModal:not(.hidden) {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Success/Error message animation */
.success-message,
.error-message {
    animation: slideInDown 0.5s ease-out;
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
