/* ==========================================================================
   Lyefi Draft Tool - UI Foundation (Crownlup Edition)
   Calm, Low-Contrast & Eye-Friendly Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ---------- Fonts ---------- */
@font-face {
    font-family: 'Big Noodle Titling';
    src: url('Assets/Font/big_noodle_titling.ttf') format('truetype');
}

/* ---------- Calm Palette Design Tokens ---------- */
:root {
    --font-display: 'Big Noodle Titling', 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', Consolas, monospace;

    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* --- CALM DEEP NAVY SCALE (BASE SYSTEM) --- */
    --navy-950: #0a0f24;    /* Canvas background (Softer, matte midnight) */
    --navy-900: #101735;    /* Primary cards & panels */
    --navy-800: #151e44;    /* Secondary surface & inner card */
    --navy-700: #1c2754;    /* Subtle element borders */
    --navy-600: #273773;
    --navy-500: #384ea0;
    --navy-400: #4f69c7;
    --navy-300: #738bbd;    /* Muted text */
    --navy-200: #9cb0d6;    /* Secondary text */
    --navy-100: #c5d2ec;    /* Soft readable body text */
    --navy-50:  #e4ecfa;    /* Highlight text */

    /* --- CALM CHAMPAGNE GOLD SCALE (WARM MATTE ACCENT) --- */
    --gold-950: #1c1505;
    --gold-900: #2d2209;
    --gold-800: #473711;
    --gold-700: #6b541d;
    --gold-600: #94752c;
    --gold-500: #b08d38;    /* Warm matte gold */
    --gold-400: #c49f48;    /* Soft champagne gold */
    --gold-300: #d6b565;    /* Calm headline gold */
    --gold-200: #e6ce90;
    --gold-100: #f2e4bf;
    --gold-50:  #f9f3e1;

    /* --- CALM GARNET SCALE (MUTED RED SIDE) --- */
    --garnet-700: #691d15;
    --garnet-600: #87261c;
    --garnet-500: #a33326;    /* Muted wine red */
    --garnet-400: #bf4a3c;
    --garnet-200: #e29b92;
    --garnet-100: #f0cac6;
    --garnet-50:  #f8e7e5;

    /* --- SEMANTIC THEME VARIABLES --- */
    --bg: #0a0f24;
    --bg-subtle: #0d1430;
    --surface: #101735;
    --surface-2: #151e44;
    --surface-3: #1c2754;
    
    --line: rgba(140, 175, 230, 0.15);         /* Soft, calm border */
    --line-strong: rgba(196, 159, 72, 0.35);    /* Soft gold accent border */

    --text: #c5d2ec;                           /* Soft slate white (Zero glare) */
    --text-2: #9cb0d6;                         /* Secondary text */
    --muted: #738bbd;                          /* Subtle descriptions */

    --accent: #c49f48;                         /* Soft champagne gold */
    --accent-hover: #d6b565;
    --accent-ink: #0a0f24;
    --accent-glow: rgba(196, 159, 72, 0.2);

    --gold: #c49f48;
    --cyan: #4f69c7;
    
    --danger: #a33326;
    --success: #2e8b57;

    --overlay: rgba(10, 15, 36, 0.94);
    color-scheme: dark;
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ambient Background (Low Contrast & Calm) */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse at 15% 10%, rgba(56, 78, 160, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 85% 85%, rgba(196, 159, 72, 0.05) 0%, transparent 55%),
        radial-gradient(circle at center, rgba(140, 175, 230, 0.06) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 32px 32px;
    background-color: var(--bg);
}

/* ==========================================================================
   UI Components - Calm & Ergonomic
   ========================================================================== */

/* ---------- Buttons ---------- */
.ui-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 16px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ui-btn:active {
    transform: translateY(1px);
}

/* Primary Action Button (Warm Matte Gold) */
.ui-btn-primary {
    background: linear-gradient(135deg, #a68436 0%, #c49f48 100%);
    border: 1px solid #cca74f;
    color: #0a0f24;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.ui-btn-primary:hover {
    background: #d4b05a;
    border-color: #dfc175;
    color: #0a0f24;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(196, 159, 72, 0.25);
}

.ui-btn-cyan {
    background: linear-gradient(135deg, #a68436 0%, #c49f48 100%);
    border: 1px solid #cca74f;
    color: #0a0f24;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.ui-btn-cyan:hover {
    background: #d4b05a;
    border-color: #dfc175;
    color: #0a0f24;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(196, 159, 72, 0.25);
}

/* Secondary / Outline Button */
.ui-btn-ghost {
    background: rgba(16, 23, 53, 0.7);
    border: 1px solid var(--line);
    color: var(--text);
}

.ui-btn-ghost:hover {
    background: var(--surface-2);
    border-color: var(--line-strong);
    color: var(--accent-hover);
    transform: translateY(-1px);
}

.ui-btn-danger {
    background: rgba(163, 51, 38, 0.16);
    border: 1px solid rgba(163, 51, 38, 0.4);
    color: #e29b92;
}

.ui-btn-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #FFFFFF;
}

.ui-btn-sm {
    min-height: 30px;
    padding: 0 12px;
    font-size: 12px;
}

.ui-btn-lg {
    min-height: 44px;
    padding: 0 22px;
    font-size: 14px;
    font-weight: 700;
}

/* ---------- Cards ---------- */
.ui-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    position: relative;
}

.ui-card:hover {
    border-color: var(--line-strong);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.ui-card-pad {
    padding: 20px;
}

/* ---------- Badges & Tags ---------- */
.ui-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    background: rgba(10, 15, 36, 0.6);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.ui-badge-purple, .ui-badge-cyan, .ui-badge-blue, .ui-badge-gold {
    color: var(--accent);
    background: rgba(10, 15, 36, 0.6);
    border-color: var(--line-strong);
}

.ui-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.ui-dot.is-online {
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent-glow);
}

/* ---------- Navigation Bar ---------- */
.ui-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 6px;
    border-radius: var(--radius-lg);
}

.ui-nav-item {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    background: transparent;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
}

.ui-nav-item:hover {
    color: var(--accent-hover);
    background: var(--surface-2);
}

.ui-nav-item.active {
    color: #0a0f24;
    background: var(--accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* ---------- Toast Notifications ---------- */
.ui-toast-stack {
    position: fixed;
    z-index: 10001;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(380px, calc(100vw - 40px));
    pointer-events: none;
}

.ui-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ui-toast.is-success {
    border-left-color: var(--accent);
}

.ui-toast.is-error {
    border-left-color: var(--danger);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to { opacity: 1; transform: none; }
}
