/* ============================================================================
   ColorComboMaker.com — Modern Design System
   ============================================================================ */
:root {
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --surface-2: #F1F5F9;
    --border: #E2E8F0;
    --border-strong: #CBD5E1;

    --text: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;

    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --primary-soft: rgba(37, 99, 235, 0.1);

    --success: #059669;
    --success-soft: rgba(5, 150, 105, 0.12);
    --warning: #D97706;
    --warning-soft: rgba(217, 119, 6, 0.12);
    --danger: #DC2626;
    --danger-soft: rgba(220, 38, 38, 0.12);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.09);
}

[data-theme="dark"] {
    --bg: #0B1120;
    --surface: #111827;
    --surface-2: #1E293B;
    --border: #1F2937;
    --border-strong: #334155;

    --text: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;

    --primary: #3B82F6;
    --primary-hover: #60A5FA;
    --primary-soft: rgba(59, 130, 246, 0.16);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code, pre, .mono {
    font-family: var(--font-mono);
}

.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .site-header {
    background: rgba(17, 24, 39, 0.88);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 76px;
    gap: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    flex-shrink: 0;
}

.brand:hover {
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: 154px;
    height: auto;
    border-radius: 8px;
}

.brand-logo-footer {
    width: 144px;
}

@media (max-width: 660px) {
    .site-header .brand-logo {
        width: 138px;
    }
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
}

.nav-link {
    padding: 7px 11px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
}

.nav-link.is-active {
    background: var(--primary-soft);
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.icon-btn:hover {
    border-color: var(--border-strong);
    color: var(--text);
    background: var(--surface-2);
}

[data-theme="light"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }

.mobile-menu-btn {
    display: none;
}

.mobile-drawer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 12px 20px 18px;
}

.mobile-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.mobile-nav-link {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
}

.mobile-nav-link.is-active {
    background: var(--primary-soft);
    color: var(--primary);
}

@media (max-width: 1100px) {
    .main-nav { display: none; }
    .mobile-menu-btn { display: inline-flex; }
}

@media (width > 1100px) {
    .mobile-drawer { display: none; }
}

/* Main Content */
.site-main {
    flex: 1;
    padding-bottom: 64px;
}

/* Hero & Page Headers */
.hero {
    padding: 44px 0 32px;
    border-bottom: 1px solid var(--border);
    background: radial-gradient(circle at 15% 10%, rgba(59, 130, 246, 0.08), transparent 45%),
                radial-gradient(circle at 85% 20%, rgba(236, 72, 153, 0.08), transparent 45%);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.hero h1, .page-head h1 {
    margin: 0 0 12px;
    font-size: clamp(1.85rem, 3.2vw, 2.75rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
    font-weight: 800;
}

.hero-subtitle, .page-head p {
    margin: 0;
    max-width: 68ch;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.page-head {
    padding: 36px 0 24px;
}

.section {
    padding: 36px 0;
}

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.section-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.section-subtitle {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.94rem;
}

/* Cards & Panels */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}

.card-compact {
    padding: 16px;
}

/* Buttons & Inputs */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover { text-decoration: none; }

.btn-primary {
    background: var(--primary);
    color: #FFFFFF;
}
.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover {
    border-color: var(--border-strong);
}

.btn-sm {
    padding: 6px 11px;
    font-size: 0.82rem;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.input, .select {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 0.92rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus, .select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.input-mono {
    font-family: var(--font-mono);
}

/* Grids */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 960px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Interactive Color Picker */
.picker-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 22px;
    align-items: start;
}

@media (max-width: 880px) {
    .picker-layout { grid-template-columns: 1fr; }
}

.sv-canvas-wrap {
    position: relative;
    width: 100%;
    height: 260px;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: crosshair;
    border: 1px solid var(--border);
    user-select: none;
    touch-action: none;
}

.sv-canvas-wrap canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.sv-cursor {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.35);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.hue-slider-wrap {
    margin-top: 14px;
}

.hue-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 16px;
    border-radius: 999px;
    background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
    outline: none;
    cursor: pointer;
}

.hue-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #0F172A;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.color-preview-banner {
    height: 100px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 14px 16px;
    margin-bottom: 16px;
    transition: background-color 0.12s ease;
}

.code-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
    margin-bottom: 8px;
}

.code-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 52px;
}

.code-value {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 600;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Palette Swatches */
.palette-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.palette-swatches {
    display: flex;
    height: 112px;
}

.palette-swatch {
    flex: 1;
    position: relative;
    cursor: pointer;
    transition: flex 0.18s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 8px;
}

.palette-swatch:hover {
    flex: 1.45;
}

.palette-swatch span {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.65);
    color: #fff;
    opacity: 0;
    transition: opacity 0.15s;
}

.palette-swatch:hover span,
.palette-swatch.always-show span {
    opacity: 1;
}

.palette-meta {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.palette-title {
    font-weight: 700;
    font-size: 0.96rem;
    margin: 0;
}

.palette-tag {
    font-size: 0.74rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-secondary);
}

/* Interactive Generator Strip */
.generator-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--border);
    min-height: 280px;
    box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
    .generator-board {
        grid-template-columns: 1fr;
        min-height: auto;
    }
}

.gen-col {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px 14px;
    min-height: 220px;
    transition: background-color 0.2s ease;
}

@media (max-width: 768px) {
    .gen-col {
        min-height: 92px;
        flex-direction: row;
        align-items: center;
    }
}

.gen-col-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.gen-pill-btn {
    border: none;
    border-radius: 8px;
    padding: 6px 9px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(6px);
    color: inherit;
}

.gen-pill-btn:hover {
    background: rgba(255, 255, 255, 0.36);
}

.gen-hex {
    font-family: var(--font-mono);
    font-size: 1.08rem;
    font-weight: 700;
    cursor: pointer;
}

/* Swatch Grid (Charts & Names) */
.swatch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.swatch-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.swatch-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.swatch-tile-color {
    height: 74px;
}

.swatch-tile-info {
    padding: 10px 12px;
}

.swatch-tile-name {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.swatch-tile-hex {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Tabs & Filter Pills */
.pill-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.pill-btn {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.pill-btn.is-active, .pill-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
}

.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger  { background: var(--danger-soft); color: var(--danger); }
.badge-neutral { background: var(--surface-2); color: var(--text-secondary); }

/* Tables (Logs Dashboard) */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.data-table th, .data-table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table th {
    background: var(--surface-2);
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
}

.data-table th a {
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.data-table tbody tr:hover {
    background: var(--surface-2);
}

/* Stat Cards */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    margin-top: 6px;
    letter-spacing: -0.02em;
}

/* Footer */
.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 44px 0 24px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 28px;
    margin-bottom: 32px;
}

@media (max-width: 860px) {
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 540px) {
    .footer-grid { grid-template-columns: 1fr; }
}

.footer-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 12px;
    max-width: 36ch;
}

.footer-col h4 {
    margin: 0 0 12px;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
    font-size: 0.9rem;
}

.footer-col a {
    color: var(--text-secondary);
}

.footer-col a:hover {
    color: var(--primary);
}

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

.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.84rem;
    color: var(--text-muted);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 999;
    display: grid;
    gap: 8px;
}

.toast {
    background: #0F172A;
    color: #F8FAFC;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.18s ease-out;
}

.toast-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
