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

/* Dark Mode (Default) */
:root {
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #2563eb;
    --bg-gradient-start: #0a0f1a;
    --bg-gradient-end: #0d1321;
    --card-bg: #111827;
    --card-bg-hover: #1a2332;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #1e293b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --countdown-bg: rgba(17, 24, 39, 0.95);
    --input-bg: #1e293b;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* Light Mode */
[data-theme="light"] {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --bg-gradient-start: #f0f4ff;
    --bg-gradient-end: #e8f0ff;
    --card-bg: #ffffff;
    --card-bg-hover: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --countdown-bg: rgba(255, 255, 255, 0.95);
    --input-bg: #ffffff;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px;
    position: relative;
}

/* Theme Toggle */
.theme-toggle {
    position: absolute;
    top: 40px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--card-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    z-index: 50;
}

.theme-toggle:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.theme-toggle svg {
    width: 22px;
    height: 22px;
    color: var(--text-primary);
    transition: transform 0.3s ease;
}

.theme-toggle:hover svg {
    transform: rotate(15deg);
}

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

[data-theme="light"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="light"] .theme-toggle .moon-icon {
    display: none;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 48px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 24px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto;
}

/* Step Sections */
.step-section {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.step-section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.step-header {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.step-number {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    opacity: 0.8;
}

.step-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    transition: background 0.3s ease;
}

.step-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

/* Checklist Items */
.step-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    border-radius: var(--radius-md);
    transition: background-color 0.2s ease;
}

.checklist-item:hover {
    background: rgba(37, 99, 235, 0.04);
}

.checklist-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.2s ease;
    position: relative;
    background: transparent;
}

.checklist-item input[type="checkbox"]:hover {
    border-color: var(--primary-light);
}

.checklist-item input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-color: var(--primary);
}

.checklist-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 7px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checklist-item label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    flex: 1;
}

.checklist-item input[type="checkbox"]:checked+label .item-title {
    color: var(--text-secondary);
    text-decoration: line-through;
}

.item-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.item-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Reset Section - Floating above countdown */
.reset-section {
    position: fixed;
    bottom: 90px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 99;
    pointer-events: none;
}

.reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    pointer-events: auto;
}

.reset-btn:hover {
    background: var(--text-primary);
    color: white;
    border-color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.reset-btn svg {
    transition: transform 0.3s ease;
}

.reset-btn:hover svg {
    transform: rotate(-180deg);
}

/* Countdown Section - Floating Bottom Bar */
.countdown-section {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 16px 24px;
    background: var(--countdown-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border);
    z-index: 100;
    transition: background 0.3s ease;
}

.countdown-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.countdown-controls label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.countdown-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.countdown-input-group input {
    width: 70px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
    background: var(--input-bg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
}

.countdown-input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.start-btn {
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.start-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.start-btn:active {
    transform: translateY(0);
}

.start-btn.running {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.countdown-display {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    min-width: 80px;
    text-align: center;
    letter-spacing: -0.02em;
    transition: transform 0.3s ease, color 0.3s ease;
}

.countdown-display.running {
    animation: countdown-pulse 1s ease-in-out infinite;
}

.countdown-display.finished {
    color: #22c55e;
    animation: countdown-finish 0.5s ease-out;
}

@keyframes countdown-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

@keyframes countdown-finish {
    0% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.footer-text {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Add bottom padding to main content to prevent overlap with fixed footer */
.main-content {
    padding-bottom: 100px;
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 24px 16px;
    }

    .step-section {
        padding: 24px 20px;
    }

    .step-header {
        grid-template-columns: auto 1fr;
        gap: 12px;
    }

    .step-number {
        grid-column: 1;
        grid-row: 1;
    }

    .step-icon {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }

    .step-title {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .checklist-item {
        padding: 12px 8px;
    }

    .countdown-section {
        flex-wrap: wrap;
        gap: 12px;
        padding: 12px 16px;
    }

    .countdown-controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    .countdown-controls label {
        width: 100%;
        text-align: center;
    }

    .countdown-display {
        font-size: 2rem;
        min-width: 60px;
    }

    .footer-text {
        width: 100%;
        text-align: center;
    }

    .reset-section {
        bottom: 200px;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background: rgba(37, 99, 235, 0.2);
    color: var(--text-primary);
}