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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'SF Pro Display', sans-serif;
    line-height: 1.6;
    color: #e5e7eb;
    background: #000000;
    min-height: 100vh;
    /* Better text rendering on mobile */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-size-adjust: 100%;
    /* Prevent horizontal scroll */
    overflow-x: hidden;
}

header {
    background: linear-gradient(135deg, #0a0a0a, #000000);
    border-bottom: 1px solid #1a1a1a;
    color: white;
    text-align: center;
    padding: 4rem 0;
    margin-bottom: 4rem;
}

header h1 {
    font-size: 3rem;
    font-weight: 100;
    margin-bottom: 0.5rem;
    color: #fc4c02;
    letter-spacing: -2px;
}

header p {
    opacity: 0.7;
    font-size: 1.1rem;
    font-weight: 300;
    color: #a1a1aa;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    margin-bottom: 4rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.stat-card {
    background: radial-gradient(circle at top, #0d0d0d, #000000);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid #1a1a1a;
    text-align: center;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #fc4c02, transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(252, 76, 2, 0.3);
    background: radial-gradient(circle at top, #1a0a00, #000000);
    box-shadow: 0 20px 40px rgba(252, 76, 2, 0.1);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #666666;
    margin-bottom: 1rem;
    font-weight: 500;
}

.stat-card span {
    font-size: 2.2rem;
    font-weight: 100;
    color: #fc4c02;
    display: block;
    letter-spacing: -1px;
    white-space: nowrap;
}

/* Today Status */
#today-status {
    background: radial-gradient(circle at top left, #0d0d0d, #000000);
    border-radius: 20px;
    border: 1px solid #1a1a1a;
    padding: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

#today-status::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(252, 76, 2, 0.3), transparent);
}

.today-status-container h3 {
    font-size: 1.5rem;
    font-weight: 200;
    color: #ffffff;
    margin-bottom: 2rem;
    border-bottom: 1px solid #1a1a1a;
    padding-bottom: 1rem;
    letter-spacing: -0.5px;
}

.status-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 0;
}

.status-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.status-details {
    flex: 1;
}

.status-main {
    font-size: 1.8rem;
    font-weight: 300;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.status-info {
    font-size: 1rem;
    opacity: 0.7;
    font-weight: 300;
}

.status-content.completed .status-main {
    color: #22c55e;
}

.status-content.pending .status-main {
    color: #f59e0b;
}

.status-content.completed .status-info {
    color: #e5e7eb;
}

.status-content.pending .status-info {
    color: #a1a1aa;
}

/* Sections */
#activity-list,
#elevation-chart {
    background: radial-gradient(circle at top left, #0d0d0d, #000000);
    border-radius: 20px;
    border: 1px solid #1a1a1a;
    padding: 3rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

/* Charts Row */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

#activity-types-chart,
#temperature-chart,
#time-of-day-chart {
    background: radial-gradient(circle at top left, #0d0d0d, #000000);
    border-radius: 20px;
    border: 1px solid #1a1a1a;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

#activity-list::before,
#elevation-chart::before,
#activity-types-chart::before,
#temperature-chart::before,
#time-of-day-chart::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(252, 76, 2, 0.3), transparent);
}

#activity-list h3,
#elevation-chart h3 {
    font-size: 1.5rem;
    font-weight: 200;
    color: #ffffff;
    margin-bottom: 2rem;
    border-bottom: 1px solid #1a1a1a;
    padding-bottom: 1rem;
    letter-spacing: -0.5px;
}

#activity-types-chart h3,
#temperature-chart h3,
#time-of-day-chart h3 {
    font-size: 1.1rem;
    font-weight: 300;
    color: #ffffff;
    margin-bottom: 1.5rem;
    letter-spacing: -0.3px;
    text-align: center;
}

/* Minimalist Bar Charts */
.mini-bar-chart {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chart-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chart-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.chart-label {
    font-size: 0.8rem;
    color: #a1a1aa;
    width: 70px;
    text-align: left;
    flex-shrink: 0;
}

.chart-bar-container {
    flex: 1;
    height: 6px;
    background: #1a1a1a;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.chart-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #fc4c02, #ff6b2b);
    border-radius: 3px;
    transition: width 0.8s ease;
}

.chart-count {
    font-size: 0.8rem;
    color: #fc4c02;
    font-weight: 500;
    width: 30px;
    text-align: right;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* Time of Day Radar Chart */
.time-radar-chart {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 220px;
    position: relative;
}

.radar-svg {
    width: 200px;
    height: 200px;
    filter: drop-shadow(0 0 10px rgba(252, 76, 2, 0.1));
}

/* Day Blocks */
.day-blocks {
    display: grid;
    grid-template-columns: repeat(53, 1fr);
    gap: 4px;
    margin-top: 2rem;
    max-width: 100%;
    overflow-x: auto;
    padding: 2rem 1rem;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.day-block {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    position: relative;
    /* Better touch feedback */
    -webkit-tap-highlight-color: rgba(252, 76, 2, 0.3);
}

.day-block:hover {
    transform: scale(1.4);
    border-color: #fc4c02;
    box-shadow: 0 0 15px rgba(252, 76, 2, 0.6);
    z-index: 10;
}

.day-blocks-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    font-size: 0.8rem;
    color: #666666;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-block {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

/* Elevation Chart */
.elevation-chart {
    margin-top: 2rem;
}

.elevation-svg {
    background: radial-gradient(ellipse at center, rgba(252, 76, 2, 0.03), transparent);
    border-radius: 12px;
}

.elevation-line {
    filter: drop-shadow(0 0 8px rgba(252, 76, 2, 0.5));
}

.elevation-point {
    transition: all 0.3s ease;
}

.elevation-point:hover {
    r: 6;
    filter: drop-shadow(0 0 10px rgba(252, 76, 2, 0.8));
}


/* Responsive Design */
@media (max-width: 968px) {
    .charts-row {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    header {
        padding: 2rem 0;
    }
    
    header h1 {
        font-size: 2.2rem;
        letter-spacing: -1px;
    }
    
    header p {
        font-size: 1rem;
    }
    
    main {
        padding: 0 1rem;
        max-width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-card h3 {
        font-size: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .stat-card span {
        font-size: 1.8rem;
    }
    
    .day-blocks {
        grid-template-columns: repeat(auto-fit, minmax(10px, 1fr));
        gap: 3px;
        padding: 1rem;
        overflow-x: auto;
        scrollbar-width: thin;
    }
    
    .day-blocks::-webkit-scrollbar {
        height: 6px;
    }
    
    .day-blocks::-webkit-scrollbar-track {
        background: #1a1a1a;
    }
    
    .day-blocks::-webkit-scrollbar-thumb {
        background: #fc4c02;
        border-radius: 3px;
    }
    
    .day-block {
        width: 10px;
        height: 10px;
        min-width: 10px;
        min-height: 10px;
    }
    
    .day-blocks-legend {
        flex-direction: column;
        gap: 0.75rem;
        font-size: 0.75rem;
    }
    
    .legend-item {
        gap: 0.25rem;
    }
    
    .legend-block {
        width: 8px;
        height: 8px;
    }
    
    #today-status {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .today-status-container h3 {
        font-size: 1.25rem;
        margin-bottom: 1.5rem;
    }
    
    .status-content {
        gap: 1rem;
        padding: 1rem 0;
    }
    
    .status-icon {
        font-size: 2rem;
    }
    
    .status-main {
        font-size: 1.4rem;
    }
    
    .status-info {
        font-size: 0.9rem;
    }

    #activity-list,
    #elevation-chart {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }

    #activity-types-chart,
    #temperature-chart,
    #time-of-day-chart {
        padding: 1.5rem;
    }
    
    #activity-list h3,
    #elevation-chart h3 {
        font-size: 1.25rem;
        margin-bottom: 1.5rem;
    }

    #activity-types-chart h3,
    #temperature-chart h3,
    #time-of-day-chart h3 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .charts-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 2rem;
    }
    
}

@media (max-width: 480px) {
    header {
        padding: 1.5rem 0;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.25rem;
    }
    
    .day-blocks {
        grid-template-columns: repeat(auto-fit, minmax(8px, 1fr));
        gap: 2px;
        padding: 0.75rem;
    }
    
    .day-block {
        width: 8px;
        height: 8px;
        min-width: 8px;
        min-height: 8px;
    }
    
    .status-content {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .status-icon {
        font-size: 3rem;
    }
    
    #today-status,
    #activity-list,
    #elevation-chart,
    #activity-chart {
        padding: 1rem;
    }
}