/* Jaja Data — custom styles atop Tailwind CDN */

:root {
    --brand-50:  #eff6ff;
    --brand-100: #dbeafe;
    --brand-500: #3b82f6;
    --brand-600: #2563eb;
    --brand-700: #1d4ed8;
    --brand-900: #1e3a8a;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100,116,139,.4); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100,116,139,.7); }

/* Sidebar */
.dc-sidebar a.active {
    background: linear-gradient(90deg, rgba(37,99,235,.18), rgba(37,99,235,0));
    color: #fff;
    border-left: 3px solid var(--brand-500);
}

/* Card hover */
.dc-card { transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.dc-card:hover { transform: translateY(-2px); box-shadow: 0 10px 25px -10px rgba(0,0,0,.25); }

/* Brand gradient text */
.dc-brand {
    background: linear-gradient(90deg, #60a5fa, #22d3ee);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Toast container */
#toasts {
    position: fixed; top: 1rem; right: 1rem; z-index: 9999;
    display: flex; flex-direction: column; gap: .5rem; max-width: 22rem;
}
.toast {
    background: #0f172a; color: #fff; border-radius: .5rem; padding: .75rem 1rem;
    box-shadow: 0 8px 30px rgba(0,0,0,.25); border-left: 4px solid var(--brand-500);
    opacity: 0; transform: translateY(-8px); transition: all .25s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-left-color: #10b981; }
.toast.error   { border-left-color: #ef4444; }
.toast.warn    { border-left-color: #f59e0b; }

/* Quill rich content view */
.dc-prose { line-height: 1.7; }
.dc-prose h1 { font-size: 1.5rem; font-weight: 700; margin: 1rem 0 .5rem; }
.dc-prose h2 { font-size: 1.25rem; font-weight: 700; margin: 1rem 0 .5rem; }
.dc-prose h3 { font-size: 1.125rem; font-weight: 600; margin: .75rem 0 .5rem; }
.dc-prose p  { margin: .5rem 0; }
.dc-prose ul,.dc-prose ol { margin: .5rem 0 .5rem 1.5rem; }
.dc-prose li { margin: .25rem 0; }
.dc-prose a  { color: var(--brand-500); text-decoration: underline; }
.dc-prose code { background: rgba(100,116,139,.2); padding: .1rem .3rem; border-radius: .25rem; font-family: ui-monospace,SFMono-Regular,Menlo,monospace; }
.dc-prose pre { background: #0f172a; color: #f1f5f9; padding: .75rem 1rem; border-radius: .5rem; overflow-x: auto; }
.dc-prose blockquote { border-left: 4px solid var(--brand-500); padding: .25rem .75rem; color: #475569; margin: .5rem 0; }
.dark .dc-prose blockquote { color: #cbd5e1; }
.dc-prose img { max-width: 100%; border-radius: .5rem; margin: .5rem 0; }

/* Method card */
.method-card {
    border: 1px solid rgba(148,163,184,.25);
    border-radius: .75rem;
    overflow: hidden;
    background: rgba(255,255,255,.6);
    backdrop-filter: blur(6px);
}
.dark .method-card { background: rgba(15,23,42,.6); border-color: rgba(148,163,184,.18); }

/* Progress */
.progress { height: 8px; background: rgba(148,163,184,.25); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg,#60a5fa,#22d3ee); transition: width .3s; }

/* Tab bar */
.dc-tab.active {
    color: var(--brand-600);
    border-bottom: 2px solid var(--brand-600);
}

/* === Buttons === */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    height: 2.25rem; padding: 0 .85rem; border-radius: .5rem; font-size: .875rem; font-weight: 500;
    line-height: 1; transition: all .15s ease; cursor: pointer; border: 1px solid transparent;
    white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm  { height: 2rem; padding: 0 .65rem; font-size: .8125rem; }
.btn-lg  { height: 2.625rem; padding: 0 1.25rem; font-size: .95rem; }
.btn-primary  { background: linear-gradient(90deg, #2563eb, #06b6d4); color: #fff; }
.btn-primary:hover  { filter: brightness(1.05); box-shadow: 0 6px 20px -10px rgba(37,99,235,.7); }
.btn-success  { background: #10b981; color: #fff; }
.btn-success:hover { background: #059669; }
.btn-secondary{ background: #e2e8f0; color: #334155; }
.dark .btn-secondary { background: #1e293b; color: #e2e8f0; }
.btn-secondary:hover { background: #cbd5e1; }
.dark .btn-secondary:hover { background: #334155; }
.btn-danger   { background: #f43f5e; color: #fff; }
.btn-danger:hover { background: #e11d48; }
.btn-ghost    { background: transparent; color: #475569; border-color: rgba(148,163,184,.4); }
.dark .btn-ghost { color: #cbd5e1; border-color: rgba(148,163,184,.25); }
.btn-ghost:hover { background: rgba(148,163,184,.15); }

/* === Icon-only action buttons (table rows) === */
.ui-action-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; border-radius: .5rem; transition: all .15s ease;
    border: 1px solid transparent;
}
.btn-ghost-blue  { color: #2563eb; }
.btn-ghost-blue:hover  { background: rgba(37,99,235,.12); }
.btn-ghost-amber { color: #d97706; }
.btn-ghost-amber:hover { background: rgba(245,158,11,.15); }
.btn-ghost-red   { color: #e11d48; }
.btn-ghost-red:hover   { background: rgba(244,63,94,.12); }
.btn-ghost-emerald { color: #059669; }
.btn-ghost-emerald:hover { background: rgba(16,185,129,.15); }
.btn-ghost-slate { color: #64748b; }
.dark .btn-ghost-slate { color: #94a3b8; }
.btn-ghost-slate:hover { background: rgba(100,116,139,.15); }

/* === Form inputs (consistent height) === */
.form-input, .form-select, .form-textarea {
    width: 100%; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: .5rem;
    padding: .55rem .75rem; font-size: .875rem;
    transition: border-color .15s, box-shadow .15s;
}
.dark .form-input, .dark .form-select, .dark .form-textarea {
    background: #1e293b; border-color: #334155; color: #f1f5f9;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

/* === Tables === */
.dc-table { width: 100%; font-size: .875rem; }
.dc-table thead { background: #f8fafc; color: #64748b; }
.dark .dc-table thead { background: rgba(30,41,59,.5); color: #cbd5e1; }
.dc-table th { padding: .65rem .75rem; font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; }
.dc-table td { padding: .65rem .75rem; vertical-align: middle; }
.dc-table tbody tr { border-top: 1px solid rgba(226,232,240,.7); }
.dark .dc-table tbody tr { border-top-color: rgba(51,65,85,.5); }
.dc-table tbody tr:hover { background: rgba(241,245,249,.5); }
.dark .dc-table tbody tr:hover { background: rgba(30,41,59,.4); }

/* === Icon picker === */
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: .5rem; }
.icon-pick {
    display: flex; align-items: center; justify-content: center; flex-direction: column;
    aspect-ratio: 1/1; border: 2px solid transparent; background: rgba(148,163,184,.08);
    border-radius: .65rem; cursor: pointer; padding: .25rem; gap: .15rem;
    transition: all .15s;
}
.icon-pick:hover { background: rgba(59,130,246,.1); }
.icon-pick.active { border-color: var(--brand-500); background: rgba(59,130,246,.12); color: var(--brand-700); }
.icon-pick svg { width: 22px; height: 22px; }
.icon-pick small { font-size: .55rem; opacity: .65; text-align: center; line-height: 1; }

/* Chart wrapper - prevents canvas from growing infinitely */
.chart-wrap { position: relative; width: 100%; height: 280px; }
@media (max-width: 768px) { .chart-wrap { height: 220px; } }

/* Method card icon */
.method-icon {
    width: 44px; height: 44px; border-radius: .75rem; display: grid; place-content: center;
    color: #fff; flex-shrink: 0;
    background: linear-gradient(135deg, var(--brand-500), #06b6d4);
    box-shadow: 0 4px 14px -6px rgba(37,99,235,.55);
}
.method-icon svg { width: 22px; height: 22px; }
