/* Base styles shared across all pages */

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

:root {
    /* Core colors */
    --bg-dark: #1a1f2e;
    --bg-sidebar: #242938;
    --bg-cell: #2a3040;
    --grid-line: #2a3040;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;

    /* Activity colors */
    --sleep: #4dd4e4;
    --feed-bottle: #f97316;
    --feed-breast: #fb923c;
    --diaper-pee: #ec4899;
    --diaper-poo: #92400e;
    --diaper-both: #a855f7;
    --solids: #84cc16;
    --pump: #fbbf24;
    --growth: #06b6d4;
    --potty: #14b8a6;
    --formula: #f97316;
    --accent: #4dd4e4;

    /* Meal times */
    --breakfast: #fbbf24;
    --lunch: #f97316;
    --dinner: #a855f7;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
header {
    background: var(--bg-sidebar);
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--grid-line);
}

header h1 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

header h1::before {
    content: '';
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.date-range {
    color: var(--text-secondary);
    font-size: 14px;
}

/* View Selector Dropdown */
.view-selector {
    position: relative;
}

.view-selector-btn {
    background: var(--bg-dark);
    border: 1px solid var(--grid-line);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-selector-btn:hover {
    background: var(--grid-line);
}

.view-selector-btn::after {
    content: '';
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--text-secondary);
}

.view-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--bg-sidebar);
    border: 1px solid var(--grid-line);
    border-radius: 6px;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 100;
    display: none;
}

.view-dropdown.open {
    display: block;
}

.view-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s;
}

.view-option:hover {
    background: var(--grid-line);
    color: var(--text-primary);
}

.view-option.active {
    color: var(--text-primary);
    background: rgba(77, 212, 228, 0.1);
}

.view-option-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Main Container */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 180px;
    background: var(--bg-sidebar);
    padding: 12px;
    border-right: 1px solid var(--grid-line);
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar h3 {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

/* Legend */
.legend {
    margin-top: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 11px;
    color: var(--text-secondary);
}

.legend-item .color-dot {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Stats */
.stats {
    margin-top: 20px;
}

.stat-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--grid-line);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    margin-top: 2px;
}

/* Tooltip */
.tooltip {
    position: fixed;
    background: var(--bg-sidebar);
    border: 1px solid var(--grid-line);
    border-radius: 8px;
    padding: 12px;
    font-size: 12px;
    z-index: 100;
    pointer-events: none;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.tooltip-title {
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tooltip-time {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 11px;
}

/* Filter items (shared) */
.filter-group {
    margin-bottom: 16px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
}

.filter-item input[type="checkbox"] {
    display: none;
}

.filter-item .checkbox {
    width: 14px;
    height: 14px;
    border: 1px solid var(--grid-line);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-item input:checked + .checkbox::after {
    content: '✓';
    font-size: 10px;
    color: var(--accent);
}

/* Download button */
.download-btn {
    background: var(--accent);
    border: none;
    color: #1a1a2e;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.download-btn:hover {
    opacity: 0.9;
}
