/* =========================================================
   Swpul.com — Premium Dark Mode Design System
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* --- CSS Custom Properties --- */
:root {
    --bg: #0a0a0f;
    --bg-2: #111118;
    --bg-3: #16161f;
    --surface: #1a1a27;
    --surface-2: #20202f;
    --border: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.14);
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --green: #22c55e;
    --red: #ef4444;
    --text: #f0f0f8;
    --text-muted: #9090b0;
    --text-dim: #5a5a7a;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 18px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 12px 64px rgba(0, 0, 0, 0.8);
    --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--text); }

h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
h2 { font-size: 1.5rem; color: var(--text); margin-bottom: 1.25rem; }
h3 { font-size: 1.15rem; color: var(--text); }
p { color: var(--text-muted); }

/* --- Layout Utilities --- */
.container { max-width: 1160px; margin: 0 auto; padding: 0 1.5rem; }

/* =========================================================
   HEADER / NAV
   ========================================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text) !important;
    white-space: nowrap;
}

.logo-icon { font-size: 1.4rem; }
.logo-text { color: var(--text); }
.logo-accent { color: var(--accent-light); }

.header-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}

.header-nav .nav-link {
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
}

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

.admin-link {
    color: var(--text-dim);
    font-size: 1.1rem;
    padding: 0.3rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.admin-link:hover { color: var(--text-muted); background: var(--surface); }

/* =========================================================
   HERO
   ========================================================= */
.hero {
    padding: 5rem 1.5rem 4rem;
    text-align: center;
    background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(99, 102, 241, 0.18), transparent);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle 800px at 50% -200px, rgba(99, 102, 241, 0.08), transparent);
    pointer-events: none;
}

.hero-content { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; }

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #fff 30%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.search-wrapper {
    position: relative;
    max-width: 480px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 0.9rem 1.2rem 0.9rem 3.2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: all var(--transition);
    font-family: inherit;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--surface-2);
}

.search-input::placeholder { color: var(--text-dim); }

.search-icon {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    pointer-events: none;
}

/* =========================================================
   CATEGORY TABS
   ========================================================= */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tab-btn {
    padding: 0.45rem 1rem;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.tab-btn:hover { border-color: var(--accent); color: var(--text); background: var(--surface-2); }
.tab-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* =========================================================
   TOOLS GRID
   ========================================================= */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.tool-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
    cursor: pointer;
    color: var(--text);
}

.tool-card:hover {
    border-color: var(--accent);
    background: var(--surface-2);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.15);
}

.tool-card-icon { font-size: 2rem; flex-shrink: 0; }

.tool-card-body { flex: 1; min-width: 0; }

.tool-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 0.5rem;
}

.tool-card-category {
    font-size: 0.72rem;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-light);
    font-weight: 600;
}

.tool-card-arrow {
    color: var(--text-dim);
    font-size: 1.2rem;
    transition: all var(--transition);
    flex-shrink: 0;
}

.tool-card:hover .tool-card-arrow { color: var(--accent-light); transform: translateX(3px); }

/* --- Loading Skeletons --- */
.loading-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }

.skeleton-card {
    height: 90px;
    background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    border-radius: var(--radius);
    animation: shimmer 1.4s infinite;
    border: 1px solid var(--border);
}

@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* --- Empty State --- */
.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-icon { font-size: 4rem; margin-bottom: 1rem; }
.empty-state h3 { color: var(--text); margin-bottom: 0.5rem; }

/* --- Stats Bar --- */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 3rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    margin-top: 1.5rem;
}

.stat-item { text-align: center; }
.stat-number { display: block; font-size: 2rem; font-weight: 800; color: var(--accent-light); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* =========================================================
   TOOL PAGE
   ========================================================= */
.tool-hero {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, transparent 100%);
    border-bottom: 1px solid var(--border);
    padding: 2.5rem 0 2rem;
}

.breadcrumb { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 1rem; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent-light); }
.breadcrumb span { margin: 0 0.4rem; }

.tool-subtitle { color: var(--text-muted); font-size: 1rem; margin: 0.75rem 0 1rem; max-width: 600px; }

.tool-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.badge {
    padding: 0.25rem 0.7rem;
    border-radius: 50px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.tool-layout { display: grid; grid-template-columns: 1fr 280px; gap: 2rem; padding: 2rem 0; }
.tool-main { min-width: 0; }
.tool-sidebar { align-self: start; }

/* Tool Widget */
.tool-widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.tool-widget-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.views-badge { margin-left: auto; font-size: 0.8rem; color: var(--text-muted); }
.tool-widget-body { padding: 1.5rem; }

/* Widget internals */
.tool-textarea {
    width: 100%;
    min-height: 140px;
    padding: 0.9rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: 'Inter', monospace;
    font-size: 0.9rem;
    resize: vertical;
    outline: none;
    transition: border-color var(--transition);
    margin-bottom: 0.75rem;
}
.tool-textarea:focus { border-color: var(--accent); }

.tool-input {
    padding: 0.6rem 0.9rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition);
}
.tool-input:focus { border-color: var(--accent); }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.stats-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 0.75rem; margin-top: 0.75rem; }

.stat-box {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    text-align: center;
}
.stat-box span { display: block; font-size: 1.5rem; font-weight: 700; color: var(--accent-light); }
.stat-box label { font-size: 0.72rem; color: var(--text-muted); }

.tool-btn {
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}
.tool-btn:hover { background: var(--accent-light); transform: translateY(-1px); }
.tool-btn.secondary { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); }
.tool-btn.secondary:hover { border-color: var(--accent); color: var(--text); }

/* Color Picker Widget */
.color-picker-wrap { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 1rem; }
.color-wheel { width: 80px; height: 80px; border: none; background: none; cursor: pointer; border-radius: 50%; }
.color-preview { width: 80px; height: 80px; border-radius: 50%; border: 3px solid var(--border); }

/* Calc Widget */
.generic-tool + .calc-grid { margin-top: 0; }
.calc-grid { display: grid; gap: 1.5rem; }
.calc-section label { color: var(--text-muted); font-size: 0.9rem; display: block; margin-bottom: 0.75rem; }
.num-input { display: inline-block; width: 90px; padding: 0.4rem 0.6rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-family: inherit; font-size: 0.9rem; outline: none; margin: 0 0.25rem; }
.calc-result { margin-top: 0.75rem; font-size: 1.1rem; color: var(--text); }
.calc-result strong { color: var(--accent-light); font-size: 1.4rem; }

/* Generic Tool */
.generic-tool { display: flex; flex-direction: column; gap: 0.5rem; }
.tool-output { margin-top: 0.75rem; padding: 0.9rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted); font-size: 0.9rem; }

/* AI Content */
.tool-content { color: var(--text-muted); line-height: 1.75; }
.tool-content h2 { color: var(--text); margin: 2rem 0 0.75rem; font-size: 1.3rem; }
.tool-content h3 { color: var(--text); margin: 1.5rem 0 0.5rem; font-size: 1.1rem; }
.tool-content p { margin-bottom: 1rem; }
.tool-content ul, .tool-content ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.tool-content li { margin-bottom: 0.4rem; }
.tool-content strong { color: var(--text); }

/* FAQ */
.faq-section { margin-top: 2rem; }
.faq-section h2 { font-size: 1.3rem; margin-bottom: 1rem; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 0.75rem; overflow: hidden; }
.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    background: var(--surface);
    transition: background var(--transition);
    font-weight: 500;
    font-size: 0.95rem;
}
.faq-question:hover { background: var(--surface-2); }
.faq-icon { font-size: 1.4rem; color: var(--accent-light); font-weight: 300; }
.faq-answer { padding: 1rem 1.25rem; background: var(--bg-2); color: var(--text-muted); font-size: 0.9rem; border-top: 1px solid var(--border); }

/* Sidebar */
.sidebar-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.sidebar-card h3 { font-size: 0.95rem; margin-bottom: 0.75rem; color: var(--text); }
.related-list, .category-list { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.related-list a, .category-list a { font-size: 0.85rem; color: var(--text-muted); display: block; padding: 0.3rem 0; border-bottom: 1px solid var(--border); }
.related-list a:hover, .category-list a:hover { color: var(--accent-light); }

/* =========================================================
   BUTTONS (Global)
   ========================================================= */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    text-decoration: none;
}
.btn-primary:hover { background: var(--accent-light); transform: translateY(-1px); box-shadow: 0 6px 24px var(--accent-glow); color: #fff; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    text-decoration: none;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--text); }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

/* =========================================================
   ADMIN PAGES
   ========================================================= */
.admin-wrap { max-width: 1160px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.admin-header h1 { font-size: 1.6rem; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition);
}
.stat-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.stat-card-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.stat-card-value { font-size: 2rem; font-weight: 800; color: var(--accent-light); }
.stat-card-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }

.admin-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 2rem; }

.admin-message {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}
.admin-message.success { background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.3); color: var(--green); }
.admin-message.error { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--red); }

.admin-section { margin-bottom: 3rem; }

.admin-table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.admin-table th { background: var(--surface-2); padding: 0.75rem 1rem; text-align: left; font-weight: 600; color: var(--text-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 0.85rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }
.admin-table a { color: var(--accent-light); }
.admin-table a:hover { color: var(--text); }

.status-dot { font-size: 0.78rem; font-weight: 600; }
.status-dot.active { color: var(--green); }
.status-dot.active::before { content: '● '; }
.status-dot.draft { color: var(--text-dim); }
.status-dot.draft::before { content: '○ '; }

.notif-msg { max-width: 400px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.muted { color: var(--text-dim); font-size: 0.9rem; }

/* =========================================================
   LOGIN PAGE
   ========================================================= */
.login-wrap { min-height: calc(100vh - 60px); display: flex; align-items: center; justify-content: center; padding: 2rem; }

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
}

.login-logo { font-size: 1.4rem; font-weight: 800; margin-bottom: 1.5rem; color: var(--text); }
.login-title { font-size: 1.5rem; margin-bottom: 1.75rem; color: var(--text); }
.login-error { padding: 0.75rem 1rem; background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: var(--red); border-radius: var(--radius-sm); font-size: 0.875rem; margin-bottom: 1rem; }

.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--text-muted); margin-bottom: 0.5rem; }
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--transition);
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.full-width { width: 100%; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    padding: 3rem 0 0;
    margin-top: 4rem;
}

.footer-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3rem;
    padding-bottom: 2.5rem;
}

.footer-brand p { color: var(--text-dim); font-size: 0.875rem; margin-top: 0.5rem; }

.footer-links { display: flex; gap: 3rem; }
.footer-links h4 { color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.75rem; font-weight: 600; }
.footer-links a { display: block; font-size: 0.875rem; color: var(--text-dim); margin-bottom: 0.4rem; transition: color var(--transition); }
.footer-links a:hover { color: var(--accent-light); }

.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* =========================================================
   BLAZOR ERROR UI
   ========================================================= */
#blazor-error-ui {
    display: none;
    background: rgba(239, 68, 68, 0.95);
    color: white;
    padding: 0.75rem 1.5rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    font-size: 0.875rem;
}
#blazor-error-ui .reload { color: white; text-decoration: underline; margin-left: 0.5rem; }
#blazor-error-ui .dismiss { float: right; cursor: pointer; font-size: 1.2rem; line-height: 1; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 768px) {
    .tool-layout { grid-template-columns: 1fr; }
    .tool-sidebar { display: none; }
    .header-nav { display: none; }
    .stats-bar { gap: 1.5rem; }
    .footer-inner { grid-template-columns: 1fr; }
    .footer-links { flex-wrap: wrap; gap: 1.5rem; }
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
}

/*  AI Generator Panel  */
.ai-generator-panel {
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    margin: 1.5rem 0;
    position: relative;
    overflow: hidden;
}
.ai-generator-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #a78bfa, #34d399);
}
.ai-generator-panel h2 { margin-bottom: 0.25rem; font-size: 1.4rem; }
.generator-hint { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.95rem; }

.gen-input-row { display: flex; gap: 0.75rem; margin-bottom: 1rem; }
.gen-main-input { flex: 1; height: 48px; }
.gen-go-btn { height: 48px; padding: 0 1.5rem; white-space: nowrap; min-width: 130px; }
.gen-go-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.spinner { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.gen-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); border-radius: 8px; padding: 0.75rem 1rem; color: #f87171; margin-bottom: 1rem; font-size: 0.9rem; }

.gen-output-wrap { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.gen-output { min-height: 140px; font-family: inherit; line-height: 1.6; resize: vertical; }

/* Preset chips */
.gen-presets { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.preset-chip {
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 20px;
    padding: 0.3rem 0.85rem;
    font-size: 0.82rem;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.2s;
}
.preset-chip:hover { background: rgba(99,102,241,0.3); transform: translateY(-1px); }

/* Generator widget preview card */
.generator-preview {
    text-align: center;
    padding: 2.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.gen-preview-icon { font-size: 3rem; }
.gen-preview-text { color: var(--text-muted); max-width: 340px; line-height: 1.5; }

/*  Explore More Tools Grid  */
.explore-more-section { margin-top: 2.5rem; }
.explore-more-section h2 { margin-bottom: 1.25rem; font-size: 1.3rem; }
.explore-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.85rem;
}
.explore-tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1.1rem 0.75rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s;
    text-align: center;
}
.explore-tool-card:hover {
    border-color: var(--accent);
    background: rgba(99,102,241,0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(99,102,241,0.15);
}
.explore-emoji { font-size: 1.6rem; }
.explore-name { font-size: 0.87rem; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.explore-cat { font-size: 0.75rem; color: var(--text-muted); }

/* Internal links box (injected into AI-generated content) */
.internal-links-box {
    background: rgba(99,102,241,0.07);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-top: 1.5rem;
}
.internal-links-box h3 { margin-bottom: 0.6rem; font-size: 1rem; }
.internal-links-para a { color: var(--accent); text-decoration: underline; }
.internal-links-para a:hover { color: var(--accent-hover); }

/* Sidebar CTA card */
.sidebar-cta { background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(52,211,153,0.08)); }
.sidebar-cta h3 { color: var(--accent); }
.sidebar-cta p { font-size: 0.85rem; color: var(--text-muted); margin: 0.5rem 0 1rem; line-height: 1.5; }
.btn-sm { padding: 0.45rem 1rem; font-size: 0.85rem; }

/* Category count badge in sidebar */
.cat-count { margin-left: auto; font-size: 0.75rem; background: rgba(99,102,241,0.15); color: var(--accent); border-radius: 10px; padding: 0.1rem 0.5rem; font-weight: 600; }
.category-list li a { display: flex; align-items: center; gap: 0.4rem; }

/* ??????????????????????????????????????????????????????
   MONETIZATION STYLES
   ?????????????????????????????????????????????????????? */

/*  AdSense Slots  */
.ad-slot {
    width: 100%;
    overflow: hidden;
    /* Prevent layout shift: reserve space with min-height */
    min-height: 1px;
}
.ad-slot-in-article {
    margin: 1.5rem 0;
    /* Subtle separator so it doesn't look dropped in abruptly */
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
}
.ad-slot-sidebar {
    margin: 1rem 0;
    border-radius: 8px;
    overflow: hidden;
}
.ad-slot-bottom-banner {
    margin: 2rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/*  Affiliate Card  */
.affiliate-card {
    position: relative;
    background: linear-gradient(135deg,
        rgba(52, 211, 153, 0.08),
        rgba(99, 102, 241, 0.06));
    border: 1px solid rgba(52, 211, 153, 0.25);
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1rem 0;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.affiliate-card:hover {
    border-color: rgba(52, 211, 153, 0.5);
    box-shadow: 0 4px 20px rgba(52, 211, 153, 0.1);
}
.affiliate-tag {
    position: absolute;
    top: -10px;
    right: 12px;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.15rem 0.6rem;
    text-transform: uppercase;
}
.affiliate-body {
    margin-top: 0.25rem;
}
.affiliate-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.35rem;
}
.affiliate-desc {
    font-size: 0.83rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0 0 0.85rem;
}
.affiliate-cta {
    display: inline-block;
    background: linear-gradient(135deg, #34d399, #059669);
    color: #fff;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.45rem 1rem;
    border-radius: 8px;
    transition: opacity 0.2s, transform 0.2s;
}
.affiliate-cta:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}
