:root {
    --primary: #0F172A;
    --danger: #B91C1C;
    --warning: #F59E0B;
    --success: #11B981;
    --bg-glass: rgba(255, 255, 255, 0.9);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: radial-gradient(circle at 50% 0%, #FDFDFD 0%, #F1F5F9 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: 'Outfit', sans-serif;
}

.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
}

/* Search Box Focus */
#searchInput:focus {
    background: white;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.08), 0 10px 25px rgba(0, 0, 0, 0.05);
}

/* Improved focus states for accessibility */
button:focus-visible,
a:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.6);
    outline-offset: 2px;
}

/* Smooth transitions for interactive elements */
button,
a {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile optimizations */
@media (max-width: 640px) {
    #searchInput {
        font-size: 1.125rem;
        /* 18px */
    }

    .glass-card {
        border-radius: 1rem;
        /* Slightly smaller on mobile */
    }
}

/* Bottle Visualization */
.bottle-container {
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.status-idle {
    max-width: 120px;
    height: 120px;
    opacity: 0.5;
}

.bottle-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.05));
    transition: all 0.7s ease;
}

.milk-fill {
    transition: fill 0.8s ease, opacity 0.6s ease;
}

.bottle-outline,
.bottle-ring,
.bottle-nipple {
    transition: stroke 0.8s ease, stroke-width 0.6s ease;
}

/* ========== STATUS: IDLE ========== */
.status-idle .milk-fill {
    fill: #E2E8F0;
    opacity: 0.2;
}

.status-idle .bottle-outline,
.status-idle .bottle-ring,
.status-idle .bottle-nipple {
    stroke: #CBD5E1;
    stroke-width: 3;
}

/* ========== STATUS: SAFE (Rich Creamy Yellow) ========== */
.status-safe .milk-fill {
    fill: #FFE082;
    /* Deeper creamy yellow */
    opacity: 1;
}

.status-safe {
    animation: breathe 4s ease-in-out infinite;
}

/* ========== STATUS: WARNING (Warm Orange) ========== */
.status-warning .milk-fill {
    fill: #FFB74D;
    /* Deeper warm orange */
    opacity: 1;
}

.status-warning {
    animation: float 3s ease-in-out infinite;
}

/* ========== STATUS: DANGER (Cautionary Deep Red) ========== */
.status-danger .milk-fill {
    fill: #EF9A9A;
    /* Deeper cautionary red */
    opacity: 1;
}

.status-danger {
    animation: danger-pulse 1s infinite alternate;
}

/* Animations */
@keyframes breathe {

    0%,
    100% {
        transform: scale(1) translateY(0);
    }

    50% {
        transform: scale(1.02) translateY(-4px);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0);
    }

    25% {
        transform: translateY(-8px) rotate(1deg);
    }

    75% {
        transform: translateY(-4px) rotate(-1deg);
    }
}

@keyframes danger-pulse {
    from {
        transform: scale(1);
        filter: brightness(1) drop-shadow(0 0 15px rgba(185, 28, 28, 0.3));
    }

    to {
        transform: scale(1.05);
        filter: brightness(1.2) drop-shadow(0 0 30px rgba(185, 28, 28, 0.6));
    }
}

@keyframes heartbeat-alarm {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }

    10% {
        transform: scale(1.08);
        filter: brightness(1.4);
    }

    20% {
        transform: scale(1.03);
        filter: brightness(1.2);
    }

    35% {
        transform: scale(1.15);
        filter: brightness(1.8);
    }

    50% {
        transform: scale(1);
        filter: brightness(1);
    }

    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

@keyframes alarm-pulse-red {

    0%,
    100% {
        background-color: rgba(239, 68, 68, 0);
    }

    15% {
        background-color: rgba(239, 68, 68, 0.2);
    }

    35% {
        background-color: rgba(239, 68, 68, 0.35);
    }

    55% {
        background-color: rgba(239, 68, 68, 0);
    }
}

@keyframes alarm-orange {

    0%,
    100% {
        background-color: rgba(245, 158, 11, 0);
    }

    50% {
        background-color: rgba(245, 158, 11, 0.15);
    }
}

@keyframes border-flash-red {

    0%,
    100% {
        border-color: #B91C1C;
    }

    50% {
        border-color: #EF4444;
    }
}

@keyframes shake-alarm {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translate(-3px, 1px) rotate(-1deg);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translate(3px, -1px) rotate(1deg);
    }
}

.alarm-critical {
    animation: alarm-pulse-red 1.5s ease-out infinite,
        heartbeat-alarm 1.5s ease-out infinite,
        border-flash-red 0.4s ease-in-out infinite,
        shake-alarm 0.2s linear infinite;
    box-shadow: 0 0 70px rgba(239, 68, 68, 0.5);
    z-index: 50;
    position: relative;
}

@keyframes scan-line {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(200%);
    }
}

@keyframes burst-impact {
    0% {
        transform: scale(0.5) translateY(50px);
        opacity: 0;
        filter: brightness(2);
    }

    60% {
        transform: scale(1.1) translateY(-10px);
        opacity: 1;
        filter: brightness(1.5);
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
        filter: brightness(1);
    }
}

@keyframes flash-burst {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    20% {
        opacity: 0.8;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.alarm-burst {
    animation: burst-impact 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.flash-overlay {
    position: absolute;
    inset: 0;
    background: white;
    border-radius: inherit;
    pointer-events: none;
    z-index: 60;
    animation: flash-burst 0.6s ease-out forwards;
}

.slide-up {
    animation: slide-up 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.tech-dad-gradient {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #F1F5F9;
}

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

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

/* Version Update Scrolling Banner */
.version-scroll-container {
    width: 100%;
    overflow: hidden;
}

.version-scroll-content {
    display: inline-flex;
    white-space: nowrap;
    animation: scroll-left 30s linear infinite;
}

.version-scroll-content:hover {
    animation-play-state: paused;
}

@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Stats Section: full container width, clear separation */
.stats-section {
    width: 100%;
    padding: 1.5rem 0 2rem;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 1.5rem;
    margin-bottom: 1.25rem;
}

.stat-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 1rem;
    padding: 1.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
    border-color: rgba(59, 130, 246, 0.3);
}

.stat-icon {
    font-size: 2rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0F172A;
    font-family: 'Outfit', sans-serif;
    line-height: 1;
}

.helpful-btn {
    width: 100%;
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: white;
    border: none;
    border-radius: 1rem;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    position: relative;
    overflow: hidden;
}

.helpful-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.helpful-btn:hover::before {
    left: 100%;
}

.helpful-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.helpful-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.helpful-btn.clicked {
    animation: button-success 0.6s ease;
}

@keyframes button-success {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
        background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    }

    100% {
        transform: scale(1);
    }
}

.helpful-btn:disabled {
    background: linear-gradient(135deg, #94A3B8 0%, #64748B 100%);
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.btn-text {
    font-family: 'Inter', sans-serif;
}

.stats-note {
    text-align: center;
    font-size: 0.75rem;
    color: #94A3B8;
    margin-top: 1rem;
    font-style: italic;
}

/* Accessibility: Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

    .bottle-container,
    .status-safe,
    .status-warning,
    .status-danger,
    .slide-up,
    .version-scroll-content,
    .helpful-btn.clicked {
        animation: none !important;
        transition: none !important;
    }

    .milk-fill,
    .bottle-outline,
    .bottle-ring,
    .bottle-nipple {
        transition: none !important;
    }
}

/* Screen reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Responsive */
@media (max-width: 640px) {
    .stats-container {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stat-item {
        padding: 1.25rem 1rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .helpful-btn {
        padding: 0.875rem 1.25rem;
        font-size: 0.9375rem;
        min-height: 48px;
    }
}