/* ============================================================
   Color Designer — Static CSS (always loaded, no Vite needed)
   ============================================================ */

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

/* ── Body / Theme ────────────────────────────────────────── */
body {
    background-color: #111111;
    color: #e5e5e5;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}
main { flex: 1; }

/* Light mode */
html.light-mode body { background-color: #f5f5f5; color: #1a1a1a; }

/* ── CSS Variables ───────────────────────────────────────── */
:root {
    --accent:       #ff5a1f;
    --accent-hover: #d03801;
    --bg-base:      #111111;
    --bg-surface:   #1a1a1a;
    --bg-raised:    #222222;
    --bg-border:    #2a2a2a;
    --text-base:    #e5e5e5;
    --text-muted:   #888888;
    --text-dim:     #555555;
    --radius-sm:    6px;
    --radius:       10px;
    --radius-lg:    14px;
}
html.light-mode {
    --bg-base:    #f5f5f5;
    --bg-surface: #ffffff;
    --bg-raised:  #f3f4f6;
    --bg-border:  #e5e7eb;
    --text-base:  #1a1a1a;
    --text-muted: #6b7280;
    --text-dim:   #9ca3af;
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #1a1a1a; }
::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Tailwind bg-gray overrides for agent-written views ─── */
.bg-gray-950, [class*="bg-gray-950"] { background-color: #0d0d0d !important; }
.bg-gray-900, [class*="bg-gray-900"] { background-color: #111111 !important; }
.bg-gray-800, [class*="bg-gray-800"] { background-color: #1a1a1a !important; }
.bg-gray-700, [class*="bg-gray-700"] { background-color: #252525 !important; }
.border-gray-800 { border-color: #2a2a2a !important; }
.border-gray-700 { border-color: #333 !important; }
.border-gray-600 { border-color: #444 !important; }
.text-gray-100 { color: #f0f0f0 !important; }
.text-gray-200 { color: #e5e5e5 !important; }
.text-gray-300 { color: #c0c0c0 !important; }
.text-gray-400 { color: #888 !important; }
.text-gray-500 { color: #666 !important; }
.text-gray-600 { color: #555 !important; }
/* violet → orange */
.text-violet-400, .text-violet-500, .text-violet-600 { color: var(--accent) !important; }
.border-violet-500 { border-color: var(--accent) !important; }
.bg-violet-600 { background-color: var(--accent) !important; }
.hover\:bg-violet-700:hover { background-color: var(--accent-hover) !important; }
.focus\:border-violet-500:focus { border-color: var(--accent) !important; }
.focus\:ring-violet-500:focus { --tw-ring-color: var(--accent) !important; }
html.light-mode .bg-gray-950 { background-color: #f0f0f0 !important; }
html.light-mode .bg-gray-900 { background-color: #ffffff !important; }
html.light-mode .bg-gray-800 { background-color: #f3f4f6 !important; }
html.light-mode .border-gray-800 { border-color: #e5e7eb !important; }
html.light-mode .text-gray-300 { color: #374151 !important; }
html.light-mode .text-gray-400 { color: #6b7280 !important; }
html.light-mode .text-gray-500 { color: #9ca3af !important; }
html.light-mode .text-white { color: #111111 !important; }

/* ── Navbar ──────────────────────────────────────────────── */
nav.sticky {
    background-color: rgba(17,17,17,0.97) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #1e1e1e;
    position: sticky;
    top: 0;
    z-index: 50;
}
html.light-mode nav.sticky {
    background-color: rgba(255,255,255,0.97) !important;
    border-bottom-color: #e5e7eb;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius-lg);
    padding: 24px;
}
.card-sm {
    background-color: var(--bg-surface);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius);
    padding: 14px;
}

/* ── Tool Cards ──────────────────────────────────────────── */
.tool-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    display: block;
    text-decoration: none;
    height: 100%;
}
.tool-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255,90,31,0.15);
}
.tool-card > div { height: 100%; }

/* ── Blog Cards ──────────────────────────────────────────── */
.blog-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
}
.blog-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary {
    background-color: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 10px 20px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}
.btn-primary:hover { background-color: var(--accent-hover); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary.w-full { width: 100%; justify-content: center; }

.btn-secondary {
    background-color: var(--bg-raised);
    color: var(--text-base);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius);
    padding: 10px 20px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}
.btn-secondary:hover { background-color: var(--bg-border); border-color: #444; }
.btn-secondary.w-full { width: 100%; justify-content: center; }

/* ── Inputs ──────────────────────────────────────────────── */
.input {
    background-color: var(--bg-raised);
    border: 1px solid var(--bg-border);
    color: var(--text-base);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    width: 100%;
    transition: border-color 0.2s;
    line-height: 1.5;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--text-dim); }
select.input { cursor: pointer; }
textarea.input { resize: vertical; }

/* ── Tabs ────────────────────────────────────────────────── */
.tab-btn {
    padding: 8px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
    background: transparent;
    border: none;
    font-family: inherit;
}
.tab-btn.active { background: var(--accent); color: #fff; }
.tab-btn:hover:not(.active) { color: #fff; background: var(--bg-raised); }

/* ── Code Block ──────────────────────────────────────────── */
.code-block {
    background: #0d0d0d;
    border: 1px solid #2a2a2a;
    border-radius: var(--radius);
    padding: 16px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    color: #a8ff78;
    overflow-x: auto;
    white-space: pre;
    line-height: 1.6;
}

/* ── Copy Button ─────────────────────────────────────────── */
.copy-btn {
    background: transparent;
    border: 1px solid #333;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn.copied { border-color: #22c55e; color: #22c55e; }

/* ── Range Slider ────────────────────────────────────────── */
input[type="range"] {
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #333;
    outline: none;
    width: 100%;
    cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid #111;
    box-shadow: 0 0 6px rgba(255,90,31,0.4);
}
input[type="range"]::-moz-range-thumb {
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--accent); cursor: pointer; border: 2px solid #111;
}

/* ── Toast ───────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    background: #222;
    border: 1px solid #333;
    border-radius: var(--radius);
    padding: 12px 20px;
    color: var(--text-base);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 360px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: #22c55e; }
.toast.error { border-color: #ef4444; }

/* ── FAQ ─────────────────────────────────────────────────── */
.faq-item { border-bottom: 1px solid #2a2a2a; }
.faq-question {
    padding: 16px 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-base);
    font-weight: 500;
    user-select: none;
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
}
.faq-answer.open { max-height: 300px; padding-bottom: 16px; }
.faq-icon { transition: transform 0.3s; color: var(--accent); font-style: normal; }
.faq-item.open .faq-icon { transform: rotate(45deg); }

/* ── Contrast Badges ─────────────────────────────────────── */
.contrast-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    gap: 5px;
}
.contrast-pass { background: rgba(34,197,94,0.15); color: #22c55e; border: 1px solid rgba(34,197,94,0.3); }
.contrast-fail { background: rgba(239,68,68,0.15); color: #ef4444; border: 1px solid rgba(239,68,68,0.3); }

/* ── Pagination ──────────────────────────────────────────── */
.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    border-radius: var(--radius);
    border: 1px solid #333;
    color: var(--text-muted);
    font-size: 14px;
    transition: all 0.2s;
    text-decoration: none;
    padding: 0 10px;
}
.pagination-link:hover { border-color: var(--accent); color: var(--accent); }
.pagination-link.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #666; flex-wrap: wrap; }
.breadcrumb a { color: #888; text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { color: #444; }

/* ── Section headings ────────────────────────────────────── */
.section-title { font-size: 28px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.section-subtitle { font-size: 16px; color: var(--text-muted); margin-bottom: 32px; }
html.light-mode .section-title { color: #111; }

/* ── Gradient text ───────────────────────────────────────── */
.gradient-text {
    background: linear-gradient(135deg, #ff5a1f, #ff8c42, #ffb347);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Glass effect ────────────────────────────────────────── */
.glass {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.08);
}

/* ── Color picker wrapper ────────────────────────────────── */
.color-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #222;
    border: 1px solid #333;
    border-radius: var(--radius);
    padding: 8px 12px;
    transition: border-color 0.2s;
}
.color-input-wrap:focus-within { border-color: var(--accent); }
.color-input-wrap input[type="color"] { width: 36px; height: 36px; border: none; border-radius: var(--radius-sm); cursor: pointer; padding: 2px; background: none; }
.color-input-wrap input[type="text"] { flex: 1; background: transparent; border: none; color: var(--text-base); font-family: 'JetBrains Mono', monospace; font-size: 14px; outline: none; }

/* ── Admin Layout ────────────────────────────────────────── */
.sidebar {
    width: 240px;
    min-height: 100vh;
    background: #0d0d0d;
    border-right: 1px solid #1e1e1e;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 40;
    transition: transform 0.3s;
}
.main-area { margin-left: 240px; min-height: 100vh; background: #111111; display: flex; flex-direction: column; }
.topbar {
    background: #0d0d0d;
    border-bottom: 1px solid #1e1e1e;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 30;
}
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-area { margin-left: 0; }
}

/* Admin sidebar links */
.admin-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: var(--radius);
    color: #999;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}
.admin-sidebar-link:hover, .admin-sidebar-link.active {
    background: rgba(255,90,31,0.1);
    color: var(--accent);
}
.admin-sidebar-link.active { border-left: 3px solid var(--accent); padding-left: 13px; }

/* Admin table */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { padding: 12px 16px; text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: #666; border-bottom: 1px solid #2a2a2a; }
.admin-table td { padding: 14px 16px; border-bottom: 1px solid #1e1e1e; font-size: 14px; color: #ccc; vertical-align: middle; }
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }

/* Stat card */
.stat-card { background: linear-gradient(135deg, #1a1a1a, #222); border: 1px solid #2a2a2a; border-radius: var(--radius-lg); padding: 20px; position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; top: -20px; right: -20px; width: 80px; height: 80px; border-radius: 50%; background: rgba(255,90,31,0.08); }

/* ── Footer ──────────────────────────────────────────────── */
footer { background-color: #0d0d0d; border-top: 1px solid #1e1e1e; margin-top: auto; }
html.light-mode footer { background-color: #f0f0f0; border-top-color: #e5e7eb; }

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.animate-fade-in { animation: fadeIn 0.4s ease forwards; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

/* ── Prose (blog content) ────────────────────────────────── */
.prose { max-width: 65ch; line-height: 1.8; }
.prose h1, .prose h2, .prose h3, .prose h4 { color: #fff; font-weight: 700; margin-top: 1.5em; margin-bottom: 0.5em; line-height: 1.3; }
.prose h2 { font-size: 1.5em; }
.prose h3 { font-size: 1.25em; }
.prose p { margin-bottom: 1em; color: #aaa; }
.prose ul, .prose ol { margin: 1em 0; padding-left: 1.5em; color: #aaa; }
.prose li { margin-bottom: 0.5em; }
.prose strong { color: #e5e5e5; font-weight: 600; }
.prose a { color: var(--accent); }
.prose a:hover { text-decoration: underline; }
.prose code { background: #1a1a1a; border: 1px solid #2a2a2a; padding: 2px 6px; border-radius: 4px; font-size: 0.875em; color: #a8ff78; }
.prose pre { background: #0d0d0d; border: 1px solid #2a2a2a; padding: 16px; border-radius: 8px; overflow-x: auto; margin: 1em 0; }
.prose-invert { color: #aaa; }

/* ── Light mode overrides ────────────────────────────────── */
html.light-mode .card, html.light-mode .card-sm { background-color: #fff; border-color: #e5e7eb; }
html.light-mode .tool-card { background-color: #fff; border-color: #e5e7eb; }
html.light-mode .blog-card { background-color: #fff; border-color: #e5e7eb; }
html.light-mode .input { background-color: #fff; border-color: #d1d5db; color: #1a1a1a; }
html.light-mode .color-input-wrap { background-color: #fff; border-color: #d1d5db; }
html.light-mode .color-input-wrap input[type="text"] { color: #1a1a1a; }
html.light-mode .btn-secondary { background-color: #f3f4f6; border-color: #d1d5db; color: #374151; }
html.light-mode .code-block { background: #f8f9fa; color: #1a7a4a; border-color: #e5e7eb; }
html.light-mode .faq-item { border-color: #e5e7eb; }
html.light-mode .admin-table th { border-color: #e5e7eb; color: #9ca3af; }
html.light-mode .admin-table td { border-color: #f3f4f6; color: #374151; }
html.light-mode ::-webkit-scrollbar-track { background: #f1f1f1; }
html.light-mode .section-title { color: #111; }

/* ── Utility extras ──────────────────────────────────────── */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
