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

:root {
    --pomodoro-color: #ef4444;
    --short-break-color: #10b981;
    --long-break-color: #3b82f6;
    --bg-color: #fef2f2;
    --card-bg: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

.header {
    background: linear-gradient(135deg, var(--pomodoro-color) 0%, #dc2626 100%);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    opacity: 0.9;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.timer-section {
    margin-bottom: 2rem;
}

.timer-card {
    background: var(--card-bg);
    padding: 3rem 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.mode-selector {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.mode-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.mode-btn:hover {
    transform: translateY(-2px);
}

.mode-btn.active {
    background: var(--pomodoro-color);
    border-color: var(--pomodoro-color);
    color: white;
}

.mode-btn.active[data-mode="short"] {
    background: var(--short-break-color);
    border-color: var(--short-break-color);
}

.mode-btn.active[data-mode="long"] {
    background: var(--long-break-color);
    border-color: var(--long-break-color);
}

.timer-display {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 3rem;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle-bg {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 8;
}

.progress-ring-circle {
    fill: none;
    stroke: var(--pomodoro-color);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 848.23;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

.timer-text {
    position: absolute;
    text-align: center;
}

.time {
    font-size: 4rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.session-info {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.timer-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-start {
    background: var(--pomodoro-color);
    color: white;
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.3);
}

.btn-start:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(239, 68, 68, 0.4);
}

.btn-pause {
    background: var(--short-break-color);
    color: white;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
}

.btn-pause:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(16, 185, 129, 0.4);
}

.btn-reset {
    background: var(--bg-color);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-reset:hover {
    border-color: var(--pomodoro-color);
    color: var(--pomodoro-color);
    transform: translateY(-2px);
}

.pomodoro-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 12px;
    font-weight: 600;
}

.tomato-icons {
    font-size: 1.5rem;
}

.settings-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.settings-section h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-item label {
    font-weight: 600;
    color: var(--text-primary);
}

.input-field {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}

.input-field:focus {
    outline: none;
    border-color: var(--pomodoro-color);
}

.setting-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--pomodoro-color);
}

.stats-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.stats-section h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--pomodoro-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.history-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.history-header h3 {
    font-size: 1.25rem;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    border-color: var(--pomodoro-color);
    color: var(--pomodoro-color);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-item {
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-date {
    font-weight: 600;
    color: var(--text-primary);
}

.history-count {
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
    font-style: italic;
}

@media (max-width: 768px) {
    .time {
        font-size: 3rem;
    }

    .timer-controls {
        flex-direction: column;
    }

    .mode-selector {
        flex-direction: column;
    }

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

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1f2937;
        --card-bg: #111827;
        --text-primary: #f9fafb;
        --text-secondary: #9ca3af;
        --border-color: #374151;
    }
}
