:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --background-color: #f4f6f7;
    --card-background: #ffffff;
    --text-color: #333;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

header {
    margin-bottom: 40px;
}

header h1 {
    color: var(--secondary-color);
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2em;
    color: var(--primary-color);
    font-weight: bold;
}

section {
    background: var(--card-background);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

h2 {
    color: var(--secondary-color);
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 1.5em;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

/* Countdown Grid */
.countdown-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.time-unit {
    background: var(--primary-color);
    color: white;
    padding: 15px;
    border-radius: 10px;
    min-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-unit span {
    font-size: 2em;
    font-weight: bold;
}

.time-unit label {
    font-size: 0.8em;
    text-transform: uppercase;
    margin-top: 5px;
}

/* Funny Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #eee;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card i {
    font-size: 2em;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.stat-card span {
    display: block;
    font-size: 1.8em;
    font-weight: bold;
    color: var(--secondary-color);
    margin: 10px 0;
}

.stat-card label {
    font-size: 0.9em;
    color: #666;
}

/* Progress Bar */
.progress-text {
    font-size: 0.8em;
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    vertical-align: middle;
    margin-left: 10px;
}

.progress-container {
    position: relative;
    padding: 60px 40px 20px 40px; /* Added side padding to prevent overflow */
    margin: 20px 0;
    height: 60px; /* Fixed height to ensure alignment context */
    box-sizing: border-box; 
}

.progress-track {
    position: absolute;
    top: 50%; /* Center vertically in container */
    left: 40px; /* Match container padding */
    right: 40px; /* Match container padding */
    width: auto; /* Allow left/right to define width */
    height: 6px; /* Slightly thicker */
    background: #e0e0e0;
    z-index: 1;
    transform: translateY(-50%);
    border-radius: 3px;
}

.progress-fill {
    position: absolute;
    top: 50%;
    left: 40px; /* Match container padding */
    height: 6px; /* Match track */
    background: var(--primary-color);
    z-index: 2;
    transform: translateY(-50%);
    transition: width 0.5s ease;
    border-radius: 3px;
}

.step {
    position: absolute;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateX(-50%);
    top: 50%; /* Center the step container vertically on the line */
}

/* Custom Positions for Steps */
/* Uses calc to position steps relative to the inner track (100% - 80px) */
.step[data-step="1"] { left: 40px; }
.step[data-step="2"] { left: calc(40px + 0.7 * (100% - 80px)); }
.step[data-step="3"] { left: calc(40px + 0.85 * (100% - 80px)); }
.step[data-step="4"] { left: calc(40px + 1 * (100% - 80px)); }

.step-circle {
    width: 40px;
    height: 40px;
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e0e0e0;
    transition: all 0.3s;
    /* Center the circle on the parent's "top: 50%" */
    transform: translateY(-50%); 
    margin-bottom: 0; 
    position: relative; 
    z-index: 4;
}

.step-label {
    position: absolute;
    top: 25px; /* Push label below the circle */
    font-size: 0.85em;
    color: #666;
    background: rgba(255,255,255,0.9);
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.step.active .step-circle {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    transform: translateY(-50%) scale(1.1); /* Pop effect */
}

.step.completed .step-circle {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.step.active .step-label,
.step.completed .step-label {
    color: var(--secondary-color);
    font-weight: bold;
}

footer {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-top: 40px;
}

@media (max-width: 600px) {
    .countdown-grid {
        gap: 10px;
    }
    
    .time-unit {
        min-width: 60px;
        padding: 10px;
    }
    
    .time-unit span {
        font-size: 1.5em;
    }
    
    /* Mobile Progress Bar: Vertical Layout */
    .progress-container {
        height: 500px; /* Increase height for vertical steps */
        padding: 20px 0 20px 60px; /* Space on left for the line */
    }
    
    .progress-track {
        width: 6px;
        height: 100%;
        left: 30px; /* Center in the 60px padding zone */
        top: 0;
        transform: none;
        right: auto; /* Reset desktop styles */
    }

    .progress-fill {
        width: 6px;
        height: 0%; /* JS will animate this */
        left: 30px; /* Match track */
        top: 0;
        transform: none;
    }
    
    .step {
        width: 100%; /* Take full width of container (minus padding) */
        flex-direction: row;
        align-items: center;
        transform: translateY(-50%); /* Center vertically on the point */
        left: 0 !important; /* Reset desktop calc */
        top: auto; /* Reset desktop top */
    }

    /* Mobile vertical positioning (Top based) */
    .step[data-step="1"] { top: 0%; }
    .step[data-step="2"] { top: 70%; }
    .step[data-step="3"] { top: 85%; }
    .step[data-step="4"] { top: 100%; }
    
    .step-circle {
        /* Position relative to the step container */
        position: absolute;
        left: 30px; /* Center on the line (which is at 30px) */
        transform: translateX(-50%); /* Center the circle horizontally on 30px */
        margin-bottom: 0;
    }

    .step-label {
        position: relative;
        top: auto;
        left: 60px; /* Push label to the right of the line */
        margin-left: 10px;
        text-align: left;
    }
}
