/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: white;
    overflow-x: hidden;
}

.container {
    max-width: 100vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation */
.nav {
    display: flex;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    margin: 0 5px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
    opacity: 0.7;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    opacity: 0.9;
}

.nav-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    opacity: 1;
}

/* Pages */
.page {
    display: none;
    flex: 1;
    padding: 40px;
}

.page.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Page Compteur */
.counter-display {
    text-align: center;
    margin: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.counter-title {
    font-size: 4rem;
    margin-bottom: 40px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4);
    font-weight: 300;
}

.km-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 20px;
}

#total-km {
    font-size: 12rem;
    font-weight: bold;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.5);
    color: #FFD700;
    line-height: 1;
}

.km-unit {
    font-size: 4rem;
    font-weight: 300;
    opacity: 0.8;
}

/* Contrôles en bas */
.bottom-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px 15px 0 0;
    z-index: 2;
}

.controls-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 800px;
    gap: 40px;
}

.add-controls, .remove-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.add-controls h3, .remove-controls h3 {
    font-size: 1rem;
    font-weight: normal;
    opacity: 0.8;
    margin: 0;
    text-align: center;
}

.button-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.km-btn {
    border: none;
    color: white;
    padding: 15px 25px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.add-btn {
    background: linear-gradient(45deg, #4CAF50, #45a049);
}

.remove-btn {
    background: linear-gradient(45deg, #FF6B6B, #FF5252);
}

.add-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #45a049, #4CAF50);
}

.remove-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #FF5252, #FF6B6B);
}

.km-btn:active {
    transform: translateY(-1px);
}


.reset-section {
    margin-top: 10px;
}

.reset-btn {
    background: rgba(255, 68, 68, 0.3);
    border: 1px solid rgba(255, 68, 68, 0.5);
    color: white;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: normal;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.reset-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 68, 68, 0.5);
    opacity: 1;
}

.instructions {
    margin: 20px 0;
    text-align: center;
    opacity: 0.8;
    font-size: 1rem;
}

/* Page Statistiques */
#stats-page {
    align-items: flex-start;
    padding: 40px 60px;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 40px;
}

.demo-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.demo-btn {
    background: linear-gradient(45deg, #2196F3, #1976D2);
    border: none;
    color: white;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: bold;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.demo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.demo-btn.active {
    background: linear-gradient(45deg, #FF9800, #F57C00);
}

.demo-indicator {
    background: rgba(255, 152, 0, 0.2);
    color: #FF9800;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.stats-title {
    font-size: 2.5rem;
    text-align: left;
    margin-bottom: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    width: 100%;
    margin-bottom: 40px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-card h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.km-breakdown, .recent-activity, .hourly-chart {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
}

.km-breakdown h3, .recent-activity h3, .hourly-chart h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
}

.breakdown-list, .activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.breakdown-item, .activity-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px 20px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #FFD700;
}

.breakdown-km, .activity-km {
    font-weight: bold;
    color: #FFD700;
    font-size: 1.1rem;
}

.activity-km.add {
    color: #4CAF50;
}

.activity-km.remove {
    color: #FF6B6B;
}

/* Graphique 24h */
.chart-container {
    display: flex;
    flex-direction: column;
    height: 200px;
    margin-top: 20px;
}

.chart-bars {
    display: flex;
    align-items: end;
    height: 150px;
    gap: 2px;
    padding: 0 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.chart-bar {
    flex: 1;
    min-height: 2px;
    border-radius: 2px 2px 0 0;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.chart-bar:hover {
    opacity: 0.8;
    transform: scaleY(1.05);
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding: 0 10px;
    font-size: 0.9rem;
    opacity: 0.7;
}

.chart-labels span {
    flex: 1;
    text-align: center;
}

.breakdown-count, .activity-time {
    opacity: 0.8;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes pulseRed {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.km-added {
    animation: pulse 0.6s ease-in-out;
}

.km-removed {
    animation: pulseRed 0.6s ease-in-out;
}

/* Responsive */
@media (max-width: 768px) {
    .counter-title {
        font-size: 2rem;
    }
    
    #total-km {
        font-size: 5rem;
    }
    
    .km-unit {
        font-size: 2rem;
    }
    
    .button-group {
        flex-direction: column;
        align-items: center;
    }
    
    .controls-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .km-btn {
        width: 120px;
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .stats-title {
        text-align: center;
    }
    
    .chart-container {
        height: 150px;
    }
    
    .chart-bars {
        height: 100px;
    }
    
    .nav-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
        min-width: 70px;
    }
}

/* Mode plein écran pour TV */
@media (min-width: 1920px) {
    .counter-title {
        font-size: 4rem;
    }
    
    #total-km {
        font-size: 12rem;
    }
    
    .km-unit {
        font-size: 4rem;
    }
    
    .km-btn {
        padding: 20px 30px;
        font-size: 1.3rem;
        min-width: 100px;
    }
    
    .nav-btn {
        padding: 10px 20px;
        font-size: 1rem;
        min-width: 100px;
    }
}
