/* Mobile-Native First CSS - Glassmorphism Edition (Dark Mode Enhanced) */
* {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    /* Glassmorphism Background */
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Ambient Background Blobs */
body::before {
    content: '';
    position: fixed;
    top: -20%;
    left: -20%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, var(--accent-light) 0%, transparent 70%);
    opacity: 0.8;
    z-index: -1;
    pointer-events: none;
    filter: blur(60px);
}

body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    right: -20%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, var(--accent-light) 0%, transparent 70%);
    opacity: 0.6;
    z-index: -1;
    pointer-events: none;
    filter: blur(60px);
}

/* Dark Mode Enhanced */
.dark body {
    background: #020617;
    /* Slate-950 for deeper contrast */
    background: linear-gradient(135deg, #020617 0%, #0f172a 100%);
}

.dark body::before {
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.3) 0%, transparent 70%);
    /* Increased opacity */
    opacity: 0.6;
    filter: blur(80px);
    /* Softer blur */
}

.dark body::after {
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.2) 0%, transparent 70%);
    opacity: 0.6;
    filter: blur(80px);
}

/* Dynamic Accent Colors */
:root {
    --accent-color: #3b82f6;
    --accent-light: #dbeafe;
    --accent-dark: #2563eb;
    --accent-rgb: 59, 130, 246;
}

[data-accent="blue"] {
    --accent-color: #3b82f6;
    --accent-light: #dbeafe;
    --accent-dark: #2563eb;
    --accent-rgb: 59, 130, 246;
}

[data-accent="green"] {
    --accent-color: #10b981;
    --accent-light: #d1fae5;
    --accent-dark: #059669;
    --accent-rgb: 16, 185, 129;
}

[data-accent="orange"] {
    --accent-color: #f97316;
    --accent-light: #ffedd5;
    --accent-dark: #ea580c;
    --accent-rgb: 249, 115, 22;
}

[data-accent="pink"] {
    --accent-color: #ec4899;
    --accent-light: #fce7f3;
    --accent-dark: #db2777;
    --accent-rgb: 236, 72, 153;
}

[data-accent="purple"] {
    --accent-color: #8b5cf6;
    --accent-light: #ede9fe;
    --accent-dark: #7c3aed;
    --accent-rgb: 139, 92, 246;
}

[data-accent="teal"] {
    --accent-color: #14b8a6;
    --accent-light: #ccfbf1;
    --accent-dark: #0f766e;
    --accent-rgb: 20, 184, 166;
}

/* Safe area for notched devices */
.safe-top {
    padding-top: env(safe-area-inset-top);
}

.safe-bottom {
    padding-bottom: env(safe-area-inset-bottom);
}

/* Mobile Header - Glass */
.mobile-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem;
}

.dark .mobile-header {
    background: rgba(2, 6, 23, 0.7);
    /* More transparent */
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    /* Sharper border */
    backdrop-filter: blur(20px);
}

/* Page Container */
.page-container {
    padding: 1rem;
    max-width: 600px;
    margin: 0 auto;
    min-height: calc(100vh - 140px);
    padding-bottom: 6rem;
    /* Space for bottom nav */
}

/* Content Card - Glass */
.content-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.6);
    margin-bottom: 1rem;
    transition: transform 0.2s;
}

.dark .content-card {
    background: rgba(30, 41, 59, 0.35);
    /* Transparency for depth */
    border: 1px solid rgba(255, 255, 255, 0.15);
    /* Crisper outline */
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    /* Deep shadow */
    backdrop-filter: blur(24px);
    color: #f1f5f9;
}

/* Headings */
.content-card h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: #111827;
}

.dark .content-card h1 {
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.content-card h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #1f2937;
}

.dark .content-card h2 {
    color: #f1f5f9;
}

.content-card p {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.dark .content-card p {
    color: #cbd5e1;
}

/* Info Badges/Pills if used in content */
.tech-pill {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.dark .tech-pill {
    background: rgba(var(--accent-rgb), 0.15);
    border: 1px solid rgba(var(--accent-rgb), 0.3);
    color: var(--accent-light);
}

/* Bottom action bar - Glass */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 40;
}

.dark .bottom-bar {
    background: rgba(2, 6, 23, 0.7);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
}

.bottom-bar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 64px;
}

.dark .bottom-bar-btn {
    color: #cbd5e1;
}

.bottom-bar-btn.active,
.dark .bottom-bar-btn.active {
    color: var(--accent-color);
    transform: scale(0.95);
}

/* Desktop optimization for these pages */
@media (min-width: 768px) {
    .bottom-bar {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 24px 24px 0 0;
        bottom: 0;
        border: 1px solid rgba(255, 255, 255, 0.5);
        border-bottom: none;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.05);
    }

    .dark .bottom-bar {
        border-color: rgba(255, 255, 255, 0.15);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    }
}