/**
 * Relaxation Protocol Styles
 * Uses same CSS variables as main styles.css
 * Kept in separate file per requirements
 */

/* Home Screen (Mode Selector) */


.home-screen {
    justify-content: center;
    align-items: center;
}

.home-content {
    width: 100%;
    max-width: 320px;
    text-align: center;
}

.mode-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.mode-btn {
    background: var(--surface);
    border: none;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: left;
    cursor: pointer;
    transition: transform 0.1s, background 0.15s;
}

.mode-btn:active {
    transform: scale(0.98);
}

.mode-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.mode-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    display: block;
}

.mode-desc {
    font-size: 0.875rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
}

/* Relaxation screens base */
.relax-screen {
    display: none;
    flex-direction: column;
    height: 100%;
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.relax-screen.active {
    display: flex;
}

/* Relaxation header */
.relax-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    gap: 0.5rem;
}

.header-title {
    flex: 1;
    text-align: center;
}

.relax-header h1 {
    font-size: 1.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-attribution {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
    text-decoration: none;
}

.header-attribution:hover {
    color: var(--accent);
}

.back-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.header-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    flex-shrink: 0;
}

/* Day selector grid */
.day-selector-content {
    flex: 1;
    overflow-y: auto;
    font-family: 'Space Grotesk', sans-serif;
}

.day-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.day-btn {
    background: var(--surface);
    border: none;
    border-radius: 0.75rem;
    padding: 1rem 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.1s, background 0.15s;
    position: relative;
    font-family: 'Space Grotesk', sans-serif;
}

.day-btn:active {
    transform: scale(0.98);
}

.day-btn.complete {
    background: color-mix(in srgb, var(--accent) 15%, var(--surface));
}

.day-number {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    display: block;
    margin-bottom: 0.25rem;
}

.day-desc {
    font-size: 0.7rem;
    color: var(--text);
    display: block;
    margin-bottom: 0.5rem;
}

.day-progress {
    height: 4px;
    background: var(--bg);
    border-radius: 2px;
    overflow: hidden;
}

.day-progress-bar {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s;
}

.day-complete-icon {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    color: var(--accent);
    font-size: 0.75rem;
}

/* Task list */
.task-list-content {
    flex: 1;
    overflow-y: auto;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem;
    background: var(--surface);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.15s;
}

.task-item:active {
    background: color-mix(in srgb, var(--text) 5%, var(--surface));
}

.task-item.complete {
    opacity: 0.6;
}

.task-item.current {
    border: 2px solid var(--accent);
}

.task-number {
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-dim);
    flex-shrink: 0;
}

.task-item.complete .task-number {
    background: var(--accent);
    color: var(--bg);
}

.task-text {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text);
    line-height: 1.4;
}

.task-duration {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-dim);
    flex-shrink: 0;
}

/* Task view */
.task-view-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    text-align: center;
}

.task-instruction {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 2rem;
    max-width: 320px;
}

.task-progress-label {
    font-size: 0.875rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

/* Timer container */
.relax-timer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.relax-timer-container.hidden {
    display: none;
}

.relax-countdown-display {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.relax-countdown {
    font-family: 'JetBrains Mono', monospace;
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--text);
}

.relax-countdown-ms {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    color: var(--text-dim);
}

.timer-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.timer-controls .btn {
    padding: 1rem 1.5rem;
    font-size: 1rem;
}

.timer-controls .btn.hidden {
    display: none;
}

/* Mark complete button */
.mark-complete-btn {
    padding: 1.5rem 3rem;
    font-size: 1.25rem;
}

.mark-complete-btn.hidden {
    display: none;
}

/* Task navigation */
.task-nav {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    gap: 0.75rem;
}

.task-nav .btn {
    flex: 1;
    padding: 1rem;
}

/* Tips page */
.tips-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.tips-section {
    background: var(--surface);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.tips-section h2 {
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tips-list li {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-dim);
    padding: 0.4rem 0;
    padding-left: 1rem;
    position: relative;
}

.tips-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.85rem;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
}

/* Day complete overlay */
.day-complete-message {
    text-align: center;
    padding: 2rem;
}

.day-complete-message h2 {
    color: var(--accent);
    margin-bottom: 1rem;
}

.day-complete-message p {
    color: var(--text-dim);
    margin-bottom: 2rem;
}

/* Reset button in day selector */
.reset-progress-btn {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    background: transparent;
    border: 1px solid var(--fail);
    color: var(--fail);
}

.reset-progress-btn:active {
    background: var(--fail);
    color: white;
}

/* Responsive adjustments */
@media (max-width: 360px) {
    .day-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .day-btn {
        padding: 0.75rem 0.5rem;
    }

    .day-number {
        font-size: 0.8rem;
    }

    .day-desc {
        font-size: 0.65rem;
    }

    .relax-countdown {
        font-size: 4rem;
    }

    .task-instruction {
        font-size: 1.1rem;
    }
}

/* Scrollbar styling */
.task-list-content::-webkit-scrollbar,
.tips-content::-webkit-scrollbar,
.day-selector-content::-webkit-scrollbar {
    width: 4px;
}

.task-list-content::-webkit-scrollbar-track,
.tips-content::-webkit-scrollbar-track,
.day-selector-content::-webkit-scrollbar-track {
    background: transparent;
}

.task-list-content::-webkit-scrollbar-thumb,
.tips-content::-webkit-scrollbar-thumb,
.day-selector-content::-webkit-scrollbar-thumb {
    background: var(--surface);
    border-radius: 2px;
}

/* Test Mode Screen */
.test-mode-screen {
    display: none;
    flex-direction: column;
    height: 100%;
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.test-mode-screen.active {
    display: flex;
}

.test-mode-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    gap: 0.5rem;
}

.test-mode-header h1 {
    font-size: 1.125rem;
    flex: 1;
    text-align: center;
}

.test-mode-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    text-align: center;
}

.test-mode-instruction {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-dim);
    margin-bottom: 2rem;
    max-width: 320px;
}

.test-mode-timer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.test-mode-countdown-display {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.test-mode-countdown {
    font-family: 'JetBrains Mono', monospace;
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--text);
}

.test-mode-countdown-ms {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    color: var(--text-dim);
}

.test-mode-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.test-mode-controls .btn {
    padding: 1rem 1.5rem;
    font-size: 1rem;
}

.test-mode-controls .btn.hidden {
    display: none;
}

@media (max-width: 360px) {
    .test-mode-countdown {
        font-size: 4rem;
    }

    .test-mode-instruction {
        font-size: 1rem;
    }
}

/* Stopwatch Screen - Single screen with idle/running states */
.stopwatch-screen {
    display: none;
    flex-direction: column;
    height: 100%;
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.stopwatch-screen.active {
    display: flex;
}

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

.stopwatch-header h1 {
    font-size: 1.125rem;
    flex: 1;
    text-align: center;
}

/* Main content area */
.stopwatch-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    max-width: 320px;
    margin: 0 auto;
    width: 100%;
}

/* Time display area */
.stopwatch-time-area {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Large editable time input */
.stopwatch-time-input {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.stopwatch-time-input.hidden {
    display: none;
}

.stopwatch-input {
    width: 5.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    text-align: center;
    background: transparent;
    border: none;
    color: var(--text);
    padding: 0;
    -moz-appearance: textfield;
}

.stopwatch-input::-webkit-outer-spin-button,
.stopwatch-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.stopwatch-input:focus {
    outline: none;
    background: var(--surface);
    border-radius: 0.5rem;
}

.stopwatch-input:disabled {
    background: transparent;
    color: var(--text);
    opacity: 1;
    -webkit-text-fill-color: var(--text);
}

.stopwatch-separator {
    font-family: 'JetBrains Mono', monospace;
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--text-dim);
}

/* Time display container */
.stopwatch-time-display {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Milliseconds display */
.stopwatch-ms {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    color: var(--text-dim);
}

.stopwatch-ms.hidden {
    display: none;
}

/* Start button */
.stopwatch-start-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.125rem;
}

/* Presets section */
.stopwatch-presets {
    width: 100%;
}

.stopwatch-presets.hidden {
    display: none;
}

.stopwatch-presets label {
    display: block;
    margin-bottom: 0.75rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.875rem;
}

.preset-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.preset-btn {
    background: var(--surface);
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.preset-btn:active {
    transform: scale(0.98);
    background: color-mix(in srgb, var(--accent) 20%, var(--surface));
}

/* Countdown display (running state) */
.stopwatch-countdown-display {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stopwatch-countdown-display.hidden {
    display: none;
}

.stopwatch-countdown {
    font-family: 'JetBrains Mono', monospace;
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--text);
}

.stopwatch-countdown-ms {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    color: var(--text-dim);
}

/* Controls area */
.stopwatch-controls-area {
    width: 100%;
}

.stopwatch-start-btn.hidden {
    display: none;
}

/* Timer controls */
.stopwatch-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.stopwatch-controls.hidden {
    display: none;
}

.stopwatch-controls .btn {
    padding: 1rem 1.5rem;
    font-size: 1rem;
}

.stopwatch-controls .btn.hidden {
    display: none;
}

/* Responsive */
@media (max-width: 360px) {
    .stopwatch-input {
        width: 4.5rem;
        font-size: 4rem;
    }

    .stopwatch-separator {
        font-size: 4rem;
    }

    .stopwatch-countdown {
        font-size: 4rem;
    }

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