/* =====================================================
   STYLE 2 DARK: Clean Dark - Cartes sombres avec animations
   ===================================================== */

/* ==================== KEYFRAMES ==================== */

/* Typing animation - points qui clignotent */
@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-4px); }
}

/* Pulse glow - lueur qui pulse */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(52, 211, 153, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 15px rgba(52, 211, 153, 0.8), 0 0 30px rgba(52, 211, 153, 0.4);
        transform: scale(1.05);
    }
}

/* Notification pulse */
@keyframes notification-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Scan line - ligne de scan horizontale */
@keyframes scan-line {
    0% { top: 0; opacity: 1; }
    100% { top: 100%; opacity: 0.5; }
}

/* OCR scan - ligne de scan verticale */
@keyframes ocr-scan {
    0% { top: 0; }
    50% { top: calc(100% - 2px); }
    100% { top: 0; }
}

/* Waveform - barres audio animées */
@keyframes waveform {
    0%, 100% { height: 20%; }
    25% { height: 80%; }
    50% { height: 40%; }
    75% { height: 100%; }
}

/* VU meter animation */
@keyframes vu-meter {
    0%, 100% { height: 30%; background: rgba(167, 139, 250, 0.5); }
    25% { height: 70%; background: rgba(167, 139, 250, 0.7); }
    50% { height: 100%; background: rgba(139, 92, 246, 0.9); }
    75% { height: 50%; background: rgba(167, 139, 250, 0.6); }
}

/* Slide in - apparition séquentielle */
@keyframes slide-in {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Fill line - ligne qui se remplit */
@keyframes fill-line {
    0% { width: 0; }
    100% { width: var(--line-width, 100%); }
}

/* Car move - voiture qui avance */
@keyframes car-move {
    0% { transform: translateX(-20px); }
    50% { transform: translateX(20px); }
    100% { transform: translateX(-20px); }
}

/* Road lines - lignes de route */
@keyframes road-lines {
    0% { transform: translateX(0); }
    100% { transform: translateX(-30px); }
}

/* Status blink - status qui clignote */
@keyframes status-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Reveal text - texte qui apparaît lettre par lettre */
@keyframes reveal-char {
    0% { opacity: 0; transform: translateY(-5px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Scan frame pulse */
@keyframes scan-frame-pulse {
    0%, 100% { border-color: rgba(139, 92, 246, 0.3); }
    50% { border-color: rgba(139, 92, 246, 0.8); }
}

/* Pulse ring - onde qui se propage */
@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Team wave */
@keyframes team-wave {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* KM counter */
@keyframes km-count {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* ==================== BASE CARD STYLES ==================== */

.card-clean-dark {
    display: block;
    border-radius: 1rem;
    background: linear-gradient(145deg, #1a1a2e 0%, #16162a 100%);
    border: 1px solid rgba(139, 92, 246, 0.15);
    overflow: hidden;
    transition: all 0.3s ease;
    text-decoration: none;
}

.card-clean-dark:hover {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.15);
    transform: translateY(-4px);
}

.card-clean-dark-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-clean-dark-scene {
    padding: 1.5rem;
    height: 10rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

/* Ensure child elements take full width where needed */
.card-clean-dark-scene > * {
    width: 100%;
}

.card-clean-dark-content {
    padding: 1rem 1.25rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-clean-dark-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.375rem;
}

.card-clean-dark-desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
    flex: 1;
}

.card-clean-dark-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #a78bfa;
    margin-top: 0.75rem;
    transition: gap 0.2s ease;
}

.card-clean-dark:hover .card-clean-dark-link {
    gap: 0.625rem;
}

/* ==================== CONTACTS - Chat avec typing ==================== */

.clean-dark-chat {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.clean-dark-chat-bubble {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.clean-dark-chat-bubble.right {
    flex-direction: row-reverse;
    margin-left: 1rem;
}

.clean-dark-chat-bubble.left {
    margin-right: 1rem;
}

.clean-dark-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    position: relative;
}

.clean-dark-avatar.small {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.6rem;
}

.clean-dark-message {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 0.125rem;
}

.clean-dark-message-line {
    height: 0.375rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 0.25rem;
}

.clean-dark-message-line.short {
    width: 60%;
}

/* Typing animation */
.clean-dark-typing {
    display: flex;
    gap: 4px;
    align-items: center;
    height: 1rem;
}

.clean-dark-typing span {
    width: 6px;
    height: 6px;
    background: rgba(167, 139, 250, 0.7);
    border-radius: 50%;
    animation: typing 1.4s ease-in-out infinite;
}

.clean-dark-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.clean-dark-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Notification badge */
.clean-dark-notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: #ef4444;
    border-radius: 50%;
    font-size: 0.55rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: notification-pulse 2s ease-in-out infinite;
}

/* ==================== ARTICLES - Grille produits avec scan ==================== */

.clean-dark-products-grid {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    position: relative;
}

.clean-dark-product-card {
    width: 3.5rem;
    height: 3.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    position: relative;
    transition: all 0.3s ease;
    opacity: 0;
    animation: slide-in 0.5s ease forwards;
    animation-delay: calc(var(--delay) * 0.15s);
}

.card-clean-dark:hover .clean-dark-product-card {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.08);
}

.clean-dark-product-price {
    position: absolute;
    bottom: -8px;
    right: -8px;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.card-clean-dark:hover .clean-dark-product-price {
    opacity: 1;
    transform: scale(1);
}

.clean-dark-scan-line {
    position: absolute;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.8), transparent);
    opacity: 0;
    animation: scan-line 2s ease-in-out infinite;
}

.card-clean-dark:hover .clean-dark-scan-line {
    opacity: 1;
}

/* ==================== VENTES - Facture animée ==================== */

.clean-dark-invoice {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
}

.clean-dark-invoice-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.clean-dark-doc-icon {
    color: #a78bfa;
    font-size: 0.875rem;
}

.clean-dark-doc-ref {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    flex: 1;
}

.clean-dark-badge-paid {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    animation: pulse-glow 2s ease-in-out infinite;
}

.clean-dark-invoice-lines {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
}

.clean-dark-invoice-line {
    height: 0.375rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.clean-dark-invoice-line::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: rgba(167, 139, 250, 0.4);
    width: 0;
    transition: width 0.5s ease;
}

.card-clean-dark:hover .clean-dark-invoice-line::after {
    width: 100%;
    transition-delay: calc(var(--delay) * 0.2s);
}

.clean-dark-invoice-line.short {
    width: 70%;
}

.clean-dark-invoice-total {
    text-align: right;
}

.clean-dark-amount-counter {
    font-size: 1.125rem;
    font-weight: 700;
    color: #34d399;
}

/* ==================== NOTES DE FRAIS - OCR et audio ==================== */

.clean-dark-expense {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.clean-dark-file-scan {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.clean-dark-ocr-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(52, 211, 153, 0.8), transparent);
    top: 0;
    opacity: 0;
}

.card-clean-dark:hover .clean-dark-ocr-line {
    opacity: 1;
    animation: ocr-scan 2s ease-in-out infinite;
}

.clean-dark-audio-player {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
}

.clean-dark-play-btn {
    font-size: 0.75rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.card-clean-dark:hover .clean-dark-play-btn {
    transform: scale(1.2);
}

.clean-dark-waveform-animated {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 1.25rem;
    flex: 1;
}

.clean-dark-waveform-animated span {
    width: 3px;
    background: rgba(167, 139, 250, 0.5);
    border-radius: 2px;
    height: 40%;
    transition: height 0.1s ease;
}

.card-clean-dark:hover .clean-dark-waveform-animated span {
    animation: waveform 0.8s ease-in-out infinite;
}

.card-clean-dark:hover .clean-dark-waveform-animated span:nth-child(1) { animation-delay: 0s; }
.card-clean-dark:hover .clean-dark-waveform-animated span:nth-child(2) { animation-delay: 0.1s; }
.card-clean-dark:hover .clean-dark-waveform-animated span:nth-child(3) { animation-delay: 0.2s; }
.card-clean-dark:hover .clean-dark-waveform-animated span:nth-child(4) { animation-delay: 0.3s; }
.card-clean-dark:hover .clean-dark-waveform-animated span:nth-child(5) { animation-delay: 0.4s; }
.card-clean-dark:hover .clean-dark-waveform-animated span:nth-child(6) { animation-delay: 0.5s; }
.card-clean-dark:hover .clean-dark-waveform-animated span:nth-child(7) { animation-delay: 0.6s; }
.card-clean-dark:hover .clean-dark-waveform-animated span:nth-child(8) { animation-delay: 0.7s; }

.clean-dark-duration {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.4);
}

/* ==================== FLOTTE - Voiture et compteur ==================== */

.clean-dark-fleet {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.clean-dark-road {
    position: relative;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.5rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 0 1rem;
}

.clean-dark-car {
    font-size: 1.5rem;
    z-index: 2;
    transition: transform 0.3s ease;
}

.card-clean-dark:hover .clean-dark-car {
    animation: car-move 2s ease-in-out infinite;
}

.clean-dark-road-lines {
    position: absolute;
    bottom: 50%;
    left: 0;
    right: 0;
    display: flex;
    gap: 15px;
    transform: translateY(50%);
    padding-left: 60px;
}

.clean-dark-road-lines span {
    width: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 1px;
}

.card-clean-dark:hover .clean-dark-road-lines {
    animation: road-lines 0.5s linear infinite;
}

.clean-dark-fleet-stats {
    display: flex;
    gap: 0.5rem;
}

.clean-dark-km-counter,
.clean-dark-vehicles-count {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.8);
}

.clean-dark-km-value {
    font-weight: 700;
    font-family: monospace;
}

.card-clean-dark:hover .clean-dark-km-value {
    animation: km-count 0.5s ease-in-out infinite;
}

.clean-dark-km-unit {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.55rem;
}

/* ==================== RH - Team avec status ==================== */

.clean-dark-team {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.clean-dark-team-member {
    position: relative;
    transition: transform 0.3s ease;
}

.card-clean-dark:hover .clean-dark-team-member {
    animation: team-wave 0.6s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.1s);
}

.clean-dark-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #1a1a2e;
}

.clean-dark-status-dot.online {
    background: #22c55e;
    animation: status-blink 2s ease-in-out infinite;
}

.clean-dark-status-dot.away {
    background: #f59e0b;
    animation: status-blink 1.5s ease-in-out infinite;
}

.clean-dark-status-dot.offline {
    background: #6b7280;
}

/* ==================== PARKING - ANPR Detection ==================== */

.clean-dark-anpr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.clean-dark-camera-frame {
    position: relative;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.clean-dark-scan-frame {
    position: absolute;
    inset: -4px;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 4px;
}

.card-clean-dark:hover .clean-dark-scan-frame {
    animation: scan-frame-pulse 1s ease-in-out infinite;
}

.clean-dark-scan-frame .corner {
    position: absolute;
    width: 8px;
    height: 8px;
    border-color: #a78bfa;
    border-style: solid;
}

.clean-dark-scan-frame .corner.tl {
    top: -2px;
    left: -2px;
    border-width: 2px 0 0 2px;
}

.clean-dark-scan-frame .corner.tr {
    top: -2px;
    right: -2px;
    border-width: 2px 2px 0 0;
}

.clean-dark-scan-frame .corner.bl {
    bottom: -2px;
    left: -2px;
    border-width: 0 0 2px 2px;
}

.clean-dark-scan-frame .corner.br {
    bottom: -2px;
    right: -2px;
    border-width: 0 2px 2px 0;
}

.clean-dark-plate-reveal {
    display: flex;
    gap: 2px;
    padding: 0.375rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.clean-dark-plate-char {
    font-family: monospace;
    font-size: 0.875rem;
    font-weight: 700;
    color: white;
    opacity: 0;
}

.card-clean-dark:hover .clean-dark-plate-char {
    animation: reveal-char 0.3s ease forwards;
    animation-delay: calc(var(--i) * 0.08s);
}

/* ==================== WAZO - VoIP avec VU meter ==================== */

.clean-dark-voip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.clean-dark-phone-pulse {
    position: relative;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clean-dark-phone-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a78bfa;
    font-size: 1rem;
    z-index: 2;
}

.clean-dark-pulse-ring {
    position: absolute;
    inset: 0;
    border: 2px solid rgba(139, 92, 246, 0.4);
    border-radius: 50%;
    opacity: 0;
}

.card-clean-dark:hover .clean-dark-pulse-ring {
    animation: pulse-ring 1.5s ease-out infinite;
}

.clean-dark-pulse-ring.delay {
    animation-delay: 0.5s;
}

.card-clean-dark:hover .clean-dark-pulse-ring.delay {
    animation-delay: 0.75s;
}

.clean-dark-vu-meter {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 1.5rem;
    padding: 0 0.5rem;
}

.clean-dark-vu-meter span {
    width: 4px;
    background: rgba(167, 139, 250, 0.4);
    border-radius: 2px;
    height: 30%;
    transition: all 0.1s ease;
}

.card-clean-dark:hover .clean-dark-vu-meter span {
    animation: vu-meter 0.6s ease-in-out infinite;
}

.card-clean-dark:hover .clean-dark-vu-meter span:nth-child(1) { animation-delay: 0s; }
.card-clean-dark:hover .clean-dark-vu-meter span:nth-child(2) { animation-delay: 0.08s; }
.card-clean-dark:hover .clean-dark-vu-meter span:nth-child(3) { animation-delay: 0.16s; }
.card-clean-dark:hover .clean-dark-vu-meter span:nth-child(4) { animation-delay: 0.24s; }
.card-clean-dark:hover .clean-dark-vu-meter span:nth-child(5) { animation-delay: 0.32s; }
.card-clean-dark:hover .clean-dark-vu-meter span:nth-child(6) { animation-delay: 0.4s; }
.card-clean-dark:hover .clean-dark-vu-meter span:nth-child(7) { animation-delay: 0.48s; }
.card-clean-dark:hover .clean-dark-vu-meter span:nth-child(8) { animation-delay: 0.56s; }

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
    .card-clean-dark-scene {
        height: 8rem;
        padding: 1rem;
    }

    .clean-dark-avatar {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.55rem;
    }

    .clean-dark-avatar.small {
        width: 2rem;
        height: 2rem;
    }

    .clean-dark-product-card {
        width: 3rem;
        height: 3rem;
        font-size: 1rem;
    }

    .clean-dark-fleet-stats {
        flex-direction: column;
    }
}

/* ==================== REDUCED MOTION ==================== */

@media (prefers-reduced-motion: reduce) {
    .card-clean-dark,
    .clean-dark-typing span,
    .clean-dark-badge-paid,
    .clean-dark-notification-badge,
    .clean-dark-scan-line,
    .clean-dark-ocr-line,
    .clean-dark-waveform-animated span,
    .clean-dark-car,
    .clean-dark-road-lines,
    .clean-dark-km-value,
    .clean-dark-team-member,
    .clean-dark-status-dot,
    .clean-dark-scan-frame,
    .clean-dark-plate-char,
    .clean-dark-pulse-ring,
    .clean-dark-vu-meter span {
        animation: none !important;
        transition: none !important;
    }

    .clean-dark-plate-char {
        opacity: 1 !important;
    }
}
