:root {
    /* Light Mode */
    --primary: #ff4d4d;
    --primary-hover: #e60000;
    --secondary: #4d4dff;
    --secondary-hover: #0000e6;
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-color: #1c1e21;
    --text-muted: #606770;
    --border-color: #dddfe2;
    --error: #fa383e;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
}

body.dark-mode {
    --bg-color: #18191a;
    --card-bg: #242526;
    --text-color: #e4e6eb;
    --text-muted: #b0b3b8;
    --border-color: #3e4042;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    padding: 20px;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    width: 100%;
    max-width: 600px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

h1 {
    font-weight: 800;
    font-size: 1.75rem;
    color: var(--primary);
}

.step-badge {
    background: var(--border-color);
    color: var(--text-muted);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.btn-icon {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: 8px;
}

.btn-icon:hover {
    background: var(--border-color);
}

/* Cards & Sections */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-top: 16px;
}

.step-section h2 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.hidden {
    display: none !important;
}

/* Inputs */
.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

input[type="number"],
input[type="text"] {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Buttons */
.action-bar {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

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

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

.btn.outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}
.btn.outline:hover { background: var(--border-color); }

/* Step 2 Specifics */
.preview-area {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

#player-preview-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-top: 12px;
}

/* Step 3 Specifics */
.timer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.mode-label {
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.mode-label.focus { background: #ffebeb; color: var(--primary); }
.mode-label.break { background: #ebebff; color: var(--secondary); }

.loop-progress {
    font-size: 0.9rem;
    color: var(--text-muted);
}

#timer-display {
    font-size: 5rem;
    font-weight: 800;
    text-align: center;
    margin: 20px 0;
    font-variant-numeric: tabular-nums;
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

#player-main-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 24px;
}

#player-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    padding: 20px;
    text-align: center;
}

.hint { font-size: 0.8rem; margin-top: 10px; opacity: 0.7; }

.error-msg {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 8px;
}

/* Toggle Switch */
.sound-toggle-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider { background-color: var(--primary); }
input:focus + .slider { box-shadow: 0 0 1px var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }

@media (max-width: 480px) {
    .input-grid { grid-template-columns: 1fr; }
    #timer-display { font-size: 4rem; }
}
