:root {
    --primary: #8B4513;
    --primary-dark: #654321;
    --secondary: #D2691E;
    --background: #FFF8F0;
    --text: #2C1810;
    --text-light: #6B4423;
    --success: #4CAF50;
    --danger: #F44336;
    --border: #E5D4C1;
    --shadow: rgba(139, 69, 19, 0.1);
    --radius: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

#main-view {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Progress Bar */
.progress-bar {
    position: relative;
    height: 4px;
    background: var(--border);
    margin: 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--primary);
}

.progress-text {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
    background: var(--background);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Step Container */
.step-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 24px;
    text-align: center;
    min-height: 50vh;
}

.step {
    max-width: 400px;
    width: 100%;
    animation: fadeInUp 0.3s ease;
}

.step-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 24px;
    line-height: 1.2;
}

.step-content {
    font-size: 20px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text);
    margin-bottom: 16px;
}

.step-subtext {
    font-size: 16px;
    color: var(--text-light);
    line-height: 1.4;
    font-style: italic;
}

/* Navigation */
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 40px;
    gap: 20px;
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    background: var(--primary);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    -webkit-tap-highlight-color: transparent;
}

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

.nav-btn:hover {
    background: var(--primary-dark);
}

.nav-btn.prev-btn {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    min-width: 60px;
    padding: 14px 16px;
}

.nav-btn.next-btn {
    flex: 1;
    max-width: 200px;
    margin-left: auto;
}

.nav-btn.done-btn {
    background: var(--success);
}

.nav-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Timer */
.timer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: white;
    border-radius: var(--radius);
    margin: 20px 24px;
    box-shadow: 0 4px 12px var(--shadow);
}

.timer-display {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
}

.timer-btn {
    padding: 14px 32px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    background: var(--primary);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

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

.timer-btn.timer-running {
    background: var(--danger);
}

.timer-btn.timer-complete {
    background: var(--success);
    animation: pulse 1s ease infinite;
}

/* Settings Button */
.settings-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: white;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--shadow);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 100;
    -webkit-tap-highlight-color: transparent;
}

.settings-btn:active {
    transform: scale(0.9);
}

.settings-btn svg {
    width: 24px;
    height: 24px;
}

/* Admin Panel */
#admin-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--primary);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.admin-close {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid white;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

.admin-content {
    padding: 20px;
}

.admin-step {
    background: var(--background);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.admin-step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.admin-step-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
}

.delete-step-btn {
    padding: 6px 12px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.admin-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-fields label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
}

.admin-fields input[type="text"],
.admin-fields input[type="number"],
.admin-fields textarea {
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.admin-fields textarea {
    resize: vertical;
    min-height: 60px;
}

.admin-fields input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.admin-fields label:has(input[type="checkbox"]) {
    flex-direction: row;
    align-items: center;
}

.admin-actions {
    position: sticky;
    bottom: 0;
    padding: 16px 20px;
    background: white;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

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

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

#add-step-btn {
    background: var(--success);
    color: white;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 var(--success);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* Responsive */
@media (max-height: 600px) {
    .step-container {
        padding: 20px 24px;
        min-height: 40vh;
    }
    
    .step-title {
        font-size: 24px;
        margin-bottom: 16px;
    }
    
    .step-content {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .timer-display {
        font-size: 36px;
    }
}

@media (min-width: 768px) {
    .step-container {
        padding: 60px 40px;
    }
    
    .step {
        max-width: 500px;
    }
    
    .step-title {
        font-size: 40px;
    }
    
    .step-content {
        font-size: 24px;
    }
    
    .timer-display {
        font-size: 64px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #1A0F08;
        --text: #F5E6D3;
        --text-light: #C4A574;
        --border: #3D2418;
        --shadow: rgba(0, 0, 0, 0.5);
    }
    
    .settings-btn {
        background: var(--primary);
        color: white;
    }
    
    .timer-container {
        background: #2C1810;
    }
    
    #admin-panel {
        background: var(--background);
    }
    
    .admin-step {
        background: #2C1810;
    }
    
    .admin-fields input[type="text"],
    .admin-fields input[type="number"],
    .admin-fields textarea {
        background: var(--background);
        color: var(--text);
        border-color: var(--border);
    }
    
    .admin-actions {
        background: var(--background);
    }
}