/* ═══════════════════════════════════════════════════════════════════════
   Todo Page — Cyberpunk Kanban Board
   ═══════════════════════════════════════════════════════════════════════ */

.todo-page {
    display: grid;
    gap: 20px;
}

/* ── Toolbar ─────────────────────────────────────────────────────────── */

.todo-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Add Form ─────────────────────────────────────────────────────────── */

.todo-form {
    background: var(--surface-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: grid;
    gap: 14px;
    animation: fadeIn 0.2s ease both;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.todo-form__field {
    display: grid;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.todo-form__field input,
.todo-form__field textarea {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-bright);
    outline: none;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.todo-form__field input:focus,
.todo-form__field textarea:focus {
    border-color: rgba(244, 114, 182, 0.5);
    box-shadow: 0 0 0 2px rgba(244, 114, 182, 0.1);
}

.todo-form__actions {
    display: flex;
    justify-content: flex-end;
}

/* ── Error / Loading ─────────────────────────────────────────────────── */

.todo-error {
    margin: 0;
    color: #f9b6b1;
    border: 1px solid rgba(249, 182, 177, 0.4);
    border-radius: 12px;
    padding: 12px;
    background: rgba(249, 182, 177, 0.08);
    font-size: 13px;
}

.todo-loading {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

/* ── Board ───────────────────────────────────────────────────────────── */

.todo-board {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

/* ── Column ──────────────────────────────────────────────────────────── */

.todo-col {
    background: rgba(10, 18, 45, 0.6);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 200px;
    transition: border-color 0.2s ease, background 0.2s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.todo-col.is-drag-over {
    border-color: rgba(244, 114, 182, 0.4);
    background: rgba(244, 114, 182, 0.04);
}

.todo-col__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--line);
}

.todo-col__title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-bright);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.todo-col__count {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(244, 114, 182, 0.12);
    border: 1px solid rgba(244, 114, 182, 0.25);
    color: #f472b6;
    font-weight: 600;
}

.todo-col__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    flex: 1;
}

.todo-col__empty {
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    padding: 20px 0;
    opacity: 0.5;
}

/* ── Card ────────────────────────────────────────────────────────────── */

.todo-card {
    background: var(--surface-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 14px;
    display: grid;
    gap: 8px;
    cursor: grab;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        opacity 0.2s ease,
        box-shadow 0.2s ease;
    box-shadow: var(--shadow-card);
}

.todo-card:hover {
    border-color: rgba(244, 114, 182, 0.25);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.todo-card.is-dragging {
    opacity: 0.4;
    cursor: grabbing;
}

.todo-card__title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-bright);
    line-height: 1.4;
}

.todo-card__desc {
    margin: 0;
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.todo-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
}

.todo-card__date {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.todo-card__actions {
    display: flex;
    gap: 4px;
}

.todo-card__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-dim);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    padding: 0;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}

.todo-card__btn:hover {
    background: rgba(244, 114, 182, 0.15);
    border-color: rgba(244, 114, 182, 0.4);
    color: #f472b6;
}

.todo-card__btn--danger:hover {
    background: rgba(249, 182, 177, 0.15);
    border-color: rgba(249, 182, 177, 0.4);
    color: #f9b6b1;
}

/* ── Done Panel ──────────────────────────────────────────────────────── */

.todo-done-panel {
    background: rgba(10, 18, 45, 0.6);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: border-color 0.2s ease, background 0.2s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.todo-done-panel.is-drag-over {
    border-color: rgba(244, 114, 182, 0.4);
    background: rgba(244, 114, 182, 0.04);
}

.todo-done-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}

.todo-done-panel__title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.todo-done-panel__total-hint {
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.6;
}

.todo-done-panel__clear-btn {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease;
    min-height: 32px;
}

.todo-done-panel__clear-btn:active {
    background: rgba(239, 68, 68, 0.2);
}

/* ── 날짜 필터 ────────────────────────────────────────────────────────── */

.todo-done-panel__filter {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
    justify-content: flex-end;
}

.todo-date-btn {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.6;
    -webkit-tap-highlight-color: transparent;
}

.todo-date-btn:hover {
    background: rgba(244, 114, 182, 0.1);
    border-color: rgba(244, 114, 182, 0.3);
    color: #f472b6;
}

.todo-date-btn.is-active {
    background: rgba(244, 114, 182, 0.18);
    border-color: rgba(244, 114, 182, 0.5);
    color: #f472b6;
    font-weight: 600;
}

.todo-date-input {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s ease;
    height: 26px;
}

.todo-date-input:focus {
    border-color: rgba(244, 114, 182, 0.4);
    color: var(--text-bright);
}

/* 완료 패널 카드 그리드 */
.todo-done-panel__body {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    padding: 12px;
}

.todo-done-panel__body .todo-col__empty {
    grid-column: 1 / -1;
}

.todo-done-panel__body .todo-card {
    opacity: 0.75;
}

.todo-done-panel__body .todo-card:hover {
    opacity: 1;
}

.todo-done-panel__body .todo-card__title {
    text-decoration: line-through;
    text-decoration-color: rgba(244, 114, 182, 0.4);
}

/* ── 스와이프 보드 (모바일 전용) ──────────────────────────────────────── */

.todo-swipe-board {
    display: none;
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .todo-board {
        display: none;
    }

    .todo-swipe-board {
        display: block;
    }

    .todo-toolbar {
        display: none;
    }

    .todo-col {
        min-height: 120px;
        border: none;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .todo-col__head {
        padding: 10px 4px;
        border-bottom: none;
    }

    .todo-col__body {
        padding: 4px 0;
    }

    /* 카드 버튼 44px 터치 타겟 */
    .todo-card__btn {
        width: 44px;
        height: 44px;
        font-size: 14px;
        border-radius: 10px;
    }

    .todo-card__actions {
        gap: 6px;
    }

    .todo-card__title {
        font-size: 15px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* 날짜 필터 버튼 44px 터치 타겟 */
    .todo-date-btn {
        font-size: 12px;
        padding: 8px 14px;
        min-height: 36px;
    }

    .todo-date-input {
        font-size: 13px;
        padding: 8px 12px;
        height: 36px;
        min-height: 36px;
    }

    .todo-done-panel {
        border: none;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .todo-done-panel__head {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 10px 4px;
        border-bottom: none;
    }

    .todo-done-panel__filter {
        justify-content: flex-start;
        gap: 8px;
    }

    .todo-done-panel__body {
        grid-template-columns: 1fr;
        padding: 4px 0;
    }

    /* 폼 라벨 가독성 */
    .todo-form__field {
        font-size: 14px;
        gap: 8px;
    }

    .todo-form__field input,
    .todo-form__field textarea {
        font-size: 16px;
        padding: 12px 14px;
    }

    .todo-form__actions .button {
        width: 100%;
        min-height: 48px;
        font-size: 15px;
    }

    /* 빈 상태 메시지 */
    .todo-col__empty {
        font-size: 13px;
        padding: 32px 16px;
    }

    /* 라벨 버튼 (모바일) */
    .todo-card__btn--labeled {
        width: auto;
        height: 38px;
        padding: 0 12px;
        gap: 4px;
        font-size: 12px;
    }

    .todo-card__btn-label {
        font-size: 11px;
        font-weight: 500;
    }

    .todo-card__actions {
        flex-wrap: wrap;
    }
}

/* ── 확인 시트 (모바일) ─────────────────────────────────────────────── */

.todo-confirm-sheet {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 8px 0;
}

.todo-confirm-sheet__msg {
    margin: 0;
    font-size: 15px;
    color: var(--text);
    line-height: 1.6;
    text-align: center;
}

.todo-confirm-sheet__actions {
    display: flex;
    gap: 10px;
}

.todo-confirm-sheet__actions .button {
    flex: 1;
    min-height: 48px;
    font-size: 15px;
    justify-content: center;
}

.button.danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.button.danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

@media (max-width: 480px) {
    .todo-toolbar {
        flex-direction: column;
    }

    .todo-toolbar .button {
        width: 100%;
        justify-content: center;
    }
}
