/*
 * PYTHON TUTORIALS — Dark Violet Design System
 */

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

:root {
    --primary: #7c3aed;
    --primary-dark: #5b21b6;
    --primary-light: #a78bfa;
    --accent: #a78bfa;
    --background: #09090f;
    --surface: #111118;
    --surface-2: #1a1a2e;
    --surface-light: #252540;
    --text-primary: #e2e8f0;
    --text-muted: #8892a4;
    --free-color: #22c55e;
    --free-bg: rgba(34, 197, 94, 0.08);
    --free-border: rgba(34, 197, 94, 0.25);
    --premium-color: #f59e0b;
    --premium-bg: rgba(245, 158, 11, 0.08);
    --premium-border: rgba(245, 158, 11, 0.25);
    --success: #22C55E;
    --warning: #F59E0B;
    --danger: #EF4444;

    --glass: rgba(17, 17, 24, 0.85);
    --glass-border: rgba(124, 58, 237, 0.2);
    --card-glass: rgba(26, 26, 46, 0.9);
    --card-border: rgba(124, 58, 237, 0.15);

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Prevent any horizontal overflow on all mobile browsers (including iOS Safari) */
html {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    background-color: var(--background);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100%;
    position: relative;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 900;
    line-height: 1.1;
    color: var(--text-primary);
}

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

/* Layout */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 5rem 0;
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    height: 80px;
    display: flex;
    align-items: center;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -1px;
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    font-weight: 500;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Hero */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 5rem);
    margin-bottom: 1.5rem;
}

.typing-text {
    color: var(--accent);
    border-right: 3px solid var(--primary);
    padding-right: 5px;
    animation: blink 0.7s infinite;
}

@keyframes blink {
    50% { border-color: transparent; }
}

.cta-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 3rem;
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    transform: scale(1.03);
    box-shadow: 0 0 24px rgba(124, 58, 237, 0.45);
    background: var(--primary-dark);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--surface-light);
    color: var(--text-primary);
}

.btn-ghost:hover {
    background: var(--surface-light);
    transform: scale(1.03);
}

/* Cards */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--card-glass);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 0 24px rgba(37, 99, 235, 0.4);
    border-color: var(--primary);
}

.badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
}

.badge-webshop { background: var(--primary); color: white; }
.badge-bot { background: var(--accent); color: var(--background); }

/* Product Detail */
.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.tag-pill {
    background: var(--surface-light);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--accent);
}

/* Cart */
.cart-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: 12px;
    margin-bottom: 1rem;
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: var(--transition);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .reveal, .card, .btn {
        transition: none !important;
        transform: none !important;
    }
}

/* ═══ PRICE CARDS ═══ */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.price-card {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem 2rem;
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.price-card:hover {
    transform: translateY(-15px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(37, 99, 235, 0.1);
}

.price-card.featured {
    border: 2px solid var(--primary);
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.05) 0%, var(--surface) 100%);
}

.price-card.featured::before {
    content: "POPULAR";
    position: absolute;
    top: 20px;
    right: -30px;
    background: var(--primary);
    color: white;
    padding: 5px 40px;
    font-size: 10px;
    font-weight: 900;
    transform: rotate(45deg);
}

.price-tier {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary);
    font-weight: 900;
    margin-bottom: 1rem;
    display: block;
}

.price-amount {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.price-currency {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.price-features {
    list-style: none;
    margin: 2rem 0;
    padding: 0;
}

.price-features li {
    padding: 0.8rem 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.price-features li::before {
    content: "✓";
    color: var(--success);
    font-weight: bold;
}

/* ═══ CODE TERMINAL ═══ */
.code-window {
    background: #0D1117;
    border-radius: 12px;
    border: 1px solid #30363D;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    overflow: hidden;
    font-family: var(--font-mono);
}

.code-header {
    background: #161B22;
    padding: 12px 20px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #30363D;
}

.dot { width: 10px; height: 10px; border-radius: 50%; }
.red { background: #FF5F56; }
.yellow { background: #FFBD2E; }
.green { background: #27C93F; }

.code-body {
    padding: 20px;
    font-size: 0.85rem;
    line-height: 1.6;
}

.code-line { display: flex; gap: 1rem; }
.line-no { color: #484F58; user-select: none; width: 20px; text-align: right; }
.line-content { color: #C9D1D9; }
.keyword { color: #FF7B72; }
.func { color: #D2A8FF; }
.string { color: #A5D6FF; }
.comment { color: #8B949E; }

/* ═══ PROJECT GLOW CARDS ═══ */
.card {
    position: relative;
    z-index: 1;
}

.card::after {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(45deg, var(--primary), var(--accent), var(--primary));
    z-index: -1;
    filter: blur(15px);
    opacity: 0;
    transition: var(--transition);
}

.card:hover::after {
    opacity: 0.3;
}

.price-card.featured {
    box-shadow: 0 0 40px rgba(37, 99, 235, 0.2);
}

/* ═══ MOBILE NAVBAR ═══ */
@media (max-width: 768px) {
    #mobile-toggle {
        display: flex !important;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 80px;
        left: 0;
        right: 0;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--glass-border);
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        z-index: 999;
    }

    .nav-links.mobile-open {
        display: flex;
    }

    .nav-links li {
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    .nav-links a {
        display: block;
        padding: 1rem 2rem;
    }

    .nav-links a::after {
        display: none;
    }
}

@media (min-width: 769px) {
    #mobile-toggle {
        display: none !important;
    }
}

/* ═══ WERBUNG / ADS ═══ */
.werbung-row {
    display: flex;
    gap: .75rem;
    overflow-x: auto;
    padding-bottom: .5rem;
    scrollbar-width: none;
}
.werbung-row::-webkit-scrollbar { display: none; }

.werbung-card {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: .9rem;
    background: var(--surface-2);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: .85rem 1.1rem;
    min-width: 240px;
    max-width: 320px;
    transition: border-color .2s;
    color: inherit;
    text-decoration: none;
}

/* ═══ MOBILE RESPONSIVE ═══ */
@media (max-width: 768px) {
    /* tighter container on phones */
    .container {
        padding: 0 1rem;
    }

    /* reduce section padding */
    section {
        padding: 2.5rem 0;
    }

    /* stack CTA buttons vertically */
    .cta-group {
        flex-direction: column;
        gap: 0.75rem;
    }
    .cta-group .btn {
        width: 100%;
        justify-content: center;
    }

    /* product detail grid → 1 col */
    .product-detail-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }

    /* footer grid → 1 col */
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    /* hide register button to save space; login still accessible */
    .nav-actions .btn-primary {
        display: none;
    }

    /* nav-actions ghost button smaller */
    .nav-actions .btn-ghost {
        padding: 0.4rem 0.7rem;
        font-size: 0.82rem;
    }

    /* tutorial list tut-card grid */
    .tut-grid {
        grid-template-columns: 1fr !important;
    }

    /* werbung: stack vertically on mobile */
    .werbung-row {
        flex-direction: column;
        overflow-x: visible;
    }
    .werbung-card {
        flex-shrink: unset;
        min-width: unset;
        max-width: unset;
        width: 100%;
    }

    /* stats grid in admin */
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    /* very small screens — even tighter padding */
    .container {
        padding: 0 0.75rem;
    }
    section {
        padding: 2rem 0;
    }
    /* single-col tcard grid already covered at 600px in page CSS */
}

/* ═══ AUTH INPUT STYLE ═══ */
.auth-input {
    width: 100%;
    padding: 1rem 1.2rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    color: white;
    font-size: 0.95rem;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.2s;
}

.auth-input:focus {
    border-color: rgba(56,189,248,0.4);
}

.auth-input::placeholder {
    color: #475569;
}

.auth-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

/* ═══ MOBILE GLOBAL ENHANCEMENTS ═══ */

/* Minimum touch target size for all interactive elements */
@media (max-width: 768px) {
    /* Buttons at least 44px tall */
    .btn {
        min-height: 44px;
    }

    /* Auth inputs: comfortable tap area */
    .auth-input, input[type="text"], input[type="email"],
    input[type="password"], input[type="url"], select, textarea {
        font-size: 1rem; /* Prevents iOS auto-zoom */
        min-height: 44px;
    }

    /* Hero: fill viewport below navbar */
    .hero {
        height: auto;
        min-height: calc(100vh - 80px);
        min-height: calc(100svh - 80px);
        padding: 2.5rem 0 4rem;
    }

    /* Login & Register – responsive card padding */
    .auth-page-card {
        padding: clamp(1.5rem, 5vw, 4rem) !important;
        border-radius: 20px !important;
    }

    /* Collapse 2-column registration grids */
    .reg-grid-2 {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Admin dashboard overview grid: KPIs + sidebar → stack */
    .dash-overview-grid {
        grid-template-columns: 1fr !important;
    }

    /* Community upload: category + difficulty → stack */
    .upload-cat-grid {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    /* Profil: fix span 2 in 1-col layout */
    .bio-full-width {
        grid-column: span 1 !important;
    }

    /* Better table scrolling */
    .tbl, .data-table {
        font-size: 0.78rem;
    }

    /* Panel padding reduced */
    .panel-head {
        padding: 0.85rem 1rem;
    }

    /* Section titles comfortable */
    h1 {
        word-break: break-word;
    }
}

@media (max-width: 480px) {
    /* Very small screens */
    .upload-card {
        padding: 1.25rem !important;
        border-radius: 16px !important;
    }

    .profile-card {
        padding: 1.25rem !important;
    }

    /* Hero orbs: smaller on tiny screens */
    .hero-orb-1 { width: 200px !important; height: 200px !important; }
    .hero-orb-2 { width: 160px !important; height: 160px !important; }

    /* KPI values smaller on tiny screens */
    .kpi-val { font-size: 1.6rem !important; }

    /* Tutorial card actions stack */
    .tcard-actions { flex-direction: column; }
    .tcard-actions a { flex: unset; width: 100%; }
}

/* ═══ MOBILE EXCELLENCE — Comprehensive UX ═══ */

/* ── Hero full-screen mobile ── */
@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr !important; gap: 0 !important; }
    .hero-code-col { display: none !important; }
    .steps-grid { grid-template-columns: 1fr !important; gap: 1rem !important; }
}

@media (max-width: 768px) {
    /* Hero: fill visible area below 80px navbar — handled by FULLSCREEN MOBILE HERO block below */

    /* Stat bar: compact flex-wrap, smaller gap */
    .stat-bar {
        gap: 1.5rem !important;
        margin-top: 2rem !important;
        padding-top: 1.5rem !important;
    }
    .stat-num { font-size: 1.8rem !important; }

    /* Hero orbs: scale down on mobile */
    .hero-orb-1 { width: 260px !important; height: 260px !important; top: -60px !important; right: -40px !important; }
    .hero-orb-2 { width: 180px !important; height: 180px !important; }

    /* Hero title tight on mobile */
    .hero-title { letter-spacing: -1px !important; }

    /* Hero eyebrow badge */
    .hero-eyebrow { font-size: .72rem !important; padding: .35rem .85rem .35rem .6rem !important; }

    /* CTAs: full-width stack */
    div[style*="display:flex; gap:1rem; flex-wrap:wrap"] .btn,
    div[style*="display:flex;gap:1rem;flex-wrap:wrap"] .btn { width: 100%; justify-content: center; }

    /* Step cards: comfortable mobile padding */
    .step-card { padding: 1.5rem 1.25rem !important; }
    .step-num  { font-size: 2.2rem !important; }

    /* Tutorial mini cards: full-width on small screens */
    .tcard-grid { grid-template-columns: 1fr !important; gap: .85rem !important; }
    .tcard-body { padding: 1rem !important; }
    .tcard-actions { flex-direction: row !important; }
    .tcard-actions a { flex: 1 !important; width: auto !important; font-size: .78rem !important; }

    /* Community teaser: mobile padding */
    .community-teaser { padding: 2rem 1.25rem !important; border-radius: 16px !important; }

    /* Category chips: wrap naturally */
    .cat-chip { font-size: .8rem !important; padding: .45rem .9rem !important; }

    /* Tutorial list: filters stack */
    .filter-bar { flex-direction: column !important; gap: .6rem !important; }
    .filter-bar select { width: 100% !important; min-height: 44px; font-size: 1rem; }

    /* Tutorial list cards: better mobile sizing */
    .tut-grid { grid-template-columns: 1fr !important; gap: 1rem !important; }
    .tut-card { border-radius: 14px !important; }

    /* Like button: comfortable tap target */
    .like-btn { padding: .5rem 1rem !important; font-size: .85rem !important; min-height: 38px; }

    /* Gaestebuch / comments */
    .comment-grid { grid-template-columns: 1fr !important; }

    /* Tutorial detail header */
    .tut-detail-header { padding: 3rem 0 2rem !important; }

    /* Community list cards */
    .community-card { border-radius: 14px !important; }

    /* Profil form grid */
    .profile-form-grid { grid-template-columns: 1fr !important; }

    /* Password reset form */
    .auth-page-card { border-radius: 18px !important; }

    /* Footer: tighter */
    footer { padding: 2.5rem 0 2rem !important; }
    .footer-grid { gap: 1.75rem !important; }

    /* Admin table: horizontal scroll wrapper hint */
    .panel > div[style*="overflow-x:auto"] { -webkit-overflow-scrolling: touch; }

    /* Werbung banner: full width on mobile */
    .werbung-card {
        min-width: unset !important;
        max-width: unset !important;
        width: 100% !important;
    }
}

/* ── 480px: very small phones (iPhone SE etc.) ── */
@media (max-width: 480px) {
    /* Container: minimal horizontal padding */
    .container { padding: 0 .85rem !important; }
    section { padding: 1.75rem 0 !important; }

    /* Hero */
    .hero-title { font-size: clamp(2rem, 8vw, 2.6rem) !important; }

    /* Steps: even tighter */
    .step-card { padding: 1.25rem 1rem !important; border-radius: 14px !important; }

    /* Tutorial cards: no overflow risk */
    .tcard-actions { flex-direction: column !important; }
    .tcard-actions a { flex: unset !important; width: 100% !important; }

    /* Stat bar: 3 items in a row, smaller */
    .stat-bar { gap: 1rem !important; justify-content: space-between !important; }
    .stat-num { font-size: 1.5rem !important; }
    .stat-lbl { font-size: .62rem !important; }

    /* Admin KPI values */
    .kpi-val { font-size: 1.5rem !important; }

    /* Community teaser */
    .community-teaser { padding: 1.75rem 1rem !important; }

    /* Filter bar dropdowns */
    .filter-bar select { padding: .75rem .85rem !important; }

    /* Hero orbs: very small */
    .hero-orb-1 { width: 160px !important; height: 160px !important; }
    .hero-orb-2 { width: 120px !important; height: 120px !important; }

    /* Code window: hide on tiny screens (< 480px was already hidden via 900px rule) */

    /* Action buttons in admin tables: stack */
    .action-btns { flex-direction: column !important; align-items: flex-end !important; }
}

/* ── Prevents body scroll when mobile nav is open ── */
body.nav-open { overflow: hidden; }

/* ── Improved mobile nav items ── */
@media (max-width: 768px) {
    .nav-links a {
        font-size: 1.05rem;
        padding: 1rem 1.5rem !important;
        letter-spacing: .01em;
    }
    .nav-links li:last-child { border-bottom: none; }

    /* Show register button on small screens again (hidden to save space, but UX matters) */
    .nav-actions .btn-primary { display: inline-flex !important; }
    .nav-actions .btn-primary,
    .nav-actions .btn-ghost { font-size: .78rem !important; padding: .4rem .75rem !important; }

    /* Tutorial list section header */
    .section-divider h2 { font-size: 1.25rem !important; }

    /* Admin section headers */
    .section-hdr span { font-size: .6rem !important; }

    /* Empty state padding */
    .empty-state { padding: 2rem 1rem !important; }
}

/* ── Safe area insets for notched phones ── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    footer { padding-bottom: calc(2rem + env(safe-area-inset-bottom)) !important; }
    .nav-links.mobile-open { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
}


/* ═══════════════════════════════════════════════════════════
   MOBILE BOTTOM NAVIGATION BAR
   ═══════════════════════════════════════════════════════════ */

.mobile-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    /* Show the bottom nav */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 2000;
        background: rgba(17, 17, 24, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(124, 58, 237, 0.2);
        padding: 0.35rem 0.5rem;
        padding-bottom: calc(0.35rem + env(safe-area-inset-bottom, 0px));
        gap: 0;
        justify-content: space-around;
        align-items: stretch;
    }

    .mbn-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.2rem;
        padding: 0.4rem 0.5rem;
        border-radius: 10px;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 0.58rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        min-width: 48px;
        transition: color 0.2s, background 0.2s;
        -webkit-tap-highlight-color: transparent;
    }

    .mbn-item svg {
        flex-shrink: 0;
        transition: stroke 0.2s;
    }

    .mbn-item:hover,
    .mbn-item:active {
        color: var(--primary-light);
        background: rgba(124, 58, 237, 0.1);
    }

    .mbn-item.mbn-active {
        color: var(--primary-light);
        background: rgba(124, 58, 237, 0.12);
    }

    .mbn-item.mbn-active svg {
        stroke: var(--primary-light);
    }

    /* Push page content above the bottom nav */
    body {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }

    /* Hide desktop nav links on mobile entirely (bottom nav takes over) */
    .nav-links {
        display: none !important;
    }
    .nav-links.mobile-open {
        display: flex !important;
    }

    /* Hide register button in nav-actions on mobile to save space */
    .nav-actions .btn-primary { display: none !important; }
    .nav-actions .btn-ghost {
        font-size: 0.8rem !important;
        padding: 0.4rem 0.8rem !important;
    }

    /* Ensure footer doesn't overlap bottom nav */
    footer {
        padding-bottom: calc(3rem + env(safe-area-inset-bottom, 0px)) !important;
    }
}


/* ═══════════════════════════════════════════════════════════
   MOBILE FORM EXCELLENCE
   Better touch targets, spacing, and visual clarity
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* All inputs: comfortable touch targets, no iOS zoom */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="url"],
    input[type="tel"],
    input[type="search"],
    input[type="number"],
    select,
    textarea {
        font-size: 1rem !important;
        min-height: 48px;
        border-radius: 12px;
        padding: 0.85rem 1rem;
    }

    textarea {
        min-height: 100px;
    }

    /* Buttons: full touch area */
    .btn, button[type="submit"] {
        min-height: 48px;
        font-size: 1rem;
    }

    /* Form containers: better padding on mobile */
    form {
        width: 100%;
    }

    /* Select dropdowns: native look improvement */
    select {
        -webkit-appearance: none;
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238892a4' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        padding-right: 36px !important;
    }
}


/* ═══════════════════════════════════════════════════════════
   FULLSCREEN MOBILE HERO
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    /*
     * Hero fills the viewport BELOW the 80px sticky navbar.
     * Order matters: fallback first, modern override last.
     * Browser ignores units it doesn't understand, last valid wins.
     */
    .home-hero,
    section[style*="min-height:88vh"],
    section[style*="min-height: 88vh"] {
        min-height: calc(100vh - 80px) !important;
        min-height: calc(100svh - 80px) !important;
        padding: 2.5rem 0 4.5rem !important;
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        contain: layout paint;
        background: radial-gradient(ellipse at 80% 20%, rgba(124,58,237,.1) 0%, transparent 60%),
                    radial-gradient(ellipse at 10% 80%, rgba(56,189,248,.07) 0%, transparent 50%),
                    var(--background) !important;
    }

    /* Center hero text content on mobile */
    .hero-left {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-desc {
        max-width: 100% !important;
        text-align: center !important;
    }

    .stat-bar {
        justify-content: center !important;
        width: 100% !important;
    }

    /* Eyebrow badge: centered */
    .hero-eyebrow {
        align-self: center;
    }

    /* Orbs: vivid on mobile, kept within bounds to prevent horizontal overflow */
    .hero-orb-1 {
        width: 300px !important;
        height: 300px !important;
        top: -80px !important;
        right: -40px !important;
        background: rgba(124,58,237,.22) !important;
        filter: blur(60px) !important;
    }
    .hero-orb-2 {
        width: 240px !important;
        height: 240px !important;
        bottom: 0 !important;
        left: -40px !important;
        background: rgba(56,189,248,.14) !important;
        filter: blur(50px) !important;
    }

    /* Glowing top-of-hero accent line */
    .home-hero::before {
        content: '';
        position: absolute;
        top: 0; left: 0; right: 0;
        height: 2px;
        background: linear-gradient(90deg, transparent 0%, var(--primary) 30%, #c084fc 60%, #38bdf8 80%, transparent 100%);
        z-index: 3;
        opacity: 0.8;
    }

    /* Stat bar: even spacing on mobile */
    .stat-divider {
        display: none !important;
    }

    /* Hero CTA: full-width stacked buttons */
    .hero-cta {
        flex-direction: column !important;
        width: 100% !important;
        gap: .75rem !important;
    }
    .hero-cta-primary,
    .hero-cta-secondary {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 1rem 1.5rem !important;
        font-size: 1rem !important;
        min-height: 52px !important;
        box-sizing: border-box !important;
        display: flex !important;
        align-items: center !important;
    }

    /* Login / register pages: full height */
    section[style*="min-height: 100svh"],
    section[style*="min-height:100svh"] {
        min-height: 100svh !important;
        padding: 5rem 0 4rem !important;
    }
}


/* ═══════════════════════════════════════════════════════════
   MOBILE CARD IMPROVEMENTS
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* Tutorial cards: full width, no margin issues */
    .tut-card, .tcard, .com-card {
        border-radius: 14px !important;
    }

    /* Card action buttons: easier to tap */
    .tcard-actions a,
    .tca-btn,
    .com-body a[style*="border-radius"] {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Like buttons: bigger tap area */
    .like-btn, .gb-like-btn {
        min-height: 40px;
        padding: 0.5rem 1rem !important;
    }

    /* Badge pills: readable size */
    .badge-pill, .tca-badge, .sbadge {
        font-size: 0.65rem !important;
        padding: 0.25rem 0.6rem !important;
    }

    /* Section headings: comfortable */
    .section-divider h2 {
        font-size: 1.3rem !important;
    }

    /* Panel headers: comfortable padding */
    .panel-head {
        padding: 0.9rem 1rem !important;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Admin KPI grid: 3 per row on medium, 2 on tiny */
    .kpi-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.6rem !important;
    }

    .kpi {
        padding: 0.9rem 0.75rem !important;
        border-radius: 12px !important;
    }

    /* Admin tutorial cards: 1 col */
    .tut-cards {
        grid-template-columns: 1fr !important;
        padding: 0.75rem !important;
    }

    /* Community teaser buttons: stack */
    .community-teaser > div[style*="display:flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .community-teaser a {
        text-align: center !important;
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Section padding: ultra compact */
    section { padding: 1.5rem 0 !important; }

    /* KPI values: compact */
    .kpi-val { font-size: 1.4rem !important; }
    .kpi-lbl { font-size: 0.52rem !important; }

    /* Tutorial card actions: vertical stack */
    .tcard-actions {
        flex-direction: column !important;
    }
    .tcard-actions a {
        width: 100% !important;
        flex: unset !important;
    }

    /* Stat bar: compact */
    .stat-bar { gap: 0.75rem !important; }
    .stat-num { font-size: 1.4rem !important; }
}


/* ═══════════════════════════════════════════════════════════
   MOBILE ADMIN DASHBOARD IMPROVEMENTS
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 700px) {
    /* Dashboard overview: single column */
    .dash-overview-grid {
        grid-template-columns: 1fr !important;
    }

    /* Admin table: horizontal scroll with touch */
    .tbl-scroll-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Admin action links: bigger tap targets */
    .alink {
        min-height: 36px;
        display: inline-flex;
        align-items: center;
    }

    /* Quick action buttons */
    .qbtn {
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    /* Community card in admin: comfortable */
    .tut-card-admin {
        padding: 1rem !important;
    }

    .tca-actions {
        flex-direction: column !important;
    }

    .tca-btn {
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}


/* ═══════════════════════════════════════════════════════════
   MOBILE COMMENT / GAESTEBUCH IMPROVEMENTS
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
    .gb-comment {
        padding: 1rem !important;
        border-radius: 12px !important;
    }

    .gb-avatar {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.85rem !important;
    }

    .gb-reply {
        padding: 0.9rem !important;
    }

    /* Form submit button: full width on mobile */
    .gb-form-submit {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Comment textarea: comfortable */
    .gb-textarea {
        min-height: 90px;
    }
}


/* ═══════════════════════════════════════════════════════════
   GENERAL MOBILE TOUCH UX
   ═══════════════════════════════════════════════════════════ */

/* Remove tap highlight on interactive elements */
@media (max-width: 768px) {
    a, button, [role="button"] {
        -webkit-tap-highlight-color: transparent;
    }

    /* Smooth scrolling */
    html {
        scroll-behavior: smooth;
    }

    /* Prevent text selection on tap-hold for nav elements */
    .navbar, .mobile-bottom-nav {
        user-select: none;
        -webkit-user-select: none;
    }
}
