/* ═══════════════════════════════════════════
   SHELFCUT BOOST — Brand Aligned Theme
   Colors: #C556FF / #FFFFFF / #FAF9F5 / #050524
   ═══════════════════════════════════════════ */

:root {
    --primary: #C556FF;
    --primary-soft: rgba(197, 86, 255, 0.10);
    --primary-medium: rgba(197, 86, 255, 0.18);
    --primary-glow: rgba(197, 86, 255, 0.35);

    --bg: #FAF9F5;
    --bg-card: #FFFFFF;
    --bg-card-hover: #FFFFFF;
    --header-bg: #050524;

    --text-primary: #1a1a2e;
    --text-secondary: #6b6b80;
    --text-muted: #a0a0b0;
    --text-on-dark: #ffffff;
    --text-on-primary: #ffffff;

    --border: #e8e7e3;
    --border-hover: #d4d3cf;
    --border-accent: rgba(197, 86, 255, 0.25);
    --outline: #000000;

    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.08);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.06);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 100px;

    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Space Mono', monospace;

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Reset ──────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ── Redirect Page ──────────────────────── */
.redirect-page {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--header-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.redirect-page.hidden {
    display: none;
}

.redirect-content {
    text-align: center;
}

.redirect-logo-image {
    width: min(220px, 70vw);
    height: auto;
    display: block;
    margin: 0 auto;
}

.redirect-text {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 12px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ── Confetti ───────────────────────────── */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* ── Header ─────────────────────────────── */
.header {
    background: var(--header-bg);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.header__inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header__logo-link {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.header__logo-image {
    height: 28px;
    width: auto;
    display: block;
}

.header__nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header__progress-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    width: 140px;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar__fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), #e879f9);
    border-radius: 3px;
    transition: width 0.8s var(--ease);
}

.progress-bar__label {
    font-family: var(--font-mono);
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
}

.header__percent {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    min-width: 36px;
    text-align: right;
}

/* ── Main ───────────────────────────────── */
.main {
    max-width: 780px;
    margin: 0 auto;
    padding: 40px 24px 120px;
}

/* ── Hero ────────────────────────────────── */
.hero {
    text-align: center;
    margin-bottom: 48px;
    animation: fadeUp 0.7s var(--ease) both;
}

.hero__badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid var(--border-accent);
    padding: 6px 18px;
    border-radius: var(--radius-pill);
    margin-bottom: 20px;
}

.hero__title {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.hero__text {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 16px auto 0;
    line-height: 1.7;
}

.hero__text strong {
    color: var(--primary);
    font-weight: 700;
}

/* ── Category ───────────────────────────── */
.category {
    margin-bottom: 40px;
    animation: fadeUp 0.7s var(--ease) both;
}

.category:nth-child(1) { animation-delay: 0.05s; }
.category:nth-child(2) { animation-delay: 0.1s; }
.category:nth-child(3) { animation-delay: 0.15s; }

.category__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.category__icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.category__title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    flex: 1;
}

.category__counter {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
}

.category__counter .done-count {
    color: var(--primary);
    font-weight: 700;
}

/* ── Task List ──────────────────────────── */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── Task Card ──────────────────────────── */
.task {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    transition: all 0.35s var(--ease);
    position: relative;
}

.task:hover {
    border-color: var(--border-hover);
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.task__title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.task__description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.task__description a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px dashed var(--border-accent);
    transition: border-color 0.2s;
}

.task__description a:hover {
    border-bottom-style: solid;
}

.task__description strong {
    font-weight: 600;
    color: var(--text-primary);
}

/* ── Buttons ────────────────────────────── */
.task__actions {
    display: flex;
    gap: 8px;
}

.btn {
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 22px;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

/* Primary: #C556FF bg, outline #000 */
.btn--primary {
    background: var(--primary);
    color: var(--text-on-primary);
    border: 1px solid var(--outline);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.btn--primary:hover {
    background: #b840f0;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--primary-glow);
}

.btn--primary:active {
    transform: translateY(0) scale(0.98);
}

/* Secondary: #FFF bg, outline #000 */
.btn--secondary {
    background: #FFFFFF;
    color: var(--text-primary);
    border: 1px solid var(--outline);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.btn--secondary:hover {
    background: #f5f5f5;
    transform: translateY(-1px);
}

/* Skip button (lighter feel) */
.btn--skip {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 10px 18px;
}

.btn--skip:hover {
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
    background: var(--danger-soft);
}

/* Danger modal button */
.btn--danger-modal {
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 10px 22px;
}

.btn--danger-modal:hover {
    background: rgba(239, 68, 68, 0.12);
}

/* ── Task States ────────────────────────── */
.task--completed {
    border-color: rgba(34, 197, 94, 0.2);
    background: linear-gradient(135deg, var(--success-soft), var(--bg-card));
}

.task--completed .task__title {
    color: var(--text-muted);
    text-decoration: line-through;
}

.task--completed .task__description {
    opacity: 0.5;
}

.task--completed .task__actions {
    display: none;
}

.task--completed .task__status {
    display: flex;
}

.task--skipped {
    opacity: 0.45;
    border-color: var(--border);
}

.task--skipped .task__title {
    color: var(--text-muted);
    text-decoration: line-through;
}

.task--skipped .task__description {
    opacity: 0.4;
}

.task--skipped .task__actions {
    display: none;
}

.task--skipped .task__status--skipped {
    display: flex;
}

.task__status,
.task__status--skipped {
    display: none;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 0;
}

.task__status {
    color: var(--success);
}

.task__status--skipped {
    color: var(--text-muted);
}

.task__status-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: popIn 0.4s var(--ease-spring) both;
}

.task__status-check svg {
    width: 12px;
    height: 12px;
}

/* ── Animations on state change ─────────── */
.task--animating-done {
    animation: taskDone 0.5s var(--ease) forwards;
}

@keyframes taskDone {
    0% { transform: scale(1); }
    35% { transform: scale(1.015); box-shadow: 0 0 0 3px var(--primary-glow); }
    100% { transform: scale(1); box-shadow: none; }
}

.task--animating-skip {
    animation: taskSkip 0.35s var(--ease) forwards;
}

@keyframes taskSkip {
    0% { transform: scale(1); }
    50% { transform: scale(0.985); opacity: 0.7; }
    100% { transform: scale(1); }
}

/* ── Ripple ─────────────────────────────── */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(197, 86, 255, 0.25);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to { transform: scale(4); opacity: 0; }
}

/* ── Modal ──────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 36, 0.5);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s var(--ease);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 40px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    transform: scale(0.95) translateY(12px);
    transition: all 0.35s var(--ease-spring);
    box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal__icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.modal__title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.modal__text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
}

.modal__actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ── Celebration ────────────────────────── */
.celebration-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 5, 36, 0.75);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s var(--ease);
}

.celebration-overlay.active {
    opacity: 1;
    visibility: visible;
}

.celebration-content {
    text-align: center;
    transform: scale(0.85);
    transition: transform 0.5s var(--ease-spring);
}

.celebration-overlay.active .celebration-content {
    transform: scale(1);
}

.celebration__emoji {
    font-size: 64px;
    animation: celebBounce 0.8s var(--ease-spring) infinite alternate;
}

.celebration__title {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-on-dark);
    margin-top: 12px;
}

.celebration__text {
    font-size: 15px;
    color: rgba(255,255,255,0.6);
    margin-top: 6px;
}

@keyframes celebBounce {
    from { transform: translateY(0) scale(1); }
    to { transform: translateY(-12px) scale(1.05); }
}

/* ── Undo Toast ─────────────────────────── */
.undo-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--header-bg);
    color: var(--text-on-dark);
    padding: 14px 20px 14px 24px;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 3000;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s var(--ease);
    white-space: nowrap;
}

.undo-toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.undo-toast__text {
    font-size: 14px;
    font-weight: 500;
}

.undo-toast__btn {
    font-family: var(--font);
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    background: transparent;
    border: 1px solid rgba(197, 86, 255, 0.3);
    border-radius: var(--radius-pill);
    padding: 6px 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.undo-toast__btn:hover {
    background: rgba(197, 86, 255, 0.15);
}

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

@keyframes popIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* ── Scrollbar ──────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Responsive ─────────────────────────── */
@media (max-width: 640px) {
    .header__inner {
        padding: 0 16px;
        height: 56px;
    }

    .progress-bar {
        width: 80px;
    }

    .header__percent {
        display: none;
    }

    .main {
        padding: 28px 16px 100px;
    }

    .hero__title {
        font-size: 26px;
    }

    .task {
        padding: 16px 18px;
    }

    .task__actions {
        flex-direction: column;
    }

    .btn {
        justify-content: center;
        width: 100%;
    }

    .modal {
        padding: 28px 24px;
    }

    .modal__actions {
        flex-direction: column;
    }

    .category__header {
        flex-wrap: wrap;
    }

    .category__counter {
        margin-left: auto;
    }
}
