:root {
    --primary: #2563eb;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 16px;
    color: white;
    box-shadow: var(--shadow-lg);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.highlight {
    border: 2px solid var(--primary);
}

.recommendation {
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
    border: 2px solid var(--secondary);
}

/* Aktuální stav */
.current-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-box {
    text-align: center;
    padding: 20px;
    background: var(--bg-main);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-time {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Porovnání s průměrem */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.comparison-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid var(--secondary);
    text-align: center;
}

.comparison-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.comparison-current {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 600;
}

.comparison-average {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.comparison-diff {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
}

.comparison-diff.higher {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.comparison-diff.lower {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

/* Heatmap */
.heatmap {
    overflow-x: auto;
    margin-top: 20px;
}

.heatmap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.heatmap th,
.heatmap td {
    padding: 12px 8px;
    text-align: center;
    border: 1px solid var(--border);
}

.heatmap th {
    background: var(--bg-main);
    font-weight: 600;
    color: var(--text-primary);
    position: sticky;
    top: 0;
}

.heatmap td {
    cursor: pointer;
    transition: transform 0.2s;
    font-weight: 600;
}

.heatmap td:hover {
    transform: scale(1.05);
    box-shadow: 0 0 0 2px var(--primary);
    z-index: 1;
}

.heatmap-cell {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 6px;
    min-width: 45px;
}

/* Barevná škála pro heatmapu - od světlé (méně lidí) k tmavé (více lidí) */
.heatmap-0-20 { background: #d1fae5; color: #065f46; }
.heatmap-20-40 { background: #6ee7b7; color: #065f46; }
.heatmap-40-60 { background: #fde047; color: #854d0e; }
.heatmap-60-80 { background: #fb923c; color: white; }
.heatmap-80-100 { background: #dc2626; color: white; }

.heatmap .closed {
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 0.75rem;
    font-style: italic;
}

/* Canvas grafy */
canvas {
    max-height: 400px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-style: italic;
}

footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsivní design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .container {
        padding: 15px;
    }

    .card {
        padding: 20px;
    }

    .current-grid {
        grid-template-columns: 1fr;
    }

    .best-times-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .heatmap {
        font-size: 0.75rem;
    }

    .heatmap th,
    .heatmap td {
        padding: 8px 4px;
    }
}
