/* ============================================================
   Dopamine Detox Planner — dopamine-detox.css
   Mobile-first. Scoped to .dd-wrap.
   ============================================================ */

.dd-wrap *, .dd-wrap *::before, .dd-wrap *::after {
    box-sizing: border-box; margin: 0; padding: 0;
}
.dd-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a2e; background: #fff;
    border: 1px solid #e2e8f0; border-radius: 16px;
    overflow: hidden; max-width: 780px; margin: 0 auto;
}

/* ── Header ──────────────────────────────────────────────── */
.dd-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    flex-wrap: wrap; gap: 14px;
    padding: 20px 24px 18px; background: #f0f4ff;
    border-bottom: 1px solid #e2e8f0;
}
.dd-title    { font-size: 20px; font-weight: 700; color: #1a1a2e; margin-bottom: 3px; }
.dd-subtitle { font-size: 13px; color: #64748b; }

/* Step pills */
.dd-step-pills { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.dd-pill {
    padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
    background: #e2e8f0; color: #64748b; cursor: default;
    transition: all .2s;
}
.dd-pill.active  { background: #4f46e5; color: #fff; }
.dd-pill.done    { background: #dcfce7; color: #15803d; }

/* ── Steps ───────────────────────────────────────────────── */
.dd-step { padding: 24px; }
.dd-step-title {
    font-size: 16px; font-weight: 700; color: #1a1a2e;
    margin-bottom: 6px; margin-top: 20px;
}
.dd-step-title:first-child { margin-top: 0; }
.dd-step-sub { font-size: 13px; color: #64748b; margin-bottom: 20px; line-height: 1.6; }

/* ── Level cards ─────────────────────────────────────────── */
.dd-level-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
@media (max-width: 560px) { .dd-level-grid { grid-template-columns: 1fr; } }

.dd-level-card {
    border: 2px solid #e2e8f0; border-radius: 12px; padding: 18px;
    cursor: pointer; transition: all .2s; background: #fff;
}
.dd-level-card:hover   { border-color: #c7d2fe; background: #f8f9ff; }
.dd-level-card.selected {
    border-color: #4f46e5; background: #f0f0ff;
    box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}
.dd-level-card.sel-medium.selected { border-color: #f59e0b; background: #fffbeb; box-shadow: 0 0 0 3px rgba(245,158,11,.12); }
.dd-level-card.sel-hard.selected   { border-color: #ef4444; background: #fff5f5; box-shadow: 0 0 0 3px rgba(239,68,68,.12); }

.dd-level-icon {
    width: 44px; height: 44px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 12px;
}
.dd-icon-soft   { background: #e0e7ff; color: #4f46e5; }
.dd-icon-medium { background: #fef3c7; color: #d97706; }
.dd-icon-hard   { background: #fee2e2; color: #dc2626; }

.dd-level-name { font-size: 16px; font-weight: 700; color: #1a1a2e; margin-bottom: 6px; }
.dd-level-desc { font-size: 12.5px; color: #64748b; margin-bottom: 12px; line-height: 1.5; }
.dd-level-cuts { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.dd-level-cuts li { font-size: 12px; color: #475569; padding-left: 14px; position: relative; }
.dd-level-cuts li::before { content: '–'; position: absolute; left: 0; color: #94a3b8; }

/* ── Duration ────────────────────────────────────────────── */
.dd-duration-block { margin-bottom: 24px; }
.dd-duration-grid  { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dd-dur-btn {
    padding: 9px 18px; border: 1.5px solid #e2e8f0; border-radius: 8px;
    background: #fff; font-size: 13.5px; font-weight: 600; color: #475569;
    cursor: pointer; transition: all .15s;
}
.dd-dur-btn:hover  { border-color: #4f46e5; color: #4f46e5; }
.dd-dur-btn.active { background: #4f46e5; border-color: #4f46e5; color: #fff; }

/* ── Buttons ─────────────────────────────────────────────── */
.dd-next-btn {
    width: 100%; padding: 13px; background: #4f46e5; color: #fff;
    border: none; border-radius: 10px; font-size: 15px; font-weight: 700;
    cursor: pointer; margin-top: 8px; transition: opacity .18s;
}
.dd-next-btn:hover { opacity: .87; }
.dd-back-btn {
    padding: 11px 20px; border: 1.5px solid #e2e8f0; border-radius: 10px;
    background: #fff; font-size: 14px; font-weight: 600; color: #64748b;
    cursor: pointer; transition: all .15s;
}
.dd-back-btn:hover { border-color: #94a3b8; }
.dd-nav-row { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.dd-nav-row .dd-next-btn { flex: 1; margin-top: 0; }

/* ── Cuts grid ───────────────────────────────────────────── */
.dd-cuts-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
    margin-bottom: 16px;
}
@media (max-width: 480px) { .dd-cuts-grid { grid-template-columns: 1fr; } }

.dd-cut-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 9px; cursor: pointer; transition: all .15s;
    font-size: 13.5px; color: #334155; background: #fff;
}
.dd-cut-item:hover { border-color: #c7d2fe; background: #f8f9ff; }
.dd-cut-item input[type="checkbox"] { width: 16px; height: 16px; flex-shrink: 0; accent-color: #4f46e5; cursor: pointer; }
.dd-cut-item.checked { border-color: #4f46e5; background: #f0f0ff; }

.dd-custom-add { display: flex; gap: 8px; margin-bottom: 20px; }
.dd-custom-input {
    flex: 1; padding: 9px 14px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 13.5px; outline: none;
    font-family: inherit; transition: border-color .18s;
}
.dd-custom-input:focus { border-color: #4f46e5; }
.dd-add-btn {
    padding: 9px 16px; background: #f1f5f9; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 13px; font-weight: 600; color: #475569;
    cursor: pointer; white-space: nowrap; transition: all .15s;
}
.dd-add-btn:hover { border-color: #4f46e5; color: #4f46e5; }

.dd-screen-time-block { margin-bottom: 20px; }
.dd-prefix-wrap, .dd-suffix-wrap {
    display: flex; align-items: center;
    border: 1.5px solid #e2e8f0; border-radius: 8px;
    overflow: hidden; transition: border-color .18s;
}
.dd-prefix-wrap:focus-within,
.dd-suffix-wrap:focus-within { border-color: #4f46e5; }
.dd-suffix {
    padding: 0 12px; font-size: 13px; font-weight: 600;
    color: #64748b; background: #f1f5f9; height: 42px;
    display: flex; align-items: center; border-left: 1px solid #e2e8f0;
}
.dd-input {
    flex: 1; border: none; background: transparent;
    padding: 0 12px; height: 42px; font-size: 14px;
    color: #1a1a2e; outline: none; font-family: inherit;
    -moz-appearance: textfield;
}
.dd-input::-webkit-outer-spin-button,
.dd-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.dd-input-full {
    width: 100%; padding: 10px 14px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 13.5px; outline: none;
    font-family: inherit; transition: border-color .18s; height: auto;
    background: #fff;
}
.dd-input-full:focus { border-color: #4f46e5; }

/* ── Activity chips ──────────────────────────────────────── */
.dd-activities-categories { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.dd-act-group-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: #94a3b8; margin-bottom: 8px;
}
.dd-act-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dd-chip {
    padding: 7px 14px; border: 1.5px solid #e2e8f0; border-radius: 20px;
    background: #fff; font-size: 13px; color: #475569;
    cursor: pointer; transition: all .15s;
}
.dd-chip:hover  { border-color: #a5b4fc; color: #4f46e5; }
.dd-chip.active { background: #4f46e5; border-color: #4f46e5; color: #fff; }

.dd-selected-acts { margin-bottom: 20px; }
.dd-selected-label {
    font-size: 13px; font-weight: 600; color: #475569;
    padding: 10px 0 6px;
}
.dd-selected-label span { color: #4f46e5; }

/* ── Tracker ─────────────────────────────────────────────── */
.dd-tracker-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.dd-tracker-title { font-size: 17px; font-weight: 700; color: #1a1a2e; margin-bottom: 3px; }
.dd-tracker-dates { font-size: 12.5px; color: #64748b; }
.dd-streak-badge {
    display: flex; flex-direction: column; align-items: center;
    background: #f0f0ff; border-radius: 12px; padding: 10px 16px;
    min-width: 80px; flex-shrink: 0;
}
.dd-streak-badge span:first-child { font-size: 28px; font-weight: 800; color: #4f46e5; line-height: 1; }
.dd-streak-label { font-size: 11px; font-weight: 600; color: #6366f1; text-transform: uppercase; letter-spacing: .05em; margin-top: 3px; }

.dd-progress-track { height: 8px; background: #e2e8f0; border-radius: 6px; overflow: hidden; margin-bottom: 6px; }
.dd-progress-fill  { height: 100%; background: #4f46e5; border-radius: 6px; transition: width .5s ease; }
.dd-progress-text  { font-size: 12px; color: #64748b; margin-bottom: 18px; }

/* Calendar */
.dd-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 20px; }
.dd-cal-day {
    aspect-ratio: 1; border-radius: 8px; display: flex; align-items: center;
    justify-content: center; font-size: 12px; font-weight: 600;
    border: 1.5px solid #e2e8f0; cursor: default; position: relative;
    background: #f8fafc; color: #94a3b8;
}
.dd-cal-day.today   { border-color: #4f46e5; color: #4f46e5; background: #f0f0ff; }
.dd-cal-day.clean   { background: #dcfce7; border-color: #86efac; color: #15803d; }
.dd-cal-day.slip    { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.dd-cal-day.future  { opacity: .4; }
.dd-cal-day-num { font-size: 11px; }

/* Today panel */
.dd-today-panel {
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 12px; padding: 18px; margin-bottom: 16px;
}
.dd-today-title { font-size: 14px; font-weight: 700; color: #1a1a2e; margin-bottom: 14px; }
.dd-today-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.dd-log-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px; border-radius: 10px; font-size: 14px; font-weight: 700;
    cursor: pointer; border: 2px solid transparent; transition: all .18s;
}
.dd-log-clean { background: #dcfce7; color: #15803d; border-color: #86efac; }
.dd-log-clean:hover { background: #bbf7d0; }
.dd-log-clean.logged { background: #16a34a; color: #fff; border-color: #16a34a; }
.dd-log-slip  { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.dd-log-slip:hover { background: #fecaca; }
.dd-log-slip.logged { background: #dc2626; color: #fff; border-color: #dc2626; }

.dd-slip-note { background: #fff7ed; border-radius: 9px; padding: 12px; margin-bottom: 14px; }
.dd-slip-msg { font-size: 13px; color: #92400e; font-style: italic; margin-bottom: 8px; }

.dd-boredom-reminder { margin-top: 14px; }
.dd-boredom-title { font-size: 12.5px; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.dd-boredom-list { display: flex; flex-wrap: wrap; gap: 6px; }
.dd-boredom-tag {
    padding: 5px 12px; background: #e0e7ff; border-radius: 20px;
    font-size: 12.5px; color: #3730a3; font-weight: 500;
}

/* Cuts reminder */
.dd-cuts-reminder {
    background: #fff1f2; border: 1px solid #fecdd3;
    border-radius: 12px; padding: 14px; margin-bottom: 16px;
}
.dd-cuts-reminder-title { font-size: 12.5px; font-weight: 700; color: #9f1239; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.dd-cuts-reminder-list { display: flex; flex-wrap: wrap; gap: 6px; }
.dd-cut-tag {
    padding: 4px 11px; background: #ffe4e6; border-radius: 20px;
    font-size: 12px; color: #be123c; font-weight: 500;
}

/* Tracker actions */
.dd-tracker-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dd-action-btn {
    flex: 1; min-width: 120px; padding: 11px 16px; border-radius: 9px;
    font-size: 13.5px; font-weight: 600; cursor: pointer; border: none;
    transition: opacity .18s;
}
.dd-action-btn:hover { opacity: .85; }
.dd-action-pdf   { background: #4f46e5; color: #fff; }
.dd-action-reset { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 480px) {
    .dd-header { padding: 16px; flex-direction: column; }
    .dd-step   { padding: 16px; }
    .dd-title  { font-size: 18px; }
    .dd-today-buttons { grid-template-columns: 1fr; }
    .dd-calendar { grid-template-columns: repeat(7, 1fr); gap: 4px; }
    .dd-cal-day { font-size: 11px; }
}
