/* CSS Variables - Light Theme */
:root {
    --background: #fafafa;
    --foreground: #171717;
    --card: #ffffff;
    --card-foreground: #171717;
    --primary: #3b82f6;
    --primary-foreground: #ffffff;
    --secondary: #f4f4f5;
    --secondary-foreground: #171717;
    --muted: #f4f4f5;
    --muted-foreground: #737373;
    --border: #e5e5e5;
    --accent: #3b82f6;
    --accent-light: rgba(59, 130, 246, 0.1);
    --chart-1: #3b82f6;
    --chart-2: #60a5fa;
    --radius: 0.5rem;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Dark Theme */
.dark {
    --background: #0a0a0a;
    --foreground: #fafafa;
    --card: #171717;
    --card-foreground: #fafafa;
    --primary: #60a5fa;
    --primary-foreground: #ffffff;
    --secondary: #262626;
    --secondary-foreground: #fafafa;
    --muted: #262626;
    --muted-foreground: #a3a3a3;
    --border: #404040;
    --accent: #60a5fa;
    --accent-light: rgba(96, 165, 250, 0.15);
    --chart-1: #60a5fa;
    --chart-2: #93c5fd;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.5;
}

.min-h-screen {
    min-height: 100vh;
}

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

.hidden {
    display: none !important;
}

/* Header */
.header {
    border-bottom: 1px solid var(--border);
    background-color: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 10;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.dark .header {
    background-color: rgba(23, 23, 23, 0.5);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.header-subtitle {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.theme-toggle {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.theme-toggle:hover {
    background-color: var(--muted);
}

.icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--foreground);
}

/* Main Content */
.main-content {
    padding: 2rem 1rem;
}

@media (min-width: 1024px) {
    .main-content {
        padding: 3rem 1rem;
    }
}

.grid-layout {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .grid-layout {
        grid-template-columns: 2fr 1fr;
    }
}

/* Cards */
.card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Counter Section */
.counter-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.counter-card {
    padding: 2rem;
}

@media (min-width: 1024px) {
    .counter-card {
        padding: 3rem;
    }
}

.counter-content {
    text-align: center;
    margin-bottom: 2rem;
}

.counter-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.counter-value {
    font-size: 6rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    transition: transform 0.3s ease;
    line-height: 1;
}

@media (min-width: 1024px) {
    .counter-value {
        font-size: 8rem;
    }
}

/* Buttons */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 28rem;
    margin: 0 auto;
}

@media (min-width: 640px) {
    .button-group {
        flex-direction: row;
    }
}

.btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 3.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: scale(1.05);
}

.btn:active {
    transform: scale(0.95);
}

.btn-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--foreground);
}

.btn-outline:hover {
    background-color: var(--muted);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--secondary-foreground);
}

.btn-secondary:hover {
    background-color: var(--muted);
}

.btn-primary {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

.btn-primary:hover {
    background-color: var(--accent);
    opacity: 0.9;
}

/* Progress Card */
.progress-card {
    padding: 1.5rem;
}

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

.progress-title {
    font-size: 0.875rem;
    font-weight: 600;
}

.progress-subtitle {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.progress-value-container {
    text-align: right;
}

.progress-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.progress-max {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.progress-bar-container {
    height: 0.75rem;
    background-color: var(--muted);
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.progress-labels .above-range {
    color: var(--chart-1);
}

.progress-labels .below-range {
    color: var(--chart-2);
}

/* History Section */
.history-section {
    height: 100%;
}

.history-card {
    padding: 1.5rem;
    height: 100%;
}

.history-header {
    margin-bottom: 1rem;
}

.history-title {
    font-size: 0.875rem;
    font-weight: 600;
}

.history-subtitle {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

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

.history-empty {
    text-align: center;
    padding: 3rem 0;
}

.history-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: var(--muted);
    margin-bottom: 0.75rem;
}

.history-empty-icon .icon {
    color: var(--muted-foreground);
}

.history-empty-text {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.history-empty-hint {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin-top: 0.25rem;
}

.history-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius);
    background-color: rgba(0, 0, 0, 0.025);
    border: 1px solid var(--border);
    transition: background-color 0.2s ease;
    animation: slideIn 0.3s ease;
}

.dark .history-item {
    background-color: rgba(255, 255, 255, 0.025);
}

.history-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.dark .history-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.history-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-icon.increment {
    background-color: var(--accent-light);
    color: var(--primary);
}

.history-icon.decrement {
    background-color: rgba(96, 165, 250, 0.1);
    color: var(--chart-2);
}

.history-icon.reset {
    background-color: var(--muted);
    color: var(--muted-foreground);
}

.history-icon .icon {
    width: 1rem;
    height: 1rem;
}

.history-details {
    flex: 1;
    min-width: 0;
}

.history-action {
    font-size: 0.875rem;
    font-weight: 500;
}

.history-action .value {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.history-action .value.increment {
    color: var(--chart-1);
}

.history-action .value.decrement {
    color: var(--chart-2);
}

.history-action .value.reset {
    color: var(--muted-foreground);
}

.history-time {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    font-variant-numeric: tabular-nums;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

@media (min-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.stat-card {
    padding: 1rem;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.25rem;
    font-variant-numeric: tabular-nums;
}
