/* =============================================
   AI Promptory Hub — Design System
   Aesthetic: Dark-first, editorial, futuristic
   Fonts: Syne (headings) + DM Sans (body) + JetBrains Mono (code)
   ============================================= */

/* ---- CSS Variables ---- */
:root {
    --bg-primary: #0a0b0f;
    --bg-secondary: #111318;
    --bg-card: #15181f;
    --bg-card-hover: #1c202b;
    --bg-input: #1a1d26;
    --border: rgba(255,255,255,0.07);
    --border-strong: rgba(255,255,255,0.15);

    --text-primary: #f0f2f8;
    --text-secondary: #8890a8;
    --text-muted: #545c73;

    --accent: #6c63ff;
    --accent-glow: rgba(108,99,255,0.3);
    --accent-light: #8b83ff;
    --accent-dark: #4a43cc;

    --green: #10d48e;
    --green-bg: rgba(16,212,142,0.1);
    --yellow: #f5c542;
    --yellow-bg: rgba(245,197,66,0.1);
    --red: #f43f5e;
    --red-bg: rgba(244,63,94,0.1);
    --blue: #38bdf8;
    --blue-bg: rgba(56,189,248,0.1);
    --orange: #fb923c;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.5);
    --shadow-card: 0 0 0 1px var(--border), 0 4px 24px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 30px var(--accent-glow);

    --transition: 0.2s ease;
    --transition-md: 0.35s cubic-bezier(0.4,0,0.2,1);

    --nav-h: 68px;
    --max-w: 1280px;
}

[data-theme="light"] {
    --bg-primary: #f5f6fa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9ff;
    --bg-input: #f0f1f7;
    --border: rgba(0,0,0,0.08);
    --border-strong: rgba(0,0,0,0.18);
    --text-primary: #0f1120;
    --text-secondary: #4a5068;
    --text-muted: #8890a8;
    --shadow-card: 0 0 0 1px var(--border), 0 4px 24px rgba(0,0,0,0.08);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background var(--transition-md), color var(--transition-md);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }
ul { list-style: none; }

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}
h1 { font-size: clamp(2rem, 5vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.4rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1rem; font-weight: 600; }
p { color: var(--text-secondary); }
code, pre { font-family: 'JetBrains Mono', monospace; }

/* ---- Navbar ---- */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    height: var(--nav-h);
    background: rgba(10,11,15,0.85);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition-md);
}
[data-theme="light"] .navbar { background: rgba(245,246,250,0.9); }
.nav-container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 32px;
}
.nav-logo {
    display: flex; align-items: center; gap: 10px;
    font-family: 'Syne', sans-serif; font-size: 1.25rem; font-weight: 800;
    flex-shrink: 0;
}
.logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: white;
}
.logo-accent { color: var(--accent); }
.nav-links {
    display: flex; align-items: center; gap: 4px;
    flex: 1;
}
.nav-link {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem; font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
}
.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    background: var(--bg-card);
}
.nav-link.active { color: var(--accent); }
.nav-actions {
    display: flex; align-items: center; gap: 8px; margin-left: auto;
}
.btn-icon {
    width: 38px; height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    transition: all var(--transition);
}
.btn-icon:hover { background: var(--bg-card); color: var(--text-primary); border-color: var(--border-strong); }
.btn-nav {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem; font-weight: 500;
    border: 1px solid var(--border);
    color: var(--text-primary);
    transition: all var(--transition);
}
.btn-nav:hover { background: var(--bg-card); border-color: var(--border-strong); }
.btn-primary-sm {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem; font-weight: 600;
    background: var(--accent);
    color: white;
    border: none; cursor: pointer;
    transition: all var(--transition);
}
.btn-primary-sm:hover { background: var(--accent-light); box-shadow: var(--shadow-glow); }
.burger {
    display: none; flex-direction: column; gap: 5px; cursor: pointer;
    background: none; border: none; padding: 4px;
}
.burger span { width: 22px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: var(--transition); }

/* ---- Search Overlay ---- */
.search-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 15vh;
    opacity: 0; pointer-events: none;
    transition: opacity var(--transition-md);
}
.search-overlay.open { opacity: 1; pointer-events: all; }
.search-box {
    width: min(680px, 95vw);
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md), 0 0 60px rgba(108,99,255,0.2);
    transform: translateY(-20px);
    transition: transform var(--transition-md);
}
.search-overlay.open .search-box { transform: translateY(0); }
.search-input-wrap {
    display: flex; align-items: center; gap: 12px; padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}
.search-input-wrap i { font-size: 18px; color: var(--text-muted); flex-shrink: 0; }
.search-input-wrap input {
    flex: 1; background: none; border: none; outline: none;
    font-size: 1.1rem; color: var(--text-primary);
}
.search-input-wrap kbd {
    font-size: 0.75rem; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: 4px; padding: 2px 6px; color: var(--text-muted);
}
.search-results { max-height: 400px; overflow-y: auto; padding: 12px; }
.search-hint { color: var(--text-muted); font-size: 0.9rem; text-align: center; padding: 20px; }
.search-result-item {
    display: flex; align-items: center; gap: 12px; padding: 12px;
    border-radius: var(--radius-md); cursor: pointer;
    transition: background var(--transition);
}
.search-result-item:hover { background: var(--bg-card-hover); }
.search-result-icon {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
}
.search-result-icon.tool { background: var(--blue-bg); color: var(--blue); }
.search-result-icon.news { background: var(--green-bg); color: var(--green); }
.search-result-icon.research { background: var(--yellow-bg); color: var(--yellow); }
.search-result-icon.prompt { background: var(--accent-glow); color: var(--accent); }
.search-result-title { font-weight: 500; font-size: 0.9rem; }
.search-result-type { font-size: 0.75rem; color: var(--text-muted); }

/* ---- Flash ---- */
.flash-msg {
    position: fixed; top: calc(var(--nav-h) + 16px); right: 20px; z-index: 1500;
    display: flex; align-items: center; gap: 10px;
    padding: 12px 18px; border-radius: var(--radius-md);
    font-size: 0.9rem; font-weight: 500;
    box-shadow: var(--shadow-md);
    animation: slideIn 0.3s ease;
}
.flash-success { background: var(--green-bg); border: 1px solid var(--green); color: var(--green); }
.flash-error   { background: var(--red-bg); border: 1px solid var(--red); color: var(--red); }
.flash-info    { background: var(--blue-bg); border: 1px solid var(--blue); color: var(--blue); }
.flash-msg button { background: none; border: none; cursor: pointer; color: inherit; margin-left: 8px; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---- Main Content ---- */
.main-content { padding-top: var(--nav-h); min-height: 100vh; }

/* ---- Hero Section ---- */
.hero {
    position: relative; overflow: hidden;
    padding: 100px 24px 80px;
    text-align: center;
}
.hero-bg {
    position: absolute; inset: 0; z-index: 0;
    background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(108,99,255,0.18) 0%, transparent 70%);
}
.hero-grid {
    position: absolute; inset: 0; z-index: 0;
    background-image: linear-gradient(var(--border) 1px, transparent 1px),
                      linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black, transparent);
}
.hero-content { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--accent-glow); border: 1px solid var(--accent);
    padding: 6px 16px; border-radius: var(--radius-full);
    font-size: 0.8rem; font-weight: 600; color: var(--accent-light);
    margin-bottom: 24px;
    animation: pulse-badge 2.5s infinite;
}
@keyframes pulse-badge { 0%,100% { box-shadow: 0 0 0 0 var(--accent-glow); } 50% { box-shadow: 0 0 0 8px transparent; } }
.hero h1 {
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-light) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero p { font-size: 1.15rem; color: var(--text-secondary); max-width: 560px; margin: 0 auto 36px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-hero-primary {
    padding: 14px 32px; border-radius: var(--radius-md);
    background: var(--accent); color: white;
    font-size: 1rem; font-weight: 600; border: none; cursor: pointer;
    transition: all var(--transition);
    display: flex; align-items: center; gap: 8px;
}
.btn-hero-primary:hover { background: var(--accent-light); box-shadow: var(--shadow-glow); transform: translateY(-1px); }
.btn-hero-secondary {
    padding: 14px 32px; border-radius: var(--radius-md);
    background: transparent; color: var(--text-primary);
    font-size: 1rem; font-weight: 600; border: 1px solid var(--border-strong); cursor: pointer;
    transition: all var(--transition);
    display: flex; align-items: center; gap: 8px;
}
.btn-hero-secondary:hover { background: var(--bg-card); border-color: var(--accent); color: var(--accent); }
.hero-stats {
    display: flex; gap: 40px; justify-content: center; margin-top: 60px;
    flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat-number { font-family: 'Syne', sans-serif; font-size: 2rem; font-weight: 800; color: var(--text-primary); }
.hero-stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* ---- Section Layout ---- */
.section { padding: 72px 24px; }
.section-inner { max-width: var(--max-w); margin: 0 auto; }
.section-header {
    display: flex; align-items: flex-end; justify-content: space-between;
    margin-bottom: 36px; gap: 16px;
}
.section-title-wrap { }
.section-label {
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.1em; color: var(--accent); margin-bottom: 6px;
}
.section-title { margin: 0; }
.section-desc { color: var(--text-secondary); margin-top: 8px; }
.view-all {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.875rem; font-weight: 500; color: var(--accent);
    white-space: nowrap;
    transition: gap var(--transition);
}
.view-all:hover { gap: 10px; }

/* ---- Cards ---- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.cards-grid-4 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-md);
    position: relative; overflow: hidden;
}
.card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}
.card-shine {
    position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
    transition: left 0.6s ease;
}
.card:hover .card-shine { left: 100%; }

/* Tool Card */
.tool-card .card-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.tool-logo {
    width: 48px; height: 48px; border-radius: var(--radius-md);
    border: 1px solid var(--border); background: var(--bg-input);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; flex-shrink: 0;
}
.tool-logo img { width: 100%; height: 100%; object-fit: cover; }
.tool-logo .fallback { font-size: 1.5rem; }
.tool-card h3 { font-size: 1rem; margin-bottom: 4px; }
.tool-card p { font-size: 0.875rem; color: var(--text-secondary); }
.card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; gap: 8px; flex-wrap: wrap; }
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: var(--radius-full);
    font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
}
.badge-free     { background: var(--green-bg); color: var(--green); }
.badge-freemium { background: var(--yellow-bg); color: var(--yellow); }
.badge-paid     { background: var(--red-bg); color: var(--red); }
.badge-category { background: var(--bg-input); color: var(--text-secondary); }
.badge-auto     { background: var(--blue-bg); color: var(--blue); }
.badge-manual   { background: var(--accent-glow); color: var(--accent); }
.card-link {
    font-size: 0.8rem; color: var(--accent); font-weight: 500;
    display: flex; align-items: center; gap: 4px;
    transition: gap var(--transition);
}
.card-link:hover { gap: 8px; }

/* News Card */
.news-card .news-meta {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.8rem; color: var(--text-muted); margin-bottom: 10px; flex-wrap: wrap;
}
.news-card h3 { font-size: 1rem; margin-bottom: 8px; line-height: 1.4; }
.news-card p  { font-size: 0.875rem; }

/* Prompt Card */
.prompt-card .prompt-content {
    background: var(--bg-input); border-radius: var(--radius-md);
    padding: 14px; font-size: 0.82rem; font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary); line-height: 1.6; margin: 12px 0;
    border: 1px solid var(--border); max-height: 120px; overflow: hidden;
    position: relative;
}
.prompt-content::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 40px;
    background: linear-gradient(transparent, var(--bg-input));
}
.prompt-actions { display: flex; align-items: center; gap: 8px; }
.btn-copy {
    display: flex; align-items: center; gap: 6px; padding: 7px 14px;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 500;
    color: var(--text-secondary); cursor: pointer; transition: all var(--transition);
}
.btn-copy:hover { background: var(--bg-card-hover); color: var(--text-primary); border-color: var(--border-strong); }
.btn-copy.copied { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.btn-upvote {
    display: flex; align-items: center; gap: 6px; padding: 7px 14px;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 500;
    color: var(--text-secondary); cursor: pointer; transition: all var(--transition);
}
.btn-upvote:hover, .btn-upvote.upvoted { background: var(--accent-glow); border-color: var(--accent); color: var(--accent); }

/* Research Card */
.research-card .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.tag {
    padding: 3px 10px; border-radius: var(--radius-full);
    font-size: 0.72rem; font-weight: 500;
    background: var(--bg-input); color: var(--text-muted);
    border: 1px solid var(--border);
}

/* ---- Filters ---- */
.filters-row {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 28px; flex-wrap: wrap;
}
.filter-btn {
    padding: 7px 16px; border-radius: var(--radius-full);
    border: 1px solid var(--border); background: var(--bg-card);
    font-size: 0.8rem; font-weight: 500; color: var(--text-secondary);
    cursor: pointer; transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: white; }
.sort-select {
    padding: 7px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--bg-card);
    color: var(--text-primary); font-size: 0.8rem; cursor: pointer; outline: none;
    margin-left: auto;
}

/* ---- Prompt of the Day Banner ---- */
.potd-banner {
    background: linear-gradient(135deg, rgba(108,99,255,0.15) 0%, rgba(56,189,248,0.1) 100%);
    border: 1px solid rgba(108,99,255,0.3);
    border-radius: var(--radius-xl); padding: 36px 40px;
    display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
    position: relative; overflow: hidden;
}
.potd-banner::before {
    content: '✦';
    position: absolute; right: 48px; top: 50%; transform: translateY(-50%);
    font-size: 120px; opacity: 0.04; color: var(--accent); line-height: 1;
}
.potd-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin-bottom: 8px; }
.potd-title { font-size: 1.4rem; font-family: 'Syne', sans-serif; font-weight: 700; margin-bottom: 10px; }
.potd-preview { font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; color: var(--text-secondary); }
.potd-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }

/* ---- Page Header ---- */
.page-header {
    background: var(--bg-secondary); border-bottom: 1px solid var(--border);
    padding: 48px 24px;
}
.page-header-inner { max-width: var(--max-w); margin: 0 auto; }
.page-header h1 { margin-bottom: 8px; }
.page-header p { font-size: 1.05rem; }
.search-bar {
    display: flex; align-items: center; gap: 12px;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 12px 16px;
    margin-top: 24px; max-width: 560px;
    transition: border-color var(--transition);
}
.search-bar:focus-within { border-color: var(--accent); }
.search-bar i { color: var(--text-muted); }
.search-bar input {
    flex: 1; background: none; border: none; outline: none;
    color: var(--text-primary); font-size: 0.95rem;
}

/* ---- Pagination ---- */
.pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; margin-top: 48px; flex-wrap: wrap;
}
.page-btn {
    min-width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text-secondary);
    font-size: 0.875rem; cursor: pointer; transition: all var(--transition);
    padding: 0 8px;
}
.page-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: white; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---- Forms ---- */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 8px; color: var(--text-primary); }
.form-control {
    width: 100%; padding: 11px 14px;
    border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: var(--bg-input); color: var(--text-primary);
    font-size: 0.9rem; outline: none; transition: border-color var(--transition);
}
.form-control:focus { border-color: var(--accent); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }
.form-error { font-size: 0.8rem; color: var(--red); margin-top: 6px; }
.btn-submit {
    padding: 12px 28px; border-radius: var(--radius-md);
    background: var(--accent); color: white; border: none;
    font-size: 0.95rem; font-weight: 600; cursor: pointer;
    transition: all var(--transition);
    display: flex; align-items: center; gap: 8px;
}
.btn-submit:hover { background: var(--accent-light); box-shadow: var(--shadow-glow); }
.btn-outline {
    padding: 12px 28px; border-radius: var(--radius-md);
    background: transparent; color: var(--text-primary);
    border: 1px solid var(--border-strong); font-size: 0.95rem; font-weight: 600;
    cursor: pointer; transition: all var(--transition);
}
.btn-outline:hover { background: var(--bg-card-hover); }

/* ---- Tool of Day / Featured Banner ---- */
.featured-banner {
    background: linear-gradient(135deg, rgba(16,212,142,0.1), rgba(56,189,248,0.08));
    border: 1px solid rgba(16,212,142,0.2);
    border-radius: var(--radius-xl); padding: 32px;
    display: flex; align-items: center; gap: 24px;
}
.featured-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--green-bg); border: 1px solid var(--green);
    color: var(--green); padding: 4px 12px; border-radius: var(--radius-full);
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    margin-bottom: 10px;
}

/* ---- Stats Row ---- */
.stats-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px; margin-bottom: 40px;
}
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px 24px;
    display: flex; flex-direction: column; gap: 4px;
}
.stat-card .stat-value { font-family: 'Syne', sans-serif; font-size: 1.8rem; font-weight: 800; }
.stat-card .stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card .stat-change { font-size: 0.78rem; color: var(--green); }

/* ---- Footer ---- */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 60px 24px 0;
    margin-top: 80px;
}
.footer-container {
    max-width: var(--max-w); margin: 0 auto;
    display: grid; grid-template-columns: 2fr 1fr 1.5fr;
    gap: 48px; padding-bottom: 48px;
}
.footer-brand p { color: var(--text-muted); font-size: 0.875rem; margin: 14px 0 20px; line-height: 1.7; }
.social-links { display: flex; gap: 10px; }
.social-link {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 15px;
    transition: all var(--transition);
}
.social-link:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.footer-links { display: flex; gap: 48px; }
.footer-col h4 { margin-bottom: 16px; font-size: 0.875rem; }
.footer-col a {
    display: block; color: var(--text-muted); font-size: 0.875rem;
    margin-bottom: 10px; transition: color var(--transition);
}
.footer-col a:hover { color: var(--text-primary); }
.footer-newsletter h4 { margin-bottom: 10px; font-size: 0.875rem; }
.footer-newsletter p { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 14px; }
.newsletter-form { display: flex; gap: 8px; }
.newsletter-form input {
    flex: 1; padding: 10px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--bg-input);
    color: var(--text-primary); font-size: 0.875rem; outline: none;
    transition: border-color var(--transition);
}
.newsletter-form input:focus { border-color: var(--accent); }
.newsletter-form button {
    padding: 10px 16px; border-radius: var(--radius-sm);
    background: var(--accent); color: white; border: none;
    font-size: 0.875rem; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; gap: 6px;
    transition: all var(--transition);
}
.newsletter-form button:hover { background: var(--accent-light); }
.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 20px 0;
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.8rem; color: var(--text-muted); gap: 16px; flex-wrap: wrap;
}
.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a { color: var(--text-muted); transition: color var(--transition); }
.footer-bottom-links a:hover { color: var(--text-primary); }

/* ---- Loading / Skeleton ---- */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeleton-wave 1.5s infinite;
    border-radius: var(--radius-sm);
}
@keyframes skeleton-wave { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---- Empty State ---- */
.empty-state {
    text-align: center; padding: 80px 24px;
    color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; display: block; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: 8px; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .footer-container { grid-template-columns: 1fr 1fr; }
    .footer-newsletter { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
    .nav-links { display: none; position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; gap: 4px; padding: 16px; background: var(--bg-secondary); border-bottom: 1px solid var(--border); }
    .nav-links.open { display: flex; }
    .burger { display: flex; }
    .btn-nav, .btn-primary-sm { display: none; }
    .hero { padding: 60px 20px 50px; }
    .hero-stats { gap: 24px; }
    .potd-banner { grid-template-columns: 1fr; }
    .potd-banner::before { display: none; }
    .potd-actions { align-items: flex-start; }
    .section-header { flex-direction: column; align-items: flex-start; }
    .footer-container { grid-template-columns: 1fr; gap: 32px; }
    .footer-links { flex-direction: column; gap: 24px; }
    .filters-row { flex-wrap: wrap; }
    .sort-select { width: 100%; margin-left: 0; }
    .newsletter-form { flex-direction: column; }
}
@media (max-width: 480px) {
    .cards-grid { grid-template-columns: 1fr; }
}

/* =============================================
   EXTENDED STYLES — Part 2
   ============================================= */

/* ---- Trending Section Ticker ---- */
.trending-ticker {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
    overflow: hidden;
    position: relative;
}
.trending-ticker::before,
.trending-ticker::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 80px;
    z-index: 2;
}
.trending-ticker::before { left: 0; background: linear-gradient(90deg, var(--bg-secondary), transparent); }
.trending-ticker::after  { right: 0; background: linear-gradient(-90deg, var(--bg-secondary), transparent); }
.ticker-inner {
    display: flex; gap: 0;
    animation: ticker-scroll 30s linear infinite;
    width: max-content;
}
.ticker-inner:hover { animation-play-state: paused; }
.ticker-item {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 0 28px;
    font-size: 0.82rem; font-weight: 500; color: var(--text-secondary);
    white-space: nowrap;
    border-right: 1px solid var(--border);
}
.ticker-item i { color: var(--accent); font-size: 14px; }
@keyframes ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ---- Highlight on Scroll ---- */
.scroll-highlight {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.scroll-highlight.in-view {
    opacity: 1;
    transform: none;
}

/* ---- Toast Notification ---- */
.toast-container {
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 3000;
    display: flex; flex-direction: column; gap: 10px;
    pointer-events: none;
}
.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    display: flex; align-items: center; gap: 10px;
    font-size: 0.875rem; font-weight: 500;
    box-shadow: var(--shadow-md);
    pointer-events: all;
    animation: toast-in 0.3s ease;
    max-width: 340px;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--accent); }
@keyframes toast-in {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ---- Bookmark Button ---- */
.btn-bookmark {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-bookmark:hover, .btn-bookmark.bookmarked {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}
.btn-bookmark.bookmarked i::before { content: "\F145"; } /* bi-bookmark-fill */

/* ---- Tag Cloud ---- */
.tag-cloud {
    display: flex; flex-wrap: wrap; gap: 8px;
}
.tag-cloud .tag {
    cursor: pointer;
    transition: all var(--transition);
}
.tag-cloud .tag:hover {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
}

/* ---- Progress Bar ---- */
.read-progress {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    height: 2px;
    background: transparent;
    z-index: 999;
}
.read-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    width: 0%;
    transition: width 0.1s linear;
}

/* ---- Code Highlight ---- */
.code-block {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-secondary);
    overflow-x: auto;
    position: relative;
}
.code-block .copy-btn {
    position: absolute;
    top: 10px; right: 10px;
    padding: 4px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}
.code-block .copy-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Modal ---- */
.modal-overlay {
    position: fixed; inset: 0; z-index: 2500;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    opacity: 0; pointer-events: none;
    transition: opacity var(--transition-md);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: min(560px, 100%);
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform var(--transition-md);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}
.modal-close {
    background: none; border: none;
    color: var(--text-muted); font-size: 20px;
    cursor: pointer; padding: 4px;
    transition: color var(--transition);
}
.modal-close:hover { color: var(--text-primary); }

/* ---- Skeleton Loaders ---- */
.skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}
.skeleton-line {
    height: 14px;
    border-radius: 4px;
    margin-bottom: 10px;
}
.skeleton-line.short  { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.full   { width: 100%; }

/* ---- Loading Spinner ---- */
.spinner {
    width: 24px; height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Accordion ---- */
.accordion-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 8px;
}
.accordion-trigger {
    width: 100%;
    background: var(--bg-card);
    border: none; cursor: pointer;
    padding: 16px 20px;
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.9rem; font-weight: 600; color: var(--text-primary);
    text-align: left;
    transition: background var(--transition);
}
.accordion-trigger:hover { background: var(--bg-card-hover); }
.accordion-trigger .chevron {
    transition: transform var(--transition);
    font-size: 12px; color: var(--text-muted);
}
.accordion-item.open .accordion-trigger .chevron { transform: rotate(180deg); }
.accordion-body {
    max-height: 0; overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--bg-input);
}
.accordion-item.open .accordion-body { max-height: 500px; }
.accordion-body-inner { padding: 16px 20px; font-size: 0.875rem; color: var(--text-secondary); }

/* ---- Sticky Sidebar ---- */
.sticky-sidebar {
    position: sticky;
    top: calc(var(--nav-h) + 24px);
}

/* ---- Callout Box ---- */
.callout {
    border-left: 3px solid var(--accent);
    background: var(--accent-glow);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 14px 18px;
    font-size: 0.875rem;
}
.callout.success { border-left-color: var(--green); background: var(--green-bg); }
.callout.warning { border-left-color: var(--yellow); background: var(--yellow-bg); }
.callout.error   { border-left-color: var(--red); background: var(--red-bg); }

/* ---- Divider ---- */
.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 28px 0;
}
.divider-text {
    display: flex; align-items: center; gap: 16px;
    margin: 24px 0; color: var(--text-muted); font-size: 0.8rem;
}
.divider-text::before, .divider-text::after {
    content: '';
    flex: 1;
    border-top: 1px solid var(--border);
}

/* ---- Card List View (Research) ---- */
.list-card {
    display: flex;
    gap: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition-md);
}
.list-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-strong);
    transform: translateX(2px);
}
.list-card-number {
    font-family: 'Syne', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-muted);
    opacity: 0.3;
    line-height: 1;
    flex-shrink: 0;
    min-width: 40px;
}

/* ---- Floating Action Button ---- */
.fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(108,99,255,0.4);
    transition: all var(--transition);
    z-index: 500;
}
.fab:hover { background: var(--accent-light); transform: scale(1.08); }
.fab.hidden { opacity: 0; pointer-events: none; transform: scale(0.8); }

/* ---- Highlight keyword in search ---- */
mark {
    background: rgba(108,99,255,0.25);
    color: var(--accent-light);
    border-radius: 2px;
    padding: 0 2px;
}

/* ---- Grid layout helpers ---- */
.two-col   { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
@media (max-width: 768px) {
    .two-col, .three-col { grid-template-columns: 1fr; }
}

/* ---- Print styles ---- */
@media print {
    .navbar, .footer, .btn-copy, .btn-upvote, .fab { display: none !important; }
    .main-content { padding-top: 0 !important; }
}

/* ---- Accessibility ---- */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ---- Custom Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---- Selection ---- */
::selection { background: rgba(108,99,255,0.25); color: var(--accent-light); }

/* =============================================
   USER DROPDOWN MENU
   ============================================= */
.user-menu-wrap {
    position: relative;
}
.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px 5px 5px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
}
.user-menu-btn:hover {
    background: var(--bg-card);
    border-color: var(--border-strong);
}
.user-menu-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Syne', sans-serif;
    color: white;
    flex-shrink: 0;
}
.user-menu-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-menu-chevron {
    font-size: 11px;
    color: var(--text-muted);
    transition: transform var(--transition);
    flex-shrink: 0;
}
.user-menu-wrap.open .user-menu-chevron {
    transform: rotate(180deg);
}
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px) scale(0.97);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 999;
    overflow: hidden;
}
.user-menu-wrap.open .user-dropdown {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0) scale(1);
}
.user-dropdown-header {
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}
.user-dropdown-header .uname {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
}
.user-dropdown-header .uemail {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-dropdown-header .urole {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}
.urole.admin     { background: var(--red-bg);    color: var(--red);    border: 1px solid var(--red); }
.urole.moderator { background: var(--blue-bg);   color: var(--blue);   border: 1px solid var(--blue); }
.urole.user      { background: var(--green-bg);  color: var(--green);  border: 1px solid var(--green); }
.user-dropdown-body {
    padding: 6px;
}
.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}
.user-dropdown-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}
.user-dropdown-item i {
    width: 18px;
    font-size: 15px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.user-dropdown-item:hover i {
    color: var(--accent);
}
.user-dropdown-item.danger { color: var(--red); }
.user-dropdown-item.danger i { color: var(--red); }
.user-dropdown-item.danger:hover { background: var(--red-bg); color: var(--red); }
.user-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 6px;
}
