/* ============================================================
   OWN YOUR CHOICES – MODERN BENTO BOX UI
   Dual Theme: Light (#F8F9FA) / Dark (#2C2C2C)
   Accent: Orange #FF5E0E
   Typography: Inter (body), Space Grotesk (headings)
   ============================================================ */

/* ----- CSS Custom Properties (Themes) ----- */
:root {
    /* Light Mode (default) */
    --bg-primary: #F8F9FA;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-input: #FFFFFF;
    --bg-header: #FFFFFF;
    --bg-footer: #1A1A1A;
    --text-primary: #1A1A1A;
    --text-secondary: #4A4A4A;
    --text-muted: #888888;
    --text-inverse: #FFFFFF;
    --border-color: #E5E7EB;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.10);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #2C2C2C;
    --bg-secondary: #3A3A3A;
    --bg-card: #3A3A3A;
    --bg-input: #3A3A3A;
    --bg-header: #2C2C2C;
    --bg-footer: #1A1A1A;
    --text-primary: #FFFFFF;
    --text-secondary: #C8C8C8;
    --text-muted: #888888;
    --text-inverse: #1A1A1A;
    --border-color: #4A4A4A;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
}

/* Accent color (always same) */
:root {
    --accent: #FF5E0E;
    --accent-hover: #E0520C;
    --accent-light: rgba(255, 94, 14, 0.12);
    --accent-dark: #CC4A0A;
}

/* ----- Reset & Base ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition), color var(--transition);
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* ----- Container ----- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ----- Typography ----- */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    transition: color var(--transition);
}

h1 { font-size: 3.2rem; letter-spacing: -0.02em; }
h2 { font-size: 2.4rem; letter-spacing: -0.01em; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.2rem; }

.section-title {
    font-size: 2.6rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}
.section-title .highlight {
    color: var(--accent);
}
.section-sub {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    max-width: 600px;
}
.section-tag {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    background: var(--accent-light);
    padding: 0.2rem 0.8rem;
    border-radius: 50px;
    margin-bottom: 0.5rem;
}
.section-header {
    margin-bottom: 2.5rem;
}

p {
    color: var(--text-secondary);
    transition: color var(--transition);
}

/* ----- Buttons ----- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.8rem;
    border-radius: 50px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--accent);
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(255, 94, 14, 0.35);
}
.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 94, 14, 0.4);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}
.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.4rem 1.2rem;
    font-size: 0.85rem;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}
.btn-outline:hover {
    background: var(--accent);
    color: #FFFFFF;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ----- Theme Toggle ----- */
.theme-toggle {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
}
.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ----- Header ----- */
.site-header {
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,0.85);
    transition: background var(--transition), border-color var(--transition);
}
[data-theme="dark"] .site-header {
    background: rgba(44,44,44,0.92);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 0;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--text-primary);
}
.logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}
.main-nav a {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
    padding: 0.3rem 0;
    border-bottom: 3px solid transparent;
    transition: all var(--transition);
}
.main-nav a:hover,
.main-nav a.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.points-badge {
    background: var(--accent);
    color: #FFFFFF;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--text-primary);
    cursor: pointer;
}

/* Mobile nav */
@media (max-width: 768px) {
    .main-nav {
        display: none;
        width: 100%;
        padding: 1rem 0;
        border-top: 1px solid var(--border-color);
    }
    .main-nav.open { display: block; }
    .main-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0.15rem;
    }
    .main-nav ul li {
        width: 100%;
    }
    .main-nav ul li a {
        display: block;
        padding: 0.75rem 0.25rem;
        border-bottom: 1px solid var(--border-color);
        width: 100%;
    }
    .main-nav ul li a:hover,
    .main-nav ul li a.active {
        border-bottom: 1px solid var(--border-color);
        color: var(--accent);
    }
    .main-nav ul li:last-child a {
        border-bottom: none;
    }
    /* Align header top-nav icons (theme toggle + points badge) on mobile */
    .header-actions {
        gap: 0.6rem;
    }
    .points-badge {
        height: 40px;
        padding: 0 0.8rem;
        justify-content: center;
        box-sizing: border-box;
    }
}

/* ----- Mobile Bottom Navigation ----- */
.bottom-nav {
    display: none;
}
@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 120;
        background: var(--bg-header);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .bottom-nav__item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.2rem;
        padding: 0.5rem 0 0.45rem;
        font-family: inherit;
        font-size: 0.62rem;
        font-weight: 600;
        line-height: 1;
        color: var(--text-secondary);
        background: none;
        border: none;
        cursor: pointer;
        text-decoration: none;
        transition: color var(--transition);
    }
    .bottom-nav__item i {
        font-size: 1.15rem;
    }
    .bottom-nav__item.active,
    .bottom-nav__item.active i,
    .bottom-nav__more.active,
    .bottom-nav__more.active i {
        color: var(--accent);
    }
    .bottom-nav__item:active {
        opacity: 0.75;
    }
    /* Reserve space so footer content is not hidden behind the fixed bar */
    body {
        padding-bottom: calc(64px + env(safe-area-inset-bottom));
    }
}

/* ----- Bento Box Cards ----- */
.bento-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.8rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition);
    border: 1px solid var(--border-color);
}
.bento-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.bento-card--large {
    grid-column: span 2;
}
.bento-card--small {
    grid-column: span 1;
}

/* ----- Hero Bento ----- */
.hero {
    padding: 3rem 0 2rem;
}
.hero-bento {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-auto-rows: auto;
    gap: 1.5rem;
}

.hero-main {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hero-content h1 {
    font-size: 3.8rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
}
.hero-content h1 .highlight {
    color: var(--accent);
    background: var(--accent-light);
    padding: 0 0.2rem;
    border-radius: 4px;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--accent-light);
    color: var(--accent);
    padding: 0.2rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
}
.hero-sub {
    font-size: 1.15rem;
    max-width: 500px;
    color: var(--text-secondary);
    margin-bottom: 1.8rem;
}
.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}
.hero-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.stat-item {
    display: flex;
    flex-direction: column;
}
.stat-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}
.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.stat-divider {
    width: 1px;
    background: var(--border-color);
}

/* Hero side cards */
.hero-side {
    padding: 1.5rem;
    display: flex;
    align-items: center;
}
.hero-side .side-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.hero-side .side-icon {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 0.3rem;
}
.hero-side h4 {
    font-weight: 600;
    margin-bottom: 0.1rem;
}
.hero-side p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

@media (max-width: 992px) {
    .hero-bento {
        grid-template-columns: 1fr;
    }
    .hero-main {
        grid-column: 1;
        grid-row: auto;
    }
    .hero-side {
        grid-column: 1;
    }
    .hero-content h1 { font-size: 2.8rem; }
}
@media (max-width: 600px) {
    .hero-stats { flex-wrap: wrap; gap: 1rem; }
    .stat-divider { display: none; }
    .hero-content h1 { font-size: 2.2rem; }
}

/* ----- How It Works (Bento Grid) ----- */
.how-it-works {
    padding: 3rem 0;
}
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.bento-card .card-icon {
    font-size: 2.6rem;
    color: var(--accent);
    margin-bottom: 0.8rem;
}
.bento-card h3 {
    font-weight: 700;
    margin-bottom: 0.3rem;
}
.bento-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
}

/* ----- Quiz Carousel ----- */
.quiz-section {
    padding: 2rem 0;
}
.quiz-carousel-wrapper {
    position: relative;
    overflow: hidden;
}
.quiz-carousel {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0.5rem 0.2rem 1rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.quiz-carousel::-webkit-scrollbar { display: none; }

.quiz-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.quiz-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.quiz-card h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}
.quiz-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}
.quiz-card .btn {
    font-size: 0.85rem;
}

.carousel-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}
.carousel-btn {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
}
.carousel-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.carousel-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ----- Leaderboard ----- */
.leaderboard-section {
    padding: 2rem 0;
}
.bento-card--table {
    padding: 0;
    overflow: hidden;
}
.leaderboard-table-wrapper {
    overflow-x: auto;
    padding: 0.5rem;
}
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}
.leaderboard-table th {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
}
.leaderboard-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}
.leaderboard-table tr:last-child td {
    border-bottom: none;
}
.leaderboard-table .empty-state {
    text-align: center;
    color: var(--text-muted);
}

/* ----- Safety Corner ----- */
.safety-section {
    padding: 2rem 0;
}
.safety-bento {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}
.safety-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.8rem 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all var(--transition);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    text-align: center;
}
.safety-btn i {
    font-size: 2rem;
    color: var(--accent);
}
.safety-btn:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}
.safety-btn.emergency-exit {
    background: var(--accent);
    color: #FFFFFF;
    border-color: var(--accent);
}
.safety-btn.emergency-exit i {
    color: #FFFFFF;
}
.safety-btn.emergency-exit:hover {
    background: var(--accent-hover);
}

@media (max-width: 768px) {
    .safety-bento {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 480px) {
    .safety-bento {
        grid-template-columns: 1fr;
    }
}

/* ----- Footer ----- */
.site-footer {
    background: var(--bg-footer);
    color: #D3D3D3;
    padding: 2.5rem 0 1.5rem;
    margin-top: 2rem;
    border-top: 4px solid var(--accent);
}
.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}
.footer-brand h3 {
    color: #FFFFFF;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
}
.footer-brand p {
    color: #A7A7A7;
    margin: 0.3rem 0 1rem;
}
.footer-socials {
    display: flex;
    gap: 1rem;
}
.footer-socials a {
    color: #D3D3D3;
    font-size: 1.4rem;
    transition: color var(--transition);
}
.footer-socials a:hover {
    color: var(--accent);
}
.footer-links a {
    display: block;
    color: #A7A7A7;
    padding: 0.2rem 0;
    transition: color var(--transition);
}
.footer-links a:hover {
    color: #FFFFFF;
}
.footer-copy {
    grid-column: 1 / -1;
    text-align: center;
    border-top: 1px solid #3A3A3A;
    padding-top: 1.5rem;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #777777;
}

/* ----- Modals ----- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}
.modal-overlay.active {
    display: flex;
}
.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    max-width: 520px;
    width: 100%;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition);
}
.modal-close:hover {
    color: var(--text-primary);
}
.modal h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 1rem;
}
.modal-sub {
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
}

/* ----- Share Modal ----- */
.share-socials {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 0.6rem;
    margin: 1rem 0 1.2rem;
}
.share-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.9rem 0.5rem;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition);
}
.share-tile i {
    font-size: 1.3rem;
    color: var(--text-primary);
}
.share-tile:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}
.share-tile:hover i {
    color: var(--accent);
}
.share-tile--native {
    background: var(--accent);
    border-color: var(--accent);
    color: #FFFFFF;
}
.share-tile--native i {
    color: #FFFFFF;
}
.share-tile--native:hover {
    background: var(--accent-hover);
    color: #FFFFFF;
}
.share-tile--native:hover i {
    color: #FFFFFF;
}
.share-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    text-align: center;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}
.share-qr-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.qr-box {
    padding: 0.75rem;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

/* ----- Form Elements ----- */
.form-group {
    margin-bottom: 1.2rem;
}
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: border-color var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Helpline list */
.helpline-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}
.helpline-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}
.helpline-list li:last-child {
    border-bottom: none;
}
.helpline-list a {
    color: var(--accent);
    font-weight: 600;
}
.helpline-note {
    font-weight: 600;
    text-align: center;
    margin-top: 1rem;
    color: var(--text-secondary);
}

/* ----- Community (Social Cards) ----- */
.social-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.social-card:hover {
    box-shadow: var(--shadow-md);
}
.card-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}
.card-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.card-user {
    font-weight: 600;
    color: var(--text-primary);
}
.card-user span {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-left: 0.3rem;
}
.card-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: auto;
}
.card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 0.2rem;
}
.card-body {
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
}
.card-actions {
    display: flex;
    gap: 1.5rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border-color);
}
.card-actions button {
    background: none;
    border: none;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color var(--transition);
}
.card-actions button:hover {
    color: var(--accent);
}

/* Replies */
.replies-container {
    margin-top: 0.8rem;
    padding-left: 1rem;
    border-left: 3px solid var(--accent);
}
.reply-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 0.8rem;
}
.reply-item:last-child {
    border-bottom: none;
}
.reply-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.reply-user {
    font-weight: 600;
    font-size: 0.9rem;
}
.reply-user span {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-left: 0.3rem;
}
.reply-text {
    color: var(--text-secondary);
}
.reply-form-container {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.6rem;
}
.reply-form-container textarea {
    flex: 1;
    padding: 0.5rem 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    resize: none;
    height: 44px;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color var(--transition);
}
.reply-form-container textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.reply-form-container button {
    background: var(--accent);
    color: #FFFFFF;
    border: none;
    border-radius: 50px;
    padding: 0.4rem 1.2rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    transition: background var(--transition);
}
.reply-form-container button:hover {
    background: var(--accent-hover);
}

/* Stories Grid */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.story-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.story-card:hover {
    box-shadow: var(--shadow-md);
}
.story-card h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    margin-bottom: 0.3rem;
}
.story-card p {
    color: var(--text-secondary);
}
.story-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.8rem;
}

/* ----- Profile Page ----- */
.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}
.profile-name {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.profile-name h2 {
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}
.stat-card i {
    font-size: 2rem;
    color: var(--accent);
}
.stat-value {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 2rem;
    color: var(--text-primary);
}
.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}
.badge-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.badge-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.badge-item i {
    font-size: 2.4rem;
    color: var(--accent);
}
.badge-name {
    font-weight: 700;
    display: block;
    margin-top: 0.2rem;
}
.badge-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.history-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}
.history-table {
    width: 100%;
    border-collapse: collapse;
}
.history-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    padding: 0.7rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
}
.history-table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border-color);
}
.history-table tr:last-child td {
    border-bottom: none;
}

/* Journal */
.journal-section {
    margin: 2rem 0;
}
.journal-entry {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1rem 1.2rem;
    margin-bottom: 0.8rem;
    border-left: 4px solid var(--accent);
    border: 1px solid var(--border-color);
}
.journal-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-top: 0.3rem;
}

/* ----- Loading & Empty States ----- */
.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ----- Responsive Tweaks ----- */
@media (max-width: 600px) {
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    .section-title { font-size: 2rem; }
    .container { padding: 0 1rem; }
    .bento-card { padding: 1.2rem; }
    .hero-main { padding: 1.5rem; }
    .stats-row { grid-template-columns: 1fr 1fr; }
    .badges-grid { grid-template-columns: repeat(2, 1fr); }
    .stories-grid { grid-template-columns: 1fr; }
    .modal { padding: 1.5rem; }
    .reply-form-container { flex-wrap: wrap; }
    .reply-form-container textarea { width: 100%; height: 60px; }
    .reply-form-container button { width: 100%; justify-content: center; }
}

/* =====================================================
   COMMUNITY SURVEY — SWIPE QUESTIONNAIRE
   ===================================================== */
.survey-card {
    max-width: 660px;
    margin: 0 auto;
    text-align: center;
}
.survey-card .card-icon { font-size: 2.8rem; }
.survey-card .section-title { margin: 0.3rem 0; }
.survey-card .section-sub { margin-bottom: 1rem; }

/* ---- Swipe deck ---- */
.swipe-container {
    position: relative;
    height: 390px;
    margin: 0.5rem auto 0;
    max-width: 520px;
    touch-action: pan-y;
}
.swipe-container .swipe-hint {
    margin-top: 0.8rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}
.swipe-container .swipe-hint i { margin: 0 0.3rem; }

.card-stack { position: relative; width: 100%; height: 100%; }

.question-card {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    padding: 1.5rem 1.4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    will-change: transform;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}
.question-card:active { cursor: grabbing; }
.question-card .question-badge {
    display: inline-block;
    align-self: flex-start;
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.78rem;
    padding: 0.2rem 0.7rem;
    border-radius: 50px;
    margin-bottom: 0.6rem;
}
.question-card .swipe-question {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    line-height: 1.4;
    margin: 0 0 1rem;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    overflow-y: auto;
    max-height: 210px;
}
.option-btn {
    text-align: left;
    cursor: pointer;
    padding: 0.7rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: all var(--transition);
}
.option-btn:hover { border-color: var(--accent); background: var(--accent-light); }
.option-btn.selected {
    border-color: var(--accent);
    background: var(--accent-light);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.open-answer, .open-textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    resize: vertical;
    box-sizing: border-box;
}
.open-answer:focus, .open-textarea:focus { border-color: var(--accent); outline: none; }

/* Stamp shown while pulling the card up */
.swipe-stamp {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.2rem 0.8rem;
    border-radius: 6px;
    border: 3px solid var(--accent);
    color: var(--accent);
    transform: rotate(12deg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s ease;
}

.survey-nav-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.9rem;
    margin-top: 1rem;
    padding: 1rem 0 0.2rem;
    border-top: 1px solid var(--border-color);
    background: linear-gradient(to top, var(--bg-card) 70%, rgba(0,0,0,0));
    position: relative;
    z-index: 30;
}
.survey-nav-buttons .btn {
    flex: 1 1 auto;
    min-width: 120px;
    max-width: 190px;
    justify-content: center;
    pointer-events: auto;
}
.survey-nav-buttons .btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.survey-card .btn { margin-top: 0.5rem; }

@media (max-width: 480px) {
    .swipe-container { height: 430px; }
    .question-card .swipe-question { font-size: 1.05rem; }
}
