/* Base Styles - Leica Color Theme */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    background: #1a1a1a;
    color: #e8e8e8;
    font-family: 'Atkinson Hyperlegible', Atkinson Hyperlegible, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    flex-direction: column;
    overflow-x: hidden;
}

/* Leica Red Accent Color */
:root {
    --leica-red: #da291c;
    --leica-red-dark: #b71c1c;
    --leica-black: #0d0d0d;
    --leica-dark-gray: #1a1a1a;
    --leica-gray: #2d2d2d;
    --leica-light-gray: #4a4a4a;
    --leica-white: #e8e8e8;
    --leica-silver: #c0c0c0;
    --leica-chrome: #e5e5e5;
}

/* Atkinson Hyperlegible Font Weights */
@font-face {
    font-family: 'Atkinson Hyperlegible';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(https://fonts.bunny.net/atkinson-hyperlegible/files/atkinson-hyperlegible-latin-400-normal.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Atkinson Hyperlegible';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(https://fonts.bunny.net/atkinson-hyperlegible/files/atkinson-hyperlegible-latin-700-normal.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

.container {
    width: 100%;
    max-width: 900px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header - Leica Style */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 0 10px;
}

h1, h2 {
    font-family: 'Atkinson Hyperlegible', Atkinson Hyperlegible, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 700;
}

h1 {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
    margin: 0 0 10px 0;
    letter-spacing: 4px;
    text-transform: uppercase;
    word-wrap: break-word;
    color: var(--leica-white);
    position: relative;
    display: inline-block;
}

/* Leica-style red dot accent */
h1::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background: var(--leica-red);
    border-radius: 50%;
    margin: 15px auto 0;
    box-shadow: 0 0 10px var(--leica-red);
}

.subtitle {
    font-family: 'Atkinson Hyperlegible', Atkinson Hyperlegible, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    color: var(--leica-silver);
    font-size: clamp(0.75rem, 2.5vw, 0.9rem);
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0.8;
}

/* Countdown - Leica Precision Style */
.countdown {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    text-align: center;
    gap: 15px;
    padding: 30px 20px;
    background: linear-gradient(145deg, #222222, #151515);
    border-radius: 12px;
    border: 1px solid #333;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    padding: 15px 10px;
}

.number {
    font-family: 'Atkinson Hyperlegible', Atkinson Hyperlegible, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 12vw, 80px);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--leica-white);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.label {
    font-family: 'Atkinson Hyperlegible', Atkinson Hyperlegible, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    color: var(--leica-silver);
    font-size: clamp(0.65rem, 2vw, 12px);
    margin-top: 12px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.separator {
    font-family: 'Atkinson Hyperlegible', Atkinson Hyperlegible, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 8vw, 60px);
    color: var(--leica-red);
    line-height: 1;
    padding: 0 5px;
    text-shadow: 0 0 20px rgba(218, 41, 28, 0.3);
}

/* Chart Section */
.chart-section {
    width: 100%;
    margin-top: 50px;
    padding: 30px 20px;
    background: linear-gradient(145deg, #222222, #151515);
    border-radius: 12px;
    border: 1px solid #333;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.chart-section h2 {
    font-size: clamp(1rem, 4vw, 1.3rem);
    margin-bottom: 25px;
    letter-spacing: 3px;
    color: var(--leica-silver);
    text-align: center;
    text-transform: uppercase;
}

.chart-container {
    width: 100%;
    overflow-x: auto;
}

/* Legend */
.chart-legend {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Atkinson Hyperlegible', Atkinson Hyperlegible, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--leica-silver);
    letter-spacing: 1px;
}

.legend-color {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Upward Bar Chart Grid */
.chart-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    min-height: 220px;
    padding: 10px 0;
    gap: 8px;
}

.chart-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
    position: relative;
}

/* Bar Container - Fixed Height */
.bar-container {
    width: 100%;
    max-width: 40px;
    height: 180px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: relative;
}

/* Individual Bars - Growing Upwards */
.upward-bar {
    width: 100%;
    border-radius: 4px 4px 0 0;
    transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 2px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.chart-value {
    font-family: 'Atkinson Hyperlegible', Atkinson Hyperlegible, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 700;
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    margin-top: 12px;
    color: var(--leica-white);
}

.chart-label {
    font-family: 'Atkinson Hyperlegible', Atkinson Hyperlegible, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    font-size: clamp(0.6rem, 2vw, 0.75rem);
    margin-top: 6px;
    color: var(--leica-light-gray);
    letter-spacing: 1px;
}

/* Status States - Bars */
.chart-bar-wrapper.past .upward-bar {
    opacity: 0.3;
}

.chart-bar-wrapper.current .upward-bar {
    box-shadow: 0 0 20px rgba(218, 41, 28, 0.5);
    background: var(--leica-red) !important;
}

/* Footer */
footer {
    font-family: 'Atkinson Hyperlegible', Atkinson Hyperlegible, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    margin-top: 40px;
    color: var(--leica-light-gray);
    font-size: clamp(0.7rem, 2.5vw, 0.85rem);
    text-transform: uppercase;
    letter-spacing: 4px;
    text-align: center;
    padding: 0 10px;
}

/* Completed State */
.ended {
    font-family: 'Atkinson Hyperlegible', Atkinson Hyperlegible, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    text-align: center;
    padding: 60px 20px;
    color: var(--leica-red);
    letter-spacing: 3px;
}

/* Touch Improvements */
@media (hover: hover) {
    .time-block:hover .number {
        transform: scale(1.05);
        transition: transform 0.3s ease;
        color: var(--leica-red);
        text-shadow: 0 0 20px rgba(218, 41, 28, 0.5);
    }
    
    .chart-bar-wrapper:hover .upward-bar {
        filter: brightness(1.2);
    }
}

/* Tablet Styles */
@media screen and (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .countdown {
        gap: 10px;
        padding: 25px 15px;
    }
    
    .time-block {
        min-width: 70px;
        padding: 12px 8px;
    }
    
    .chart-section {
        margin-top: 40px;
        padding: 25px 15px;
    }
    
    .bar-container {
        height: 150px;
        max-width: 35px;
    }
}

/* Mobile Styles */
@media screen and (max-width: 480px) {
    body {
        padding: 15px 10px;
    }
    
    header {
        margin-bottom: 25px;
    }
    
    h1 {
        letter-spacing: 3px;
    }
    
    .subtitle {
        letter-spacing: 2px;
    }
    
    .countdown {
        width: 100%;
        justify-content: space-between;
        padding: 20px 10px;
        gap: 5px;
    }
    
    .time-block {
        flex: 1;
        min-width: auto;
        padding: 10px 5px;
    }
    
    .separator {
        display: none;
    }
    
    footer {
        margin-top: 30px;
        letter-spacing: 2px;
    }
    
    .chart-grid {
        gap: 4px;
    }
    
    .chart-bar-wrapper {
        min-width: 35px;
    }
    
    .chart-legend {
        gap: 15px;
    }
    
    .legend-item {
        font-size: 0.75rem;
    }
    
    .bar-container {
        height: 120px;
        max-width: 28px;
    }
}

/* Small Mobile Styles */
@media screen and (max-width: 360px) {
    .number {
        font-size: 2.5rem;
    }
    
    .label {
        font-size: 0.55rem;
        letter-spacing: 1px;
    }
    
    .chart-bar-wrapper {
        min-width: 28px;
    }
    
    .chart-value {
        font-size: 0.8rem;
    }
    
    .bar-container {
        height: 100px;
        max-width: 24px;
    }
}

/* Large Screen Styles */
@media screen and (min-width: 900px) {
    .container {
        max-width: 1000px;
    }
    
    .number {
        font-size: 100px;
    }
    
    .label {
        font-size: 14px;
    }
    
    .bar-container {
        height: 200px;
        max-width: 45px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
    
    .time-block:hover .number {
        transform: none;
    }
    
    .upward-bar {
        transition: none;
    }
    
    .chart-bar-wrapper:hover .upward-bar {
        filter: none;
    }
}

/* Dark Mode Support - Leica is already dark */
@media (prefers-color-scheme: light) {
    body {
        background: #f5f5f5;
        color: #1a1a1a;
    }
    
    .countdown,
    .chart-section {
        background: linear-gradient(145deg, #e8e8e8, #d8d8d8);
        border-color: #ccc;
    }
    
    h1 {
        color: #1a1a1a;
    }
    
    .subtitle {
        color: #666;
    }
    
    .number {
        color: #1a1a1a;
        text-shadow: none;
    }
    
    .label,
    .chart-section h2,
    .legend-item,
    .chart-label,
    footer {
        color: #666;
    }
    
    .chart-value {
        color: #1a1a1a;
    }
    
    .chart-bar-wrapper.past .upward-bar {
        opacity: 0.2;
    }
}

