/* =====================
   CSS Custom Properties
   ===================== */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #eef2ff;
    --secondary: #10b981;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --bg-card: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --nav-bg: rgba(255, 255, 255, 0.85);
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px rgba(99, 102, 241, 0.12);
    /* Solid white for modals/buttons in light mode */
    --modal-bg: #ffffff;
    --btn-outline-bg: #ffffff;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --bg-alt: #1e293b;
    --bg-card: #1e293b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --primary-light: #1e1b4b;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --nav-bg: rgba(15, 23, 42, 0.9);
    --glass-bg: rgba(30, 41, 59, 0.65);
    --glass-border: rgba(148, 163, 184, 0.15);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    /* In dark mode, modals also use glass */
    --modal-bg: rgba(30, 41, 59, 0.75);
    --btn-outline-bg: rgba(30, 41, 59, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

.hidden { display: none !important; }

/* Typography */
h1 { font-size: 3rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
h2 { font-size: 2rem; font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
.text-muted { color: var(--text-muted); }

/* =====================
   Buttons
   ===================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-size: 0.95rem;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    position: relative;
    overflow: hidden;
}
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0; left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.25), transparent);
    transform: skewX(-20deg);
    transition: left 0.5s ease;
}
.btn-primary:hover::before { left: 150%; }
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-dark), #3730a3); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(99,102,241,0.4); }

.btn-outline {
    background: var(--btn-outline-bg);
    border-color: var(--border);
    color: var(--text);
}
.btn-outline:hover { background: var(--bg-alt); border-color: var(--text-muted); }

.btn-lg { padding: 1rem 2rem; font-size: 1.1rem; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-full { width: 100%; }

.btn-danger { color: #ef4444; border-color: #fee2e2; }
.btn-danger:hover { background: #fef2f2; border-color: #ef4444; }

[data-theme="dark"] .btn-danger:hover { background: rgba(239, 68, 68, 0.1); }

/* Logo */
.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
}
.logo span { color: var(--primary); }

/* =====================
   Landing Page Nav
   ===================== */
.nav {
    height: 72px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
    border-bottom: 1px solid var(--border);
    transition: background 0.3s ease;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

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

/* =====================
   Hero Section
   ===================== */
.hero {
    padding: 5rem 0 3rem;
    text-align: center;
    background: radial-gradient(ellipse at top, var(--primary-light) 0%, transparent 60%);
    position: relative;
    overflow: hidden;
}

/* Ambient gradient orbs */
.hero::before,
.hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
    pointer-events: none;
    animation: floatOrb 8s ease-in-out infinite alternate;
}
.hero::before {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99,102,241,0.5), transparent 70%);
    top: -150px;
    right: -100px;
}
.hero::after {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(16,185,129,0.4), transparent 70%);
    bottom: 0;
    left: -80px;
    animation-delay: -4s;
}

@keyframes floatOrb {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(30px, -20px) scale(1.08); }
}

.hero h1 span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    max-width: 580px;
    margin: 1.5rem auto 2.5rem;
    font-size: 1.15rem;
    color: var(--text-muted);
}

.hero-btns { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }

/* =====================
   Hero Mockup (Rich Preview)
   ===================== */
.hero-mockup {
    margin-top: 4rem;
    perspective: 1200px;
}

.mockup-screen {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    max-width: 780px;
    margin: 0 auto;
    box-shadow: 0 30px 60px -15px rgba(0,0,0,0.2), 0 0 0 1px var(--border);
    transform: rotateX(6deg) scale(0.97);
    transform-origin: bottom center;
    overflow: hidden;
    transition: transform 0.3s ease;
}
.mockup-screen:hover { transform: rotateX(2deg) scale(0.99); }

.mockup-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
}

.mockup-logo {
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: -0.03em;
    color: var(--text);
}
.mockup-logo span { color: var(--primary); }

.mockup-pill {
    background: var(--primary);
    color: white;
    padding: 0.3rem 0.9rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
}

.mockup-body {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1.25rem;
}

.mockup-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
}
.mockup-card-hidden { opacity: 0.55; }

.mockup-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.6rem;
}
.mockup-tag-idea { background: #e0e7ff; color: #4338ca; }
.mockup-tag-draft { background: #fef3c7; color: #92400e; }
.mockup-tag-link { background: #d1fae5; color: #065f46; }

[data-theme="dark"] .mockup-tag-idea { background: #1e1b4b; color: #a5b4fc; }
[data-theme="dark"] .mockup-tag-draft { background: #451a03; color: #fbbf24; }
[data-theme="dark"] .mockup-tag-link { background: #022c22; color: #34d399; }

.mockup-card-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.mockup-card-text {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* =====================
   Features Section
   ===================== */
.features { padding: 5rem 0; background: var(--bg-alt); transition: background 0.3s ease; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 2rem; }
.feature-item {
    text-align: center;
    padding: 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform-style: preserve-3d;
}
.feature-item:hover {
    transform: perspective(800px) rotateX(-3deg) translateY(-6px);
    box-shadow: 0 20px 40px rgba(99,102,241,0.18), var(--glass-shadow);
    border-color: var(--primary);
}
.feature-icon { font-size: 2.5rem; margin-bottom: 1rem; }

.footer { padding: 3rem 0; text-align: center; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.9rem; background: var(--bg); }

/* =====================
   Auth Section
   ===================== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--bg);
}

.auth-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: var(--glass-shadow), 0 1px 0 var(--glass-border) inset;
    width: 100%;
    max-width: 440px;
    border: 1px solid var(--glass-border);
    transform: perspective(1000px) rotateX(0deg);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.auth-card:hover {
    transform: perspective(1000px) rotateX(1deg) translateY(-2px);
    box-shadow: var(--glass-shadow), 0 20px 60px rgba(99,102,241,0.15), 0 1px 0 var(--glass-border) inset;
}

.back-to-landing {
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    padding: 0;
}
.back-to-landing:hover { color: var(--text); }

.auth-card h1 { font-size: 1.75rem; margin-bottom: 0.5rem; text-align: left; }
#auth-subtitle { color: var(--text-muted); margin-bottom: 2rem; }

.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text); }
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s, background 0.2s;
    background: var(--bg);
    color: var(--text);
}
.form-group input:focus,
.form-group textarea:focus { outline: none; border-color: var(--primary); }

.auth-toggle { margin-top: 1.5rem; text-align: center; font-size: 0.95rem; color: var(--text-muted); }
.auth-toggle a { color: var(--primary); text-decoration: none; font-weight: 700; }

/* =====================
   Dashboard Header
   ===================== */
.dashboard-header {
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.875rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
    transition: background 0.3s ease;
}

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

.user-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.user-email-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =====================
   Dashboard Main
   ===================== */
.dashboard-main { padding: 2rem 1.5rem 4rem; }

.dashboard-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.ideas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

/* =====================
   Idea Cards
   ===================== */
.idea-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease, border-color 0.2s;
    display: flex;
    flex-direction: column;
    transform-style: preserve-3d;
    will-change: transform;
}
.idea-card:hover {
    transform: perspective(700px) rotateX(-4deg) rotateY(2deg) translateY(-6px) scale(1.01);
    box-shadow: 0 20px 40px rgba(99,102,241,0.2), var(--glass-shadow);
    border-color: var(--primary);
}

.idea-tag {
    display: inline-flex;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    width: fit-content;
}
.tag-idea { background: #e0e7ff; color: #4338ca; }
.tag-draft { background: #fef3c7; color: #92400e; }
.tag-link { background: #d1fae5; color: #065f46; }

[data-theme="dark"] .tag-idea { background: #1e1b4b; color: #a5b4fc; }
[data-theme="dark"] .tag-draft { background: #451a03; color: #fbbf24; }
[data-theme="dark"] .tag-link { background: #022c22; color: #34d399; }

.idea-card h3 { margin-bottom: 0.75rem; line-height: 1.3; font-size: 1.1rem; }
.idea-content { color: var(--text-muted); font-size: 0.93rem; margin-bottom: 1.25rem; flex-grow: 1; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.idea-url { font-size: 0.85rem; color: var(--primary); text-decoration: none; margin-bottom: 1.25rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.idea-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 1rem; border-top: 1px solid var(--border); margin-top: auto; }
.idea-date { font-size: 0.8rem; color: var(--text-muted); }
.idea-actions { display: flex; gap: 0.5rem; }

/* =====================
   Modals
   ===================== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-content {
    background: var(--modal-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 2rem;
    border-radius: 24px;
    width: 100%;
    max-width: 550px;
    box-shadow: var(--glass-shadow), 0 25px 50px rgba(0,0,0,0.15);
    border: 1px solid var(--border);
    max-height: 88vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: scale(0.92) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Webkit scrollbar (Chrome, Edge, Safari) */
.modal-content::-webkit-scrollbar {
    width: 5px;
}
.modal-content::-webkit-scrollbar-track {
    background: transparent;
}
.modal-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 100px;
}
.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.75rem; }
.close-modal { font-size: 1.5rem; cursor: pointer; color: var(--text-muted); line-height: 1; }
.close-modal:hover { color: var(--text); }

.type-selector { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.type-option { cursor: pointer; position: relative; }
.type-option input { position: absolute; opacity: 0; }
.type-option span {
    display: block;
    text-align: center;
    padding: 0.6rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    color: var(--text);
    background: var(--bg);
}
.type-option input:checked + span { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

.modal-footer { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }

.empty-state, .loading, .error-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-alt);
    border-radius: var(--radius);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* =====================
   Toast Notifications
   ===================== */
#toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    pointer-events: all;
    animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    max-width: 340px;
}

.toast.hiding { animation: toastSlideOut 0.3s ease-in forwards; }

.toast-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.toast-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.toast-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

[data-theme="dark"] .toast-success { background: #022c22; color: #34d399; border-color: #065f46; }
[data-theme="dark"] .toast-error { background: #450a0a; color: #f87171; border-color: #991b1b; }
[data-theme="dark"] .toast-info { background: #0c1a3a; color: #93c5fd; border-color: #1e40af; }

.toast-icon { font-size: 1.1rem; flex-shrink: 0; }

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(110%); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(110%); }
}

/* =====================
   Google Button
   ===================== */
.google-btn {
    gap: 0.75rem;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    color: var(--text);
    font-weight: 600;
    margin-top: 0.25rem;
}
.google-btn:hover { background: var(--bg-alt); border-color: var(--text-muted); transform: translateY(-1px); }

/* =====================
   Auth Divider
   ===================== */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.25rem 0 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* =====================
   Forgot Password
   ===================== */
.forgot-link {
    display: block;
    text-align: right;
    font-size: 0.8rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-top: 0.5rem;
}
.forgot-link:hover { text-decoration: underline; }

/* =====================
   Verification Banner
   ===================== */
.verification-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
    font-size: 0.9rem;
    font-weight: 500;
    flex-wrap: wrap;
}
[data-theme="dark"] .verification-banner { background: #451a03; border-color: #92400e; color: #fbbf24; }

/* =====================
   Dark Mode Toggle
   ===================== */
.dark-toggle-btn { padding: 0.5rem 0.75rem; font-size: 1rem; line-height: 1; }

/* =====================
   Button Loading State
   ===================== */
.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.btn.loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.btn-outline.loading::after {
    border-color: rgba(0,0,0,0.2);
    border-top-color: var(--primary);
}
[data-theme="dark"] .btn-outline.loading::after {
    border-color: rgba(255,255,255,0.15);
    border-top-color: var(--primary);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* =====================
   Mobile Responsiveness
   ===================== */
@media (max-width: 768px) {
    h1 { font-size: 2.1rem; }
    h2 { font-size: 1.5rem; }

    .hero { padding: 3.5rem 0 2rem; }
    .hero p { font-size: 1rem; }

    .nav-links .btn-outline:not(.dark-toggle-btn) { display: none; }

    /* Hero Mockup on mobile */
    .mockup-screen { transform: none; }
    .mockup-body { grid-template-columns: 1fr 1fr; }
    .mockup-card-hidden { display: none; }

    /* Auth */
    .auth-card { padding: 1.75rem 1.25rem; }

    /* Dashboard header */
    .user-email-label { display: none; }
    .user-controls { gap: 0.5rem; }

    /* Dashboard actions */
    .dashboard-actions { flex-direction: column; align-items: stretch; }
    .dashboard-actions > div { text-align: center; }
    .dashboard-actions .btn { width: 100%; }

    /* Ideas grid — single column */
    .ideas-grid { grid-template-columns: 1fr; }

    /* Modal full-screen on mobile */
    .modal { align-items: flex-end; padding: 0; }
    .modal-content {
        border-radius: 24px 24px 0 0;
        max-height: 92vh;
        padding: 1.75rem 1.25rem;
    }
    .modal-footer { flex-direction: column-reverse; }
    .modal-footer .btn { width: 100%; }

    /* Toast on mobile */
    #toast-container { left: 1rem; right: 1rem; top: 1rem; }
    .toast { max-width: 100%; }

    /* Features */
    .features { padding: 3rem 0; }

    /* Type selector */
    .type-selector { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    h1 { font-size: 1.85rem; }
    .container { padding: 0 1rem; }
    .mockup-body { grid-template-columns: 1fr; }
    .mockup-card:last-child { display: none; }
    .dashboard-main { padding: 1.5rem 1rem 3rem; }
}

/* =====================
   Confirm Delete Modal
   ===================== */
.confirm-modal-content {
    max-width: 400px;
    text-align: center;
    padding: 2.5rem 2rem;
}

.confirm-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    animation: confirmIconPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes confirmIconPop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.confirm-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.confirm-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.confirm-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-delete-confirm {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}
.btn-delete-confirm:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

@media (max-width: 480px) {
    .confirm-actions { flex-direction: column-reverse; }
    .confirm-actions .btn,
    .confirm-actions .btn-delete-confirm { width: 100%; }
}

/* ======================
   User Avatar (Initials)
   ====================== */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.01em;
    cursor: default;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    transition: box-shadow 0.2s;
}
.user-avatar:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); }

/* ======================
   Stats Bar
   ====================== */
.stats-bar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 1rem;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.1rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--glass-shadow);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.stat-num {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    letter-spacing: -0.03em;
    transition: color 0.3s;
}

.stat-idea { color: #6366f1; }
.stat-draft { color: #f59e0b; }
.stat-link { color: #10b981; }
.stat-pinned { color: #ec4899; }

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.stat-divider {
    width: 1px;
    height: 36px;
    background: var(--border);
    flex-shrink: 0;
}

/* ======================
   Action Buttons Group
   ====================== */
.action-btns {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-shrink: 0;
}

/* ======================
   Dashboard Toolbar
   (Search + Filters + Sort)
   ====================== */
.dashboard-toolbar {
    display: flex;
    gap: 0.875rem;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

/* Search */
.search-wrapper {
    position: relative;
    flex: 1;
    min-width: 180px;
}

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

.search-input {
    width: 100%;
    padding: 0.65rem 2.5rem 0.65rem 2.4rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1;
    padding: 0.2rem;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}
.search-clear:hover { background: var(--bg-alt); color: var(--text); }

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 0.5rem 1rem;
    border-radius: 100px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1;
}
.filter-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.filter-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Sort Select */
.sort-select {
    padding: 0.6rem 0.875rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.sort-select:focus { border-color: var(--primary); }
[data-theme="dark"] .sort-select option { background: #1e293b; }

/* ======================
   Card: Type-Accent Border
   ====================== */
.idea-card-idea  { border-left: 3px solid #6366f1; }
.idea-card-draft { border-left: 3px solid #f59e0b; }
.idea-card-link  { border-left: 3px solid #10b981; }

.idea-card-pinned {
    box-shadow: 0 0 0 2px var(--primary), 0 12px 30px rgba(99, 102, 241, 0.2);
}
.idea-card-pinned:hover {
    box-shadow: 0 0 0 2px var(--primary), 0 20px 40px rgba(99, 102, 241, 0.25) !important;
}

/* ======================
   Card Top Row (Tag + Pin)
   ====================== */
.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.card-top .idea-tag { margin-bottom: 0; }

.pin-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    opacity: 0.2;
    transition: opacity 0.2s, transform 0.2s;
    padding: 0.2rem;
    line-height: 1;
    border-radius: 4px;
    filter: grayscale(0.6);
}
.pin-btn:hover { opacity: 0.65; transform: scale(1.25); filter: grayscale(0); }
.pin-btn.pinned { opacity: 1; filter: grayscale(0); }

/* ======================
   Card Tags
   ====================== */
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
    margin-top: -0.25rem;
}

.card-tag {
    background: var(--bg-alt);
    color: var(--text-muted);
    padding: 0.15rem 0.55rem;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid var(--border);
    transition: all 0.15s;
}
.card-tag:hover { border-color: var(--primary); color: var(--primary); }

/* ======================
   Icon Button (Copy)
   ====================== */
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.4rem;
    border-radius: 6px;
    color: var(--text-muted);
    transition: all 0.18s;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}
.btn-icon:hover { background: var(--bg-alt); color: var(--text); transform: scale(1.1); }

/* ======================
   Password Show/Hide Toggle
   ====================== */
.password-wrapper {
    position: relative;
}
.password-wrapper input {
    padding-right: 3rem !important;
}
.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.2s;
    line-height: 0;
}
.password-toggle:hover { color: var(--primary); }

/* ======================
   Character Counters
   ====================== */
.char-counter {
    display: block;
    text-align: right;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    font-weight: 500;
    transition: color 0.2s;
}
.char-counter-warn { color: #f59e0b; }

/* ======================
   Label Hint
   ====================== */
.label-hint {
    font-size: 0.76rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* ======================
   Tags Input Wrapper
   ====================== */
.tags-input-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.5rem 0.6rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 48px;
    align-items: center;
    cursor: text;
}
.tags-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.tag-input {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text);
    flex: 1;
    min-width: 100px;
    padding: 0.2rem 0.3rem !important;
    width: auto !important;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.2rem 0.65rem 0.2rem 0.55rem;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.tag-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary);
    font-size: 1rem;
    line-height: 0.8;
    padding: 0;
    opacity: 0.6;
    font-weight: 400;
    display: inline-flex;
    align-items: center;
}
.tag-remove:hover { opacity: 1; }

/* ======================
   Detail View Modal
   ====================== */
.detail-modal-content {
    max-width: 620px;
}

.detail-modal-header {
    margin-bottom: 1rem;
}

.detail-title {
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 1.1rem;
    color: var(--text);
}

.detail-body {
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 1.1rem;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.97rem;
}

.detail-url-link {
    display: block;
    margin-bottom: 1rem;
}

.detail-tags-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.detail-meta {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    margin-bottom: 0;
}

/* ======================
   Mobile — New Elements
   ====================== */
@media (max-width: 768px) {
    .stats-bar {
        padding: 0.875rem 1rem;
        gap: 0.6rem;
        justify-content: space-between;
    }
    .stat-num { font-size: 1.35rem; }
    .stat-divider { height: 28px; }

    .dashboard-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }
    .search-wrapper { min-width: unset; }
    .filter-tabs { justify-content: flex-start; }
    .filter-tab { padding: 0.45rem 0.75rem; font-size: 0.78rem; }
    .sort-select { width: 100%; }

    .action-btns { gap: 0.5rem; }
    .action-btns .btn-sm { flex: 1; justify-content: center; }

    .detail-title { font-size: 1.2rem; }
}

@media (max-width: 480px) {
    .stat-divider { display: none; }
    .stats-bar { gap: 0.75rem; }
    .stat-num { font-size: 1.2rem; }

    .filter-tabs { gap: 0.3rem; }
    .filter-tab { font-size: 0.75rem; padding: 0.4rem 0.65rem; }

    .confirm-actions { gap: 0.6rem; }
    .confirm-actions .btn,
    .confirm-actions .btn-outline { flex: 1; justify-content: center; }
}

/* ======================
   How It Works Section
   ====================== */
.how-it-works {
    padding: 6rem 0;
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
}
.section-title {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 3.5rem;
    color: var(--text);
}
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
}
.step-card {
    background: var(--bg);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    text-align: center;
    position: relative;
}
.step-num {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.step-card h3 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
}
.step-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ======================
   Bulk Actions Bar
   ====================== */
.bulk-actions-bar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
}
.bulk-actions-bar.hidden {
    transform: translate(-50%, 150%);
    opacity: 0;
    pointer-events: none;
}
.bulk-count {
    font-weight: 700;
    color: var(--text);
    font-size: 0.9rem;
    white-space: nowrap;
}
.bulk-actions-group {
    display: flex;
    gap: 0.75rem;
}

/* Checkbox on Cards */
.idea-card {
    position: relative; /* ensure absolute positioning for checkbox works relative to card */
}
.card-checkbox {
    position: absolute;
    top: 1rem;
    left: -1rem; /* Adjust based on padding */
    transform: scale(1.3);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, left 0.2s;
}
.idea-card:hover .card-checkbox,
.card-checkbox:checked {
    opacity: 1;
    left: 1rem;
}

/* Profile Modal Disabled Input */
.disabled-input {
    background: var(--bg-alt);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Updated At Text */
.idea-updated-at {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    margin-left: 0.5rem;
}

/* User Avatar Clickable */
.user-avatar.clickable {
    cursor: pointer;
}
