/**
 * First Aid Simulator - Custom Styles
 * DA Design System - Green Theme
 */

/* Smooth transitions for all interactive elements */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Body background gradient */
body {
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 35%, #f0fdf4 70%, #dcfce7 100%);
    min-height: 100vh;
}

/* Vitality bar pulse animation when critical */
@keyframes vitality-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.vitality-critical {
    animation: vitality-pulse 0.8s ease-in-out infinite;
}

/* Choice button hover effect */
.choice-btn {
    transition: all 0.2s ease;
}

.choice-btn:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.15);
}

.choice-btn:active:not(:disabled) {
    transform: scale(0.99);
}

/* Feedback modal entrance */
@keyframes modal-enter {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#feedback-modal > div {
    animation: modal-enter 0.25s ease-out;
}

/* Grade circle animation */
@keyframes grade-pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    60% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

#grade-circle {
    animation: grade-pop 0.4s ease-out;
}

/* Progress bar gradient animation */
#progress-bar {
    background: linear-gradient(90deg, #22c55e 0%, #059669 100%);
}

/* Vitality bar smooth transitions */
#vitality-bar {
    transition: width 0.4s ease-out, background-color 0.3s ease;
}

/* Start button subtle pulse */
@keyframes start-pulse {
    0%, 100% {
        box-shadow: 0 4px 6px -1px rgba(5, 150, 105, 0.3), 0 2px 4px -1px rgba(5, 150, 105, 0.2);
    }
    50% {
        box-shadow: 0 8px 15px -3px rgba(5, 150, 105, 0.4), 0 4px 6px -2px rgba(5, 150, 105, 0.3);
    }
}

#start-btn {
    animation: start-pulse 2.5s ease-in-out infinite;
}

#start-btn:hover {
    animation: none;
    box-shadow: 0 10px 20px -5px rgba(5, 150, 105, 0.4);
}

/* Media placeholder styling */
#media-placeholder {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

/* Custom scrollbar for choices review */
#choices-review {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #f3f4f6;
}

#choices-review::-webkit-scrollbar {
    width: 6px;
}

#choices-review::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

#choices-review::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

#choices-review::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Header shadow */
header {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Card shadows */
.shadow-lg {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
}

/* Touch-friendly button sizing */
@media (max-width: 640px) {
    .choice-btn {
        min-height: 64px;
        font-size: 0.95rem;
    }

    #feedback-continue-btn,
    #start-btn,
    #restart-btn {
        min-height: 52px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for accessibility */
button:focus-visible,
.choice-btn:focus-visible {
    outline: 2px solid #059669;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .choice-btn {
        border-width: 3px;
    }

    #vitality-bar,
    #progress-bar {
        border: 1px solid #064e3b;
    }
}

/* Timer urgent state */
.timer-urgent {
    color: #dc2626;
}

/* Animate pulse for timer */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse {
    animation: pulse 1s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Print styles */
@media print {
    #start-screen,
    #game-screen,
    button {
        display: none !important;
    }

    #summary-screen {
        display: block !important;
    }

    body {
        background: white;
    }
}
