/* --- Core Reset & Variables --- */
:root {
    --bg: #0f172a;
    --surface: #1e293b;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #6366f1;
    --border: rgba(255, 255, 255, 0.08);
    --radius: 16px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; }

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    font-family: var(--font);
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

/* --- Layout & Typography --- */
header {
    text-align: center;
    padding: 24px 16px;
    margin-bottom: 16px;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.card {
    width: 100%;
    max-width: 480px;
    padding: 24px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    margin: 0 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.hint-text {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* --- Mood Selection --- */
.mood-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.mood-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
}

.mood-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
}

.mood-card:active {
    transform: scale(0.97);
}

.mood-card.selected {
    border-color: currentColor;
    background: rgba(255, 255, 255, 0.08);
}

.mood-emoji { font-size: 1.75rem; }
.mood-label { font-size: 0.95rem; font-weight: 500; color: var(--text); }

/* --- Inputs --- */
.intention-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    resize: none;
    transition: border-color 0.2s;
}

.intention-input:focus {
    border-color: var(--accent);
}

.btn-row {
    display: flex;
    gap: 12px;
}

/* --- Buttons --- */
.btn {
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    flex: 1;
}

.btn:focus-visible {
    outline: 2px solid #818cf8;
    outline-offset: 2px;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover { background: #4f46e5; }
.btn-primary:active { transform: scale(0.97); }

.btn-default {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.btn-default:hover { background: rgba(255, 255, 255, 0.14); }

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

.btn-outline:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

/* --- Confirmation --- */
.summary-card {
    background: rgba(255, 255, 255, 0.03);
    border-left-width: 3px;
    padding: 20px;
    border-radius: 0 12px 12px 0;
    display: flex;
    gap: 16px;
    align-items: center;
    position: relative;
}

.summary-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 8px currentColor);
}

.summary-text { flex: 1; }
.summary-mood { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; margin-bottom: 4px; opacity: 0.9; }
.summary-intention { font-size: 1.05rem; font-weight: 500; line-height: 1.4; }

.breathing-dot {
    width: 12px; height: 12px;
    background: currentColor;
    border-radius: 50%;
    position: absolute; right: 20px; top: 50%; transform: translateY(-50%) scale(1);
    opacity: 0.3;
}

/* --- History --- */
.history-list {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 12px;
    padding: 4px 0;
}

.history-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 14px;
    border-radius: 10px;
}

.history-mood {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

.history-time {
    font-size: 0.75rem;
    opacity: 0.5;
    margin-left: 8px;
}

.history-text {
    margin-top: 6px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.empty-state {
    text-align: center; color: var(--text-muted);
    font-style: italic; padding: 24px 0;
}

/* --- Pause Overlay --- */
#pause-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}

#pause-overlay[style*="flex"] { opacity: 1; pointer-events: auto; }

.pause-content {
    text-align: center; color: #fff;
}

.pause-content h2 { margin: 0 0 8px; font-size: 1.5rem; }
.pause-content p { margin: 0; opacity: 0.8; }

/* --- Responsive Tweaks --- */
@media (max-width: 360px) {
    .mood-grid { grid-template-columns: 1fr; }
    .btn-row { flex-direction: column; }
    .btn-default { flex: 1; }
}
