/* ── Style block 1: Timer-specific background - zen stones for meditation focus ── */
body {
    background: linear-gradient(rgba(10, 15, 20, 0.55), rgba(10, 15, 20, 0.55)), url('../images/zen-bg-timer.jpg?v=2') center/cover fixed no-repeat !important;
}

/* ── Style block 2: Timer-specific styles ── */
.timer-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    height: calc(var(--vh, 1vh) * 100);
    max-width: 600px;
    margin: 0 auto;
    padding: var(--space-lg);
    padding-top: 72px;
    align-items: center;
    justify-content: flex-start;
    overflow-y: auto;
    text-align: center;
    padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
}

.timer-header {
    margin-bottom: var(--space-xl);
}

.timer-header h1 {
    margin-bottom: var(--space-sm);
    font-size: 2rem;
    font-weight: 300;
}

.timer-subtitle {
    color: var(--text-muted);
    font-style: italic;
}

.duration-selector {
    margin-bottom: var(--space-2xl);
}

.duration-label {
    margin-bottom: var(--space-md);
    font-size: 1.1rem;
}

.duration-buttons {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: var(--space-md);
}

.duration-btn {
    padding: var(--space-sm) var(--space-lg);
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.duration-btn:hover {
    border-color: var(--accent-color);
}

.duration-btn.selected {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.custom-duration {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    justify-content: center;
    margin-top: var(--space-md);
}

.custom-input {
    width: 80px;
    text-align: center;
    padding: var(--space-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    color: var(--text-color);
}

.timer-display {
    margin: var(--space-2xl) 0;
}

.timer-time {
    font-size: 4rem;
    font-weight: 300;
    font-family: 'Courier New', monospace;
    color: var(--accent-color);
    margin-bottom: var(--space-lg);
}

.breathing-circle {
    width: 200px;
    height: 200px;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    margin: 0 auto var(--space-xl);
    position: relative;
    transition: transform 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.circle-label {
    font-size: 1rem;
    color: var(--text-muted);
    font-style: italic;
    pointer-events: none;
    user-select: none;
}

.breathing-circle.inhale {
    transform: scale(1.2);
}

.breathing-circle.exhale {
    transform: scale(0.8);
}

.breathing-text {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: var(--space-lg);
    min-height: 1.5rem;
}

.timer-controls {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: var(--space-xl);
    flex-shrink: 0;
}

.start-btn {
    padding: var(--space-lg) var(--space-2xl);
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.start-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.stop-btn {
    padding: var(--space-md) var(--space-lg);
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.stop-btn:hover {
    border-color: var(--error-color);
    color: var(--error-color);
}

.completion-message {
    display: none;
    background: var(--card-bg);
    border: 1px solid var(--accent-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    text-align: center;
}

.completion-message h3 {
    color: var(--accent-color);
    margin-bottom: var(--space-sm);
}

@media (max-width: 768px) {
    .timer-container {
        padding: var(--space-md);
        padding-top: 72px;
        padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
        gap: 0;
    }

    .timer-header {
        margin-bottom: var(--space-md);
    }

    .timer-display {
        margin: var(--space-sm) 0;
    }

    .timer-time {
        font-size: 2.5rem;
        margin-bottom: var(--space-sm);
    }

    .breathing-circle {
        width: 160px;
        height: 160px;
    }

    .duration-selector {
        margin-bottom: var(--space-sm);
    }

    .duration-buttons {
        gap: var(--space-xs);
        margin-bottom: var(--space-xs);
    }

    .custom-duration {
        margin-top: var(--space-xs);
    }

    .method-btn {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .duration-btn {
        padding: 12px 14px;
        font-size: 0.9rem;
    }
}

@media (display-mode: standalone) {
    .timer-container {
        padding-top: calc(72px + env(safe-area-inset-top, 0px));
    }
}

/* Method selector */
.method-selector {
    margin-bottom: var(--space-lg);
}
.method-buttons {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    justify-content: center;
}
.method-btn {
    padding: 10px 18px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}
.method-btn:hover {
    border-color: var(--accent-color);
}
.method-btn.selected {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Hide elements when timer is running */
.timer-running .duration-selector,
.timer-running .method-selector {
    display: none;
}

.timer-running .timer-display {
    margin: var(--space-xl) 0;
}

/* Mode toggle */
.mode-toggle {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: var(--radius-lg);
    padding: 4px;
    margin-bottom: var(--space-lg);
    width: fit-content;
}
.mode-toggle-btn {
    padding: 8px 20px;
    border-radius: calc(var(--radius-lg) - 2px);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
.mode-toggle-btn.active {
    background: var(--accent-color);
    color: white;
}

/* Guided audio panel */
.guided-panel { display: none; width: 100%; max-width: 500px; }
.guided-panel.visible { display: block; }
.visual-panel.hidden { display: none; }

.technique-buttons, .gduration-buttons {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: var(--space-md);
}
.technique-btn, .gduration-btn {
    padding: 10px 18px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}
.technique-btn:hover, .gduration-btn:hover {
    border-color: var(--accent-color);
}
.technique-btn.selected, .gduration-btn.selected {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.technique-desc {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.88rem;
    margin-bottom: var(--space-lg);
    min-height: 2.5rem;
    line-height: 1.5;
}

.audio-session-title {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
    font-weight: 400;
}

.audio-play-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent-color);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
    transition: all 0.2s ease;
}
.audio-play-btn:hover { opacity: 0.9; transform: scale(1.05); }
.audio-play-btn svg { width: 28px; height: 28px; fill: white; }

.audio-progress-wrap {
    width: 100%;
    margin-bottom: var(--space-sm);
}
.audio-progress-track {
    height: 4px;
    background: rgba(255,255,255,0.12);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
}
.audio-progress-fill {
    height: 100%;
    background: var(--accent-color);
    border-radius: 2px;
    width: 0%;
    transition: width 0.2s linear;
}
.audio-time {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-family: 'Courier New', monospace;
}

.audio-completion {
    display: none;
    color: var(--accent-color);
    font-style: italic;
    margin-top: var(--space-md);
    font-size: 0.95rem;
}
.audio-completion.visible { display: block; }

.audio-buffering {
    display: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
    margin-bottom: var(--space-sm);
}
.audio-buffering.visible { display: block; }

@media (max-width: 768px) {
    .mode-toggle-btn { padding: 8px 14px; font-size: 0.85rem; }
    .technique-btn, .gduration-btn { padding: 10px 14px; font-size: 0.85rem; }
    .audio-play-btn { width: 56px; height: 56px; }
    .audio-play-btn svg { width: 24px; height: 24px; }
}

/* ── FEEDBACK MODAL ── */
.feedback-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.feedback-overlay.open { display: flex; }

.feedback-modal {
  background: var(--surface, #1e2a1e);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 2rem 1.75rem;
  width: min(420px, 90vw);
  color: var(--text-primary, #e8ede8);
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}

.feedback-modal h3 {
  font-size: 1.1rem; font-weight: 500; margin-bottom: 0.35rem;
}

.feedback-modal p {
  font-size: 0.85rem; opacity: 0.6; margin-bottom: 1.5rem;
}

.star-row {
  display: flex; gap: 0.5rem; margin-bottom: 1.25rem;
}

.star-btn {
  background: none; border: none; cursor: pointer;
  font-size: 1.75rem; line-height: 1; padding: 0;
  color: rgba(255,255,255,0.2);
  transition: color 0.15s, transform 0.1s;
}
.star-btn:hover, .star-btn.active { color: #c8a84b; transform: scale(1.15); }

.feedback-textarea {
  width: 100%; min-height: 90px; resize: vertical;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: inherit; font-size: 0.9rem; padding: 0.75rem;
  font-family: inherit; margin-bottom: 1.25rem;
  outline: none;
}
.feedback-textarea:focus { border-color: rgba(255,255,255,0.28); }
.feedback-textarea::placeholder { opacity: 0.35; }

.feedback-actions {
  display: flex; gap: 0.75rem; justify-content: flex-end;
}

.btn-feedback-cancel {
  background: none; border: 1px solid rgba(255,255,255,0.15);
  color: inherit; padding: 0.55rem 1.1rem; border-radius: 100px;
  font-size: 0.875rem; cursor: pointer; font-family: inherit;
  transition: background 0.15s;
}
.btn-feedback-cancel:hover { background: rgba(255,255,255,0.06); }

.btn-feedback-submit {
  background: var(--accent, #6a9e6a); border: none;
  color: white; padding: 0.55rem 1.25rem; border-radius: 100px;
  font-size: 0.875rem; cursor: pointer; font-family: inherit;
  font-weight: 500; transition: opacity 0.15s;
}
.btn-feedback-submit:disabled { opacity: 0.4; cursor: default; }
.btn-feedback-submit:not(:disabled):hover { opacity: 0.85; }

.feedback-thanks {
  text-align: center; padding: 1rem 0 0.5rem;
  font-size: 1rem; opacity: 0.8;
}

/* ── Style block 3: POST-SESSION MOOD OVERLAY ── */
.mood-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1500;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.mood-overlay.visible {
    display: flex;
    opacity: 1;
}
.mood-overlay-card {
    text-align: center;
    padding: 2rem 2.5rem;
    max-width: 360px;
    width: 90vw;
}
.mood-overlay-card h3 {
    font-family: var(--font-accent);
    font-weight: 300;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}
.mood-pills {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 1.25rem;
}
.mood-pill {
    padding: 10px 22px;
    border: 1px solid var(--accent-color);
    background: transparent;
    color: var(--accent-color);
    border-radius: 100px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-body);
}
.mood-pill:hover {
    background: var(--accent-color);
    color: #fff;
}
.mood-skip {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.82rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    font-family: var(--font-body);
}
.mood-skip:hover {
    opacity: 1;
}
.mood-thanks {
    display: none;
    color: var(--accent-color);
    font-style: italic;
    font-size: 1rem;
}
