/* ---- Theme tokens ---- */
:root {
    --brand-1: #6366f1;
    --brand-2: #8b5cf6;
    --brand-3: #ec4899;
    --success: #10b981;
    --success-soft: #d1fae5;
    --danger: #ef4444;
    --danger-soft: #fee2e2;
    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #64748b;
    --paper: #ffffff;
    --page: #f8fafc;
    --line: #e2e8f0;

    --radius: 16px;
    --radius-lg: 22px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
    --shadow: 0 6px 24px -6px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 20px 40px -12px rgba(99, 102, 241, 0.25);
}

/* ---- Base ---- */
html, body { height: 100%; }
html { background: var(--page); }
body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: transparent;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
    min-height: 100vh;
    overflow-x: hidden;
}

.app-main { padding-top: 1rem; padding-bottom: 4rem; }

/* ---- Animated background blobs ---- */
.bg-blobs { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.35; }
.blob-1 { top: -120px; left: -80px; width: 380px; height: 380px; background: var(--brand-1); }
.blob-2 { top: 30%; right: -140px; width: 460px; height: 460px; background: var(--brand-3); opacity: 0.22; }
.blob-3 { bottom: -160px; left: 30%; width: 500px; height: 500px; background: var(--brand-2); opacity: 0.22; }

/* ---- Header / brand ---- */
.app-header { position: relative; }
.brand { color: var(--ink); font-weight: 700; font-size: 1.15rem; }
.brand:hover { color: var(--brand-1); }
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 12px;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    color: #fff; font-size: 1.1rem;
    box-shadow: 0 6px 16px -4px rgba(99, 102, 241, 0.5);
}
.brand-text { letter-spacing: -0.02em; }

.btn-nick {
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(10px);
    border: 1px solid var(--line);
    color: var(--ink-2);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-weight: 500;
    transition: all .2s;
}
.btn-nick:hover { background: #fff; border-color: var(--brand-1); color: var(--brand-1); }

/* ---- Glass cards ---- */
.glass-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.75rem;
}

/* ---- Buttons ---- */
.btn { border-radius: 12px; font-weight: 600; letter-spacing: -0.01em; transition: all .18s ease; }
.btn:focus, .btn:active:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25) !important;
    border-color: var(--brand-1) !important;
}
.btn-lg { padding: 0.85rem 1.4rem; }
.btn-primary {
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    border: none; color: #fff;
    box-shadow: 0 8px 20px -8px rgba(99, 102, 241, 0.5);
}
.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff; transform: translateY(-1px);
    box-shadow: 0 12px 24px -8px rgba(99, 102, 241, 0.55);
}
.btn-outline-primary {
    color: var(--brand-1); border: 1.5px solid var(--brand-1); background: transparent;
}
.btn-outline-primary:hover { background: var(--brand-1); color: #fff; }
.btn-soft { background: rgba(99, 102, 241, 0.08); color: var(--brand-1); border: none; }
.btn-soft:hover { background: rgba(99, 102, 241, 0.16); color: var(--brand-1); }
.btn-ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line); }
.btn-ghost:hover { background: #fff; color: var(--ink); border-color: var(--ink-2); }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); border: none; }
.btn-danger-soft:hover { background: #fecaca; color: #b91c1c; }

/* ---- Form controls ---- */
.form-control, .form-select {
    border-radius: 12px; border: 1.5px solid var(--line);
    padding: 0.7rem 1rem; background: #fff;
}
.form-control-lg { border-radius: 14px; padding: 0.95rem 1.15rem; font-size: 1rem; }

/* ---- Home ---- */
.hero { padding: 1.5rem 0 1rem; }
.hero h1 {
    font-size: clamp(1.85rem, 4vw, 2.6rem);
    font-weight: 800; letter-spacing: -0.035em;
}
.hero .lead { color: var(--muted); font-size: 1.05rem; max-width: 640px; }

.action-card { height: 100%; }
.action-card h3 {
    font-size: 1.05rem; font-weight: 700; margin-bottom: 0.25rem;
    display: flex; align-items: center; gap: .5rem;
}
.action-card .action-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 14px;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    color: #fff; font-size: 1.25rem;
    box-shadow: 0 8px 18px -6px rgba(99,102,241,.5);
}
.action-card p { color: var(--muted); font-size: 0.9rem; margin: 0; }

.section-heading {
    font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em;
    color: var(--ink-2); margin-bottom: 1rem;
    display: flex; align-items: center; gap: .5rem;
}

.org-card {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: var(--radius);
    padding: 1.15rem 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: all .18s ease;
    display: block; text-decoration: none;
    color: var(--ink); height: 100%;
}
.org-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    color: var(--ink);
    border-color: rgba(99,102,241,0.35);
}
.org-card .org-name { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.015em; margin-bottom: 0.35rem; }
.org-card .org-meta { color: var(--muted); font-size: .8rem; margin-bottom: .75rem; }
.pill {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: 0.28rem 0.7rem; border-radius: 999px;
    font-size: .78rem; font-weight: 600;
}
.pill-total { background: rgba(99,102,241,.1); color: var(--brand-1); }
.pill-remaining { background: var(--danger-soft); color: var(--danger); }
.pill-done { background: var(--success-soft); color: var(--success); }

/* ---- Detail ---- */
.detail-header {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
    flex-wrap: wrap; margin-bottom: 1rem;
}
.detail-title {
    font-size: clamp(1.5rem, 4vw, 2.15rem);
    font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; margin: 0;
}
.detail-title .sub {
    display: block; font-size: 0.9rem; color: var(--muted); font-weight: 500;
    letter-spacing: 0; margin-top: 0.15rem;
}

.back-link {
    display: inline-flex; align-items: center; gap: .35rem;
    color: var(--muted); text-decoration: none;
    font-weight: 500; font-size: .9rem;
    padding: .35rem .75rem; border-radius: 999px;
    transition: all .15s;
}
.back-link:hover { color: var(--brand-1); background: rgba(99,102,241,.08); }

/* Sayaç kartları */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem;
    margin-bottom: 1rem;
}
.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column; gap: .15rem;
    min-width: 0;
}
.stat-card .stat-label { font-size: .75rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; }
.stat-card.stat-total .stat-value { color: var(--brand-1); }
.stat-card.stat-done  .stat-value { color: var(--success); }
.stat-card.stat-remaining .stat-value { color: var(--danger); }
@media (max-width: 480px) {
    .stat-card { padding: .7rem .8rem; }
    .stat-card .stat-value { font-size: 1.4rem; }
    .stat-card .stat-label { font-size: .68rem; }
}

.progress-track { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 1.25rem; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--brand-1), var(--brand-3)); border-radius: 999px; transition: width .35s ease; }

/* Add form */
.add-form {
    border-radius: var(--radius);
    padding: .5rem .5rem .5rem 1rem;
    display: flex; align-items: center; gap: .5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    margin-bottom: 1.25rem;
    position: sticky; top: 12px; z-index: 5;
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.92);
}
.add-form input.form-control {
    border: none; padding: .8rem 0; background: transparent; box-shadow: none !important;
    font-size: 1rem;
}
.add-form input.form-control:focus { border: none !important; box-shadow: none !important; }
.add-form .btn-add {
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    color: #fff; border: none; border-radius: 12px;
    padding: .7rem 1.1rem; font-weight: 600; flex-shrink: 0;
    box-shadow: 0 6px 16px -6px rgba(99,102,241,.5);
}
.add-form .btn-add:hover { transform: translateY(-1px); }

.toolbar-row {
    display: flex; align-items: center; gap: .5rem;
    flex-wrap: wrap; margin-bottom: 1rem;
}

/* Task list */
.task-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; }

.task-item {
    background: #fff; border-radius: 12px;
    padding: .45rem .7rem;
    display: flex; flex-direction: column; gap: .2rem;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    transition: background-color .2s ease, border-color .2s ease, opacity .2s ease, transform .2s ease;
    animation: taskIn .28s ease;
}
@keyframes taskIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.task-item.task-pending {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.06), rgba(239, 68, 68, 0.02));
    border-color: rgba(239, 68, 68, 0.18);
}
.task-item.task-done {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.02));
    border-color: rgba(16, 185, 129, 0.22);
}
.task-item .task-row { display: flex; align-items: center; gap: .55rem; }

.task-check {
    appearance: none; -webkit-appearance: none;
    width: 20px; height: 20px;
    border: 2px solid var(--muted);
    border-radius: 6px;
    cursor: pointer; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; transition: all .15s;
    position: relative;
}
.task-check:hover { border-color: var(--brand-1); }
.task-check:checked {
    background: linear-gradient(135deg, var(--success), #059669);
    border-color: transparent;
}
.task-check:checked::after {
    content: '';
    width: 10px; height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translate(1px, -1px);
}
.task-check:focus-visible { outline: 2px solid var(--brand-1); outline-offset: 2px; }

.task-name {
    flex-grow: 1; font-size: .92rem; font-weight: 500; color: var(--ink);
    word-break: break-word; min-width: 0; line-height: 1.25;
}
.task-item.task-done .task-name {
    text-decoration: line-through; color: var(--muted); font-weight: 400;
}

.task-actions { display: flex; gap: .25rem; flex-shrink: 0; }
.task-actions .icon-btn {
    width: 28px; height: 28px; border-radius: 8px; border: none;
    background: rgba(15, 23, 42, 0.05);
    color: var(--ink-2);
    display: inline-flex; align-items: center; justify-content: center;
    transition: all .15s; font-size: .85rem;
}
.task-actions .icon-btn:hover { background: rgba(15, 23, 42, 0.1); color: var(--ink); }
.task-actions .icon-btn.btn-delete:hover { background: var(--danger-soft); color: var(--danger); }

.task-meta { color: var(--muted); font-size: .72rem; padding-left: 29px; line-height: 1.2; }
.task-meta strong { color: var(--ink-2); font-weight: 600; }
.task-meta .sep { margin: 0 .3rem; opacity: .5; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state i { font-size: 3rem; opacity: .4; display: block; margin-bottom: .75rem; }

/* Share button + dropdown */
.share-btn {
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    color: #fff; border: none;
    border-radius: 999px;
    padding: .55rem 1.1rem;
    font-weight: 600;
    display: inline-flex; align-items: center; gap: .4rem;
    box-shadow: 0 8px 20px -8px rgba(99,102,241,.55);
    transition: all .15s;
}
.share-btn:hover { transform: translateY(-1px); color: #fff; box-shadow: 0 12px 22px -8px rgba(99,102,241,.6); }
.share-btn.copied {
    background: linear-gradient(135deg, var(--success), #059669);
    box-shadow: 0 8px 20px -8px rgba(16,185,129,.55);
}
.share-menu {
    border-radius: var(--radius);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: .5rem; min-width: 240px;
}
.share-menu .dropdown-item {
    border-radius: 10px; padding: .55rem .7rem;
    display: flex; align-items: center; gap: .65rem;
    font-weight: 500; color: var(--ink);
}
.share-menu .dropdown-item:hover { background: rgba(99,102,241,.08); color: var(--brand-1); }
.share-menu .dropdown-item .share-icon {
    width: 26px; height: 26px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: .9rem; flex-shrink: 0;
}
.share-menu .share-wp .share-icon { background: #25D366; }
.share-menu .share-tg .share-icon { background: #229ED9; }
.share-menu .share-mail .share-icon { background: #0ea5e9; }
.share-menu .share-x .share-icon { background: #000; }
.share-menu .share-copy .share-icon { background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); }
.share-menu .share-native .share-icon { background: var(--ink-2); }
.share-menu .share-url {
    font-size: .72rem; color: var(--muted);
    padding: .5rem .7rem; word-break: break-all;
    border-top: 1px solid var(--line); margin-top: .3rem;
}

/* Danger zone */
.danger-zone {
    margin-top: 2.5rem; padding-top: 1.5rem;
    border-top: 1px dashed var(--line);
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: .75rem;
}
.danger-zone .hint { font-size: .8rem; color: var(--muted); }

.modern-modal { border-radius: var(--radius-lg); border: none; box-shadow: var(--shadow-lg); }

@media (max-width: 576px) {
    .glass-card { padding: 1.25rem; border-radius: var(--radius); }
    .add-form { top: 8px; padding: .4rem .4rem .4rem .85rem; }
    .task-item { padding: .45rem .65rem; }
    .task-check { width: 20px; height: 20px; border-radius: 6px; }
    .task-actions .icon-btn { width: 32px; height: 32px; }
    .task-meta { padding-left: 28px; font-size: .68rem; }
    .stat-grid { gap: .5rem; }
}

.task-edit-input {
    flex-grow: 1;
    border: 1.5px solid var(--brand-1);
    border-radius: 10px;
    padding: .5rem .75rem;
    font-size: 1rem;
    outline: none;
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
    min-width: 0;
}
