/**
 * Main CSS: Design Tokens, CSS Variables, Typography, Layout, Navbar, Footer, Admin Banner, Toast.
 */

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

:root {
    /* Color Palette */
    --bg-main: #0a0f1d;
    --bg-card: rgba(19, 27, 46, 0.75);
    --bg-card-solid: #131b2e;
    --bg-card-hover: rgba(28, 40, 68, 0.85);
    --bg-glass: rgba(15, 23, 42, 0.65);
    --bg-input: #0e1526;
    
    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-active: rgba(245, 158, 11, 0.4);
    --border-glow: rgba(56, 189, 248, 0.3);

    /* Accents */
    --gold-primary: #f59e0b;
    --gold-hover: #d97706;
    --gold-glow: rgba(245, 158, 11, 0.25);
    --gold-gradient: linear-gradient(135deg, #f59e0b 0%, #fbbf24 50%, #d97706 100%);
    
    --cyan-accent: #38bdf8;
    --cyan-glow: rgba(56, 189, 248, 0.2);
    --indigo-accent: #818cf8;
    
    /* Text Colors */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --text-gold: #fbbf24;

    /* Fonts */
    --font-ui: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-literary: 'Merriweather', serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Shadows & Effects */
    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(245, 158, 11, 0.15);
    --shadow-modal: 0 25px 60px -15px rgba(0, 0, 0, 0.8);
    --backdrop-blur: blur(16px);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base Setup */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-ui);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image: 
        radial-gradient(circle at 15% 10%, rgba(245, 158, 11, 0.07) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(56, 189, 248, 0.05) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.04) 0%, transparent 50%);
    background-attachment: fixed;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
}

input, select, textarea {
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-main);
    background-color: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    outline: none;
    transition: var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

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

/* Top Utility Bar (Bookmarks & Homepage Quick Actions) */
.site-top-bar {
    background: rgba(8, 12, 22, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.82rem;
    padding: 0.35rem 0;
    color: var(--text-muted);
    position: relative;
    z-index: 1001;
}

.top-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.top-bar-domain {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.btn-top-util {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-top-util:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--gold-primary);
    color: var(--gold-primary);
    transform: translateY(-1px);
}

/* Header & Navigation */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-glass);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border-bottom: 1px solid var(--border-subtle);
    transition: var(--transition-smooth);
}

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

.logo-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-main);
}

.logo-icon {
    font-size: 1.5rem;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-tag {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    background: rgba(245, 158, 11, 0.15);
    color: var(--gold-primary);
    border-radius: var(--radius-full);
    border: 1px solid rgba(245, 158, 11, 0.3);
    margin-left: 0.35rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.5rem 0.85rem;
    font-size: 0.925rem;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--gold-primary);
    background: rgba(245, 158, 11, 0.1);
    font-weight: 600;
}

.nav-link-bookmarks {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.favorites-badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9999px;
    background: var(--gold-gradient);
    color: #0f172a;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.favorites-badge-count.hidden {
    display: none;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-header-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: var(--transition-fast);
}

.btn-header-search:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-main);
}

.search-kbd-shortcut {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    padding: 0.1rem 0.35rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-header-bookmarks {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-full);
    color: var(--gold-primary);
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.btn-header-bookmarks:hover {
    background: rgba(245, 158, 11, 0.2);
    box-shadow: 0 0 15px var(--gold-glow);
}

.favorites-badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--gold-primary);
    color: #000;
    border-radius: var(--radius-full);
}

.favorites-badge-count.hidden {
    display: none;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: var(--transition-fast);
}

/* Footer */
.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-subtle);
    background: rgba(10, 15, 29, 0.95);
    padding: 3rem 0 2rem;
    color: var(--text-muted);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

.footer-brand h4 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.footer-brand p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.footer-col h5 {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 0.5rem;
}

.footer-col a {
    font-size: 0.875rem;
    color: var(--text-muted);
}

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

.footer-bottom {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.825rem;
    color: var(--text-dim);
}

/* Admin Mode Banner */
.admin-mode-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: linear-gradient(90deg, #7c3aed 0%, #d97706 100%);
    color: #fff;
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

.admin-banner-content {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-icon {
    font-size: 1.1rem;
    margin-right: 0.5rem;
}

.admin-exit-btn {
    padding: 0.2rem 0.6rem;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
    color: #fff;
}

.admin-exit-btn:hover {
    background: rgba(0, 0, 0, 0.6);
}

/* Toast Alerts */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.85rem 1.25rem;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-active);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

.toast-show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    background: rgba(245, 158, 11, 0.2);
    color: var(--gold-primary);
    font-weight: bold;
    font-size: 0.85rem;
}

.toast-success .toast-icon {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}
