/* FootyHub Premium Design System - Fresh Modern Light Blue Theme */

:root {
    /* Color Palette - Fresh Bright Light Blue Theme */
    --bg-dark: #f0f4f9;           /* Very light fresh blue-white */
    --bg-space: #e3ecf5;          /* Fresh soft blue canvas background */
    --bg-surface: rgba(255, 255, 255, 0.85); /* Semi-transparent white */
    --bg-card: rgba(255, 255, 255, 0.95);    /* Crisp white card */
    --bg-card-hover: #ffffff;     /* Hover card */

    --border-color: rgba(37, 99, 235, 0.12); /* Soft blue border */
    --border-glow: rgba(37, 99, 235, 0.35);  /* More prominent blue glow */
    --border-glass: rgba(0, 0, 0, 0.05);     /* Soft dark border for glass contrast */

    /* Accents - Richer & More Readable on Light Backgrounds */
    --accent-blue: #2563eb;       /* Rich Electric Blue */
    --accent-indigo: #4f46e5;     /* Professional Indigo */
    --accent-cyan: #0891b2;       /* Vibrant Cyan-Teal */
    --accent-emerald: #10b981;    /* Emerald Green */
    --accent-gold: #d97706;       /* Amber Gold */
    --accent-rose: #e11d48;       /* Rose Red */

    --text-primary: #0f172a;      /* Deep Navy Slate (almost black) */
    --text-secondary: #475569;    /* Shaded Slate for secondary labels */
    --text-muted: #64748b;        /* Light Slate for muted elements */

    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #4f46e5 100%);
    --emerald-gradient: linear-gradient(135deg, #06b6d4 0%, #2563eb 100%);
    --card-glow: 0 10px 30px rgba(37, 99, 235, 0.05);
    --neon-glow: 0 0 15px rgba(37, 99, 235, 0.15);

    --map-route-bg: rgba(37, 99, 235, 0.08); /* Light blue map route bg line */
}

/* Dark Mode Variables Overlay */
.dark-theme {
    --bg-dark: #070a13;           /* Dark space background */
    --bg-space: #0b1120;          /* Deep dark space canvas background */
    --bg-surface: rgba(15, 23, 42, 0.85); /* Semi-transparent slate */
    --bg-card: rgba(15, 23, 42, 0.95);    /* Crisp dark card */
    --bg-card-hover: #1e293b;     /* Hover card */

    --border-color: rgba(59, 130, 246, 0.15); /* Soft electric blue border */
    --border-glow: rgba(59, 130, 246, 0.4);  /* Glowing blue border */
    --border-glass: rgba(255, 255, 255, 0.05); /* Soft white border for glass contrast */

    /* Accents - Adapted for dark mode */
    --accent-blue: #3b82f6;       /* Bright Electric Blue */
    --accent-indigo: #6366f1;     /* Professional Indigo */
    --accent-cyan: #06b6d4;       /* Vibrant Cyan-Teal */
    --accent-emerald: #10b981;    /* Emerald Green */
    --accent-gold: #f59e0b;       /* Amber Gold */
    --accent-rose: #f43f5e;       /* Rose Red */

    --text-primary: #f8fafc;      /* White/slate */
    --text-secondary: #cbd5e1;    /* Light slate for labels */
    --text-muted: #64748b;        /* Muted elements */

    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    --emerald-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --card-glow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --neon-glow: 0 0 15px rgba(59, 130, 246, 0.3);

    --map-route-bg: rgba(255, 255, 255, 0.10); /* White/transparent map route bg line */
}

/* Dark Theme layout overrides */
.dark-theme.app-container {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 15% 20%, rgba(59, 130, 246, 0.08) 0px, transparent 50%),
        radial-gradient(at 85% 80%, rgba(99, 102, 241, 0.05) 0px, transparent 50%),
        radial-gradient(at 50% 50%, #070a13 0%, #0b1120 100%) !important;
    color: var(--text-primary);
}

.dark-theme .sidebar {
    background: rgba(15, 23, 42, 0.92);
}

.dark-theme .mobile-nav {
    background: rgba(15, 23, 42, 0.96);
}

/* Base resets & fonts */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 15% 20%, rgba(96, 165, 250, 0.15) 0px, transparent 50%),
        radial-gradient(at 85% 80%, rgba(129, 140, 248, 0.1) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(240, 244, 249, 1) 0px, rgba(227, 236, 245, 1) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    font-weight: 700;
}

/* Premium App Loading Screen */
.app-loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--bg-dark);
    text-align: center;
    gap: 1.5rem;
}

.app-loader-logo {
    width: 220px;
    height: auto;
    object-fit: contain;
    animation: loaderLogoPulse 2.5s ease-in-out infinite;
    filter: drop-shadow(0 4px 24px rgba(59, 130, 246, 0.4));
}

@keyframes loaderLogoPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.04); }
}

.app-loader-circle {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(59, 130, 246, 0.12);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s infinite cubic-bezier(0.55, 0.15, 0.45, 0.85);
    box-shadow: var(--neon-glow);
    margin: 0;
}

.app-loader-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Standard Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(59, 130, 246, 0.15);
        border-color: rgba(59, 130, 246, 0.15);
    }
    50% {
        box-shadow: 0 0 24px rgba(59, 130, 246, 0.4);
        border-color: rgba(59, 130, 246, 0.4);
    }
}

@keyframes avatarBob {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-6px) scale(1.05); }
}

/* Layout Architecture */
.app-container {
    display: flex;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Sidebar Navigation (Desktop) */
.sidebar {
    width: 260px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: all 0.3s ease;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2.5rem;
    padding: 0.25rem 0;
}

.brand-logo {
    width: 160px;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: drop-shadow(0 2px 12px rgba(59, 130, 246, 0.3));
}

.brand-logo:hover {
    transform: scale(1.04);
    filter: drop-shadow(0 4px 20px rgba(59, 130, 246, 0.55));
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
}

.nav-link.active {
    background: var(--accent-gradient);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
    border-color: transparent;
}

.nav-link svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.sidebar-user {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--accent-blue);
    object-fit: cover;
    background-color: var(--bg-space);
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--accent-blue);
    font-weight: 500;
}

/* Mobile Bottom Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--border-color);
    z-index: 100;
    padding: 0.75rem 1rem;
}

.mobile-nav-list {
    display: flex;
    justify-content: space-around;
    align-items: center;
    list-style: none;
}

.mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    padding: 0.25rem 0.5rem;
}

.mobile-nav-link svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.mobile-nav-link.active {
    color: var(--accent-blue);
}

.mobile-nav-link.active::after {
    content: '';
    position: absolute;
    top: -12px;
    width: 24px;
    height: 3px;
    background: var(--accent-blue);
    border-radius: 2px;
    box-shadow: var(--neon-glow);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2.5rem 3rem;
    min-height: 100vh;
    padding-bottom: 6rem; /* space for mobile nav if triggered */
}

/* Custom Premium Cards */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--card-glow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideUp 0.5s ease-out;
}

.glass-card:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

/* Custom CSS Buttons */
.btn-primary {
    background: var(--accent-gradient);
    border: none;
    color: white;
    padding: 0.85rem 1.75rem;
    border-radius: 14px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 0.85rem 1.75rem;
    border-radius: 14px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-secondary);
}

.btn-danger {
    background: var(--accent-rose);
    border: none;
    color: white;
    padding: 0.85rem 1.75rem;
    border-radius: 14px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.25);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(244, 63, 94, 0.4);
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Custom form inputs */
.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.form-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.25s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: var(--neon-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Top bar with quick user switch & group stats */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.topbar-title {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.group-selector-container {
    position: relative;
}

.group-dropdown-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.25rem;
    border-radius: 14px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    transition: all 0.25s ease;
}

.group-dropdown-btn:hover {
    border-color: var(--accent-blue);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card-hover);
    backdrop-filter: blur(20px);
    border: 1.5px solid var(--accent-blue);
    border-radius: 16px;
    padding: 0.5rem;
    width: 220px;
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover, .dropdown-item.active {
    background: var(--accent-blue);
    color: #ffffff !important;
}

/* Dashboards Widgets */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.widget-stat {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.widget-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue);
    box-shadow: var(--neon-glow);
}

.widget-icon.emerald {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.25);
}

.widget-icon.gold {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.15);
    color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.25);
}

.widget-icon svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.widget-data {
    display: flex;
    flex-direction: column;
}

.widget-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
}

.widget-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Custom Interactive Melbourne-to-Sydney Map View */
.map-canvas-container {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    background: var(--bg-space);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-glow);
    padding: 1.5rem;
    margin-bottom: 3rem;
}

.map-svg {
    width: 100%;
    height: auto;
    min-height: 380px;
    display: block;
}

.map-route-path-background {
    fill: none;
    stroke: var(--map-route-bg);
    stroke-width: 10;
    stroke-linecap: round;
}

.map-route-path {
    fill: none;
    stroke: rgba(59, 130, 246, 0.18);
    stroke-width: 6;
    stroke-linecap: round;
}

.map-route-path-active {
    fill: none;
    stroke: var(--accent-blue);
    stroke-dasharray: 12, 12;
    stroke-width: 4;
    stroke-linecap: round;
    animation: dashPulse 25s linear infinite;
}

@keyframes dashPulse {
    to {
        stroke-dashoffset: -1000;
    }
}

.map-checkpoint {
    fill: var(--bg-card);
    stroke: var(--accent-indigo);
    stroke-width: 3;
    cursor: pointer;
    transition: all 0.3s ease;
}

.map-checkpoint:hover {
    fill: var(--accent-indigo);
    stroke: var(--text-primary);
    filter: drop-shadow(0 0 8px var(--accent-indigo));
}

.map-checkpoint.completed {
    fill: var(--accent-emerald);
    stroke: var(--text-primary);
    filter: drop-shadow(0 0 8px var(--accent-emerald));
}

.map-checkpoint.active {
    animation: pulseGlow 2s infinite;
}

.map-avatar-container {
    cursor: pointer;
    transition: all 0.3s ease;
}

.map-avatar-container:hover {
    transform: scale(1.15);
    z-index: 100;
}

.map-avatar-container.bobbing {
    animation: avatarBob 3s ease-in-out infinite;
}

.map-avatar-circle {
    fill: var(--bg-dark);
    stroke: var(--accent-blue);
    stroke-width: 2.5;
}

.map-avatar-circle.owner {
    stroke: var(--accent-gold);
}

.map-avatar-circle.admin {
    stroke: var(--accent-indigo);
}

/* User switcher & simulate walk panel */
.simulator-panel {
    background: rgba(59, 130, 246, 0.04);
    border: 1px solid var(--border-glow);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 3rem;
    animation: pulseGlow 4s infinite alternate;
}

.simulator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.75rem;
}

.simulator-title {
    font-size: 1.25rem;
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.simulator-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

/* Social Wall Feed */
.wall-post-creator {
    margin-bottom: 2.5rem;
}

.wall-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem;
    color: var(--text-primary);
    width: 100%;
    min-height: 100px;
    resize: none;
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: all 0.25s ease;
}

.wall-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: var(--neon-glow);
}

.wall-upload-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wall-upload-preview {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    max-height: 200px;
    max-width: 100%;
    margin-top: 1rem;
    border: 1px solid var(--border-color);
}

.wall-upload-preview img, .wall-upload-preview video {
    display: block;
    max-height: 200px;
    width: auto;
    object-fit: contain;
}

.preview-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    transition: background 0.2s ease;
}

.preview-remove-btn:hover {
    background: var(--accent-rose);
}

.wall-posts-feed {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 1.75rem;
    box-shadow: var(--card-glow);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.post-author-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid var(--accent-blue);
    object-fit: cover;
}

.post-author-name {
    font-weight: 600;
    font-size: 1.05rem;
}

.post-author-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.post-actions-top {
    display: flex;
    gap: 0.5rem;
}

.post-content {
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    white-space: pre-line;
}

.post-media-container {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    margin-bottom: 1.25rem;
    max-height: 480px;
    background: var(--bg-space);
}

.post-media-container img, .post-media-container video {
    width: 100%;
    height: auto;
    max-height: 480px;
    object-fit: contain;
    display: block;
}

.post-interactions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.85rem 0;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.emoji-reaction-bar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.emoji-btn {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 30px;
    padding: 0.4rem 0.85rem;
    cursor: pointer;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.emoji-btn:hover, .emoji-btn.active {
    background: rgba(132, 182, 107, 0.08);
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.emoji-btn.active {
    background: rgba(132, 182, 107, 0.15);
}

.comment-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.comment-toggle-btn:hover {
    color: var(--accent-blue);
}

/* Comment section details */
.comments-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(132, 182, 107, 0.06);
    border-radius: 16px;
    padding: 1.25rem;
    margin-top: 0.5rem;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-item {
    display: flex;
    gap: 0.75rem;
    animation: slideUp 0.3s ease-out;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid var(--accent-blue);
    object-fit: cover;
}

.comment-bubble {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 0.75rem 1rem;
    flex: 1;
}

.comment-author-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.comment-author-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.comment-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.comment-text {
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

.comment-input-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.5rem;
}

.comment-input {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.65rem 1rem;
    color: var(--text-primary);
    flex: 1;
    font-size: 0.9rem;
}

.comment-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* Comment photo attachment button */
.btn-comment-attach {
    background: rgba(112, 154, 92, 0.1);
    border: 2px solid var(--accent-blue);
    color: var(--accent-blue);
    padding: 0.6rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    width: 38px;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-comment-attach:hover {
    background: var(--accent-blue);
    color: white;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(112, 154, 92, 0.3);
}

/* Leaderboards (Ladderboard) */
.ladder-podium {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    align-items: flex-end;
    gap: 1.5rem;
    margin-bottom: 4rem;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.podium-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem 1rem;
    position: relative;
    animation: podiumSlideUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.podium-place.second {
    height: 180px;
    border-top: 3px solid #cbd5e1; /* Silver */
    animation-delay: 0.15s;
}

.podium-place.first {
    height: 220px;
    background: rgba(255, 255, 255, 0.85);
    border: 2px solid var(--border-glow);
    border-top: 4px solid var(--accent-gold); /* Gold */
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.15);
    animation-delay: 0s;
}

.podium-place.third {
    height: 150px;
    border-top: 3px solid #b45309; /* Bronze */
    animation-delay: 0.3s;
}

.podium-avatar-container {
    position: relative;
    margin-top: -2.5rem;
    margin-bottom: 0.75rem;
}

.podium-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid var(--accent-blue);
    object-fit: cover;
    box-shadow: var(--card-glow);
}

.podium-badge {
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: black;
}

.podium-badge.gold { background: var(--accent-gold); }
.podium-badge.silver { background: #cbd5e1; }
.podium-badge.bronze { background: #b45309; color: white; }

.podium-name {
    font-weight: 700;
    font-size: 0.95rem;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 0.25rem;
}

.podium-steps {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--accent-blue);
    font-family: 'Outfit', sans-serif;
}

.podium-bar {
    width: 100%;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 0.5rem;
    margin-top: auto;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.ladder-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ladder-item {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0.85rem 1.5rem;
    transition: all 0.25s ease;
    animation: slideUp 0.4s ease-out both;
}

.ladder-item:nth-child(1) { animation-delay: 0.1s; }
.ladder-item:nth-child(2) { animation-delay: 0.15s; }
.ladder-item:nth-child(3) { animation-delay: 0.2s; }
.ladder-item:nth-child(4) { animation-delay: 0.25s; }
.ladder-item:nth-child(5) { animation-delay: 0.3s; }
.ladder-item:nth-child(6) { animation-delay: 0.35s; }
.ladder-item:nth-child(7) { animation-delay: 0.4s; }
.ladder-item:nth-child(8) { animation-delay: 0.45s; }
.ladder-item:nth-child(9) { animation-delay: 0.5s; }
.ladder-item:nth-child(10) { animation-delay: 0.55s; }

.ladder-item:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
    transform: scale(1.01);
}

.ladder-rank {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-secondary);
    width: 32px;
}

.ladder-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.ladder-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--accent-blue);
    object-fit: cover;
}

.ladder-name {
    font-weight: 600;
}

.ladder-stats {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.ladder-chart-bar-container {
    width: 120px;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.ladder-chart-bar {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px;
}

.ladder-steps {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    min-width: 90px;
    text-align: right;
}

.ladder-steps span {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-left: 0.25rem;
}

/* Modal and Drawer systems */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1.5rem;
}

.modal-container {
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: 28px;
    width: 100%;
    max-width: 520px;
    box-shadow: var(--card-glow);
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.25rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Custom Progress Bar widget */
.progress-meter {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.progress-meter-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.progress-meter-bar-container {
    height: 12px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-meter-bar {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 6px;
    transition: width 0.5s ease-out;
}

/* Helper styles for roles and states */
.badge-role {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-role.owner {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-role.admin {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-indigo);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.badge-role.member {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-blue);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

/* =====================================================
   RESPONSIVE — Tablet, Phone, Small Phone
   ===================================================== */

@media (max-width: 1024px) {
    .main-content {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    /* ---- Layout shell ---- */
    .sidebar      { display: none; }
    .mobile-nav   { display: block; }

    .main-content {
        margin-left: 0;
        padding: 1.25rem 1rem;
        padding-bottom: 6rem;
    }

    /* ---- Topbar ---- */
    .topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .topbar-title { font-size: 1.5rem; }

    .topbar-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0.5rem;
    }

    /* shrink topbar buttons so they fit on narrow screens */
    .topbar-actions .btn-secondary,
    .topbar-actions .btn-primary {
        padding: 0.55rem 0.85rem;
        font-size: 0.8rem;
    }

    /* Group dropdown button — truncate long names */
    .group-dropdown-btn {
        max-width: 160px;
        padding: 0.55rem 0.75rem;
        font-size: 0.8rem;
    }

    .group-dropdown-btn span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* ---- Cards ---- */
    .glass-card {
        padding: 1.25rem;
        border-radius: 18px;
    }

    /* ---- Dashboard widgets ---- */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* ---- Leaderboard podium → vertical stack ---- */
    .ladder-podium {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 1.5rem;
        margin-top: 2rem;
        margin-bottom: 2rem;
    }

    .podium-place {
        height: auto !important;
        padding: 2rem 1.25rem 1.25rem;
    }

    .ladder-stats { gap: 0.5rem; }

    .ladder-chart-bar-container { display: none; }

    /* ---- Wall posts ---- */
    .post-card { padding: 1.1rem; }

    .post-author-avatar { width: 36px; height: 36px; }

    .post-interactions {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.65rem;
    }

    /* ---- Modals → slide up full-screen on mobile ---- */
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal-container {
        border-radius: 28px 28px 0 0;
        max-width: 100%;
        width: 100%;
        max-height: 92vh;
        overflow-y: auto;
    }

    /* ---- Dropdown menus stay in viewport ---- */
    .dropdown-menu {
        right: 0;
        left: auto;
        max-width: calc(100vw - 2rem);
    }

    /* ---- Leaderboard container ---- */
    .leaderboard-container {
        padding: 0;
    }
}

/* ---- Small phones ---- */
@media (max-width: 480px) {
    .main-content { padding: 1rem 0.75rem; padding-bottom: 6rem; }

    .topbar-title { font-size: 1.3rem; }

    .glass-card { padding: 1rem; border-radius: 16px; }

    /* Ladder list items */
    .ladder-item { padding: 0.65rem 0.75rem; }
    .ladder-avatar { width: 32px; height: 32px; }
    .ladder-steps { font-size: 0.95rem; min-width: auto; }
    .ladder-rank { font-size: 1rem; width: 24px; }

    /* Emoji bar */
    .emoji-reaction-bar { flex-wrap: wrap; justify-content: center; width: 100%; }

    /* Widget value smaller */
    .widget-value { font-size: 1.4rem; }

    /* Mobile nav labels */
    .mobile-nav-link span { font-size: 0.65rem; }
}

/* Blazor Standard Error UI - Hidden by default, themed red on crash */
#blazor-error-ui {
    background: #fee2e2;
    color: #991b1b;
    bottom: 0;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.6);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 10000;
    border-top: 1px solid rgba(244, 63, 94, 0.3);
    font-family: inherit;
    font-size: 0.9rem;
}

#blazor-error-ui.show {
    display: block !important;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.75rem;
    color: #fca5a5;
}

#blazor-error-ui .reload {
    color: #38bdf8;
    text-decoration: underline;
    margin: 0 0.5rem;
    font-weight: 600;
}

@keyframes podiumSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes emailFly {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-12px) rotate(8deg) scale(1.1);
        filter: drop-shadow(0 5px 15px rgba(112, 154, 92, 0.4));
        opacity: 1;
    }
    100% {
        transform: translateY(4px) rotate(-8deg) scale(0.95);
        opacity: 0.85;
    }
}