/* Dark Theme Design System */
:root {
    /* Colors */
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;
    --bg-overlay: rgba(65, 85, 90, 0.45);

    --text-primary: #ffffff;
    --text-secondary: #b4b4b4;
    --text-muted: #6b6b6b;

    --primary-color: #d4af37;

    --accent-primary: #667eea;
    --accent-secondary: #764ba2;
    --accent-gradient: linear-gradient(135deg, #d4af37 0%, #3a3a3a 100%);

    --border-color: rgba(42, 74, 90, 0.8);
    --shadow-primary: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-secondary: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.2);

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-size-xs: 14px;
    --font-size-sm: 16px;
    --font-size-base: 18px;
    --font-size-lg: 22px;
    --font-size-xl: 28px;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 20px;
    --space-xl: 24px;

    /* Border radius */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;

    /* Common interaction colors */
    --hover-bg: rgba(255, 255, 255, 0.1);
}

/* Reusable icon button pattern */
.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.icon-btn:hover {
    background-color: var(--hover-bg);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
    width: 100%;
    overscroll-behavior: none;
}

html {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

body {
    position: relative;
    font-family: var(--font-family);
    display: flex;
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Layout components */
.map-container {
    flex: 1;
    height: 100vh;
    z-index: 1;
}

/* Utility classes for common patterns */
.glass-effect {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.glass-effect-light {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.overlay-card {
    background: var(--bg-overlay);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-primary);
    border: 1px solid var(--border-color);
}

/* Header component */
.header {
    position: absolute;
    top: var(--space-xl);
    right: var(--space-xl);
    z-index: 100;
    padding: 14px 18px 18px 18px;
    max-width: 310px;
    text-align: center;
    transition: all var(--transition-normal) ease;
}

/* Header toggle button */
.header__toggle {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-radius: 50%;
    transition: background-color var(--transition-fast), color var(--transition-fast);
    z-index: 2;
}

.header__toggle:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

/* Expanded state (default) */
.header__expanded {
    display: block;
    opacity: 1;
    transition: opacity var(--transition-normal) ease;
}

/* Collapsed state */
.header__collapsed {
    display: none;
    align-items: center;
    gap: 12px;
}

.header__collapsed-title {
    font-size: 20px;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -1.5px;
}

.header__collapsed-stats {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-group {
    display: inline-flex;
    gap: 3px;
}

.stat-group span:first-child {
    color: var(--text-primary);
    font-weight: 600;
}

.stat-separator {
    color: var(--text-muted);
    opacity: 0.5;
}

/* Collapsed header state */
.header.collapsed {
    padding: 10px 30px 10px 14px;
    max-width: fit-content;
}

.header.collapsed .header__expanded {
    display: none;
}

.header.collapsed .header__collapsed {
    display: flex;
}

.header__title {
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-weight: 900;
    letter-spacing: -1.5px;
}

.header__title a:hover,
.header__collapsed-title a:hover {
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.header__subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    letter-spacing: -0.3px;
}

.header__stats {
    font-size: 15px;
    margin-bottom: 14px;
    color: var(--text-secondary);
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* Side-by-side button row */
.header__buttons {
    display: flex;
    gap: var(--space-xs);
    margin-top: var(--space-xs);
}

.submit-button {
    flex: 1;
    display: inline-block;
    padding: var(--space-sm) var(--space-md);
    background: var(--text-primary);
    color: var(--bg-primary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
    border: 1px solid var(--text-primary);
    transition: all var(--transition-fast);
    text-align: center;
}

/* .submit-button:hover lives in the combined hover rule with .header__collapsed-button:hover below */

.directory-button {
    flex: 1;
    display: inline-block;
    padding: var(--space-sm) var(--space-md);
    background: var(--primary-color);
    color: #1a1a1a;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
    border: 1px solid var(--primary-color);
    transition: all var(--transition-fast);
    text-align: center;
}

.directory-button:hover {
    background: #c9a432;
    border-color: #c9a432;
    transform: translateY(-1px);
    text-decoration: none;
}

/* Collapsed header — both buttons inline */
.header__collapsed-buttons {
    display: flex;
    gap: 6px;
    margin-left: auto;
    margin-right: 32px;
}

.header__collapsed-button {
    padding: 6px 12px;
    border-radius: 16px;
    background: var(--text-primary);
    border: 1px solid var(--text-primary);
    color: var(--bg-primary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
}

/* Shared hover state — see .submit-button definition above for the base style */
.header__collapsed-button:hover,
.submit-button:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.header__collapsed-directory {
    padding: 6px 12px;
    border-radius: 16px;
    background: var(--primary-color);
    color: #1a1a1a;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.header__collapsed-directory:hover {
    background: #c9a432;
    text-decoration: none;
}

.header__privacy-link {
    display: block;
    margin-top: var(--space-sm);
    font-size: 12px;
    color: var(--text-secondary);
}

/* Header stats (the X stories · Y cities · Z countries strip) */

.stats__item {
    color: var(--text-secondary);
    font-weight: 300;
}

.stats__value {
    color: var(--text-primary);
    font-weight: 600;
}

/* Sidebar component */
.sidebar {
    width: 400px;
    max-width: 90vw;
    max-height: 60vh;
    background: rgba(20, 25, 30, 0.4); /* Fallback dark background */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 350;
    border-radius: var(--radius-md);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    overflow: hidden;
}

.sidebar--open {
    opacity: 1;
    visibility: visible;
    /* Transform will be set by JavaScript positioning or fallback to center */
}

.sidebar__header {
    padding: 16px 20px;
    background: transparent;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar__title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: 4px;
}

.sidebar__subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--font-size-sm);
    margin: 0;
}

.sidebar__close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: var(--font-size-xl);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color var(--transition-fast);
}

.sidebar__close:hover {
    background-color: var(--hover-bg);
}

.sidebar__content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: transparent;
}

/* Story components */
.story-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    animation: slideIn var(--transition-normal) ease;
    transition: all var(--transition-fast);
}

.story-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.story-card--linked {
    background: rgba(255, 255, 255, 0.11);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.story-card:first-child {
    margin-top: 0;
}

.story-card:last-child {
    margin-bottom: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.story__text {
    line-height: 1.6;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    margin-bottom: 0;
}

.story__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.story__meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.story__new-badge {
    background: #fff;
    color: #555;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
    display: inline-block;
    vertical-align: middle;
}

/* Story actions group (reactions + share) */
.story__actions {
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 2px;
}

.story__share-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, transform 0.2s;
    opacity: 0.6;
    border-radius: 12px;
}

.story__share-btn:hover {
    color: var(--primary-color);
    opacity: 1;
    transform: scale(1.1);
}

.story__share-btn--copied {
    color: var(--primary-color) !important;
    opacity: 1 !important;
}

.story__share-btn svg {
    width: 14px;
    height: 14px;
}

.story__expand-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 2px 0;
    margin-left: 8px;
    opacity: 0.8;
    transition: opacity var(--transition-fast);
}

.story__expand-btn:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Global link styling */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Force .privacy-link to gold even when the more-specific .header__privacy-link
   tries to gray it out. (.header__privacy-link wins on specificity vs. plain `a`,
   so we need a class-level override here. Same source order as before refactor.) */
.privacy-link {
    color: var(--primary-color);
}

/* Header links - inherit color */
.header__title a,
.header__collapsed-title a {
    color: inherit;
    text-decoration: none;
}

/* Copy notification - matches reaction toast style */
.copy-notification {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.copy-notification--visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.copy-notification::before {
    content: '✓';
    margin-right: 8px;
    color: white;
    font-weight: bold;
}

/* Utility components */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.no-stories {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
}

/* Map tiles dark theme filter */
.dark-tiles {
    filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%) saturate(120%);
}

/* Map zoom + reset controls — restyled to match the floating yellow theme
   (random-story-btn, recent-stories-btn, feedback-button). Round, gold,
   dark icons, gold-glow on hover. */

/* Drop Leaflet's wrapper chrome so each control floats independently */
.leaflet-control-zoom.leaflet-bar {
    border: none;
    box-shadow: none;
    background: transparent;
}

/* The +, −, and home buttons share the same shape + theme.
   !important is used to defeat Leaflet's higher-specificity defaults
   (e.g. .leaflet-touch .leaflet-bar a), consistent with other Leaflet
   overrides in this file. */
.leaflet-control-zoom a,
.leaflet-control-reset {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: var(--primary-color) !important;
    color: var(--bg-primary) !important;
    border: none !important;
    box-shadow: var(--shadow-soft);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    font-size: 18px;
    font-weight: 600;
    line-height: 36px !important;   /* match height for vertical centering */
    text-align: center;
    text-decoration: none;
    display: block;
    margin-bottom: 6px !important;
}

/* Leaflet stacks +/- in one element with a divider — drop the divider for the round look */
.leaflet-control-zoom a + a {
    border-top: none !important;
}

/* Reset button override: it has some manual positioning we don't want anymore */
.leaflet-control-reset {
    position: relative;
    left: 0;
    top: 0;
    cursor: pointer;
}

.leaflet-control-zoom a:hover,
.leaflet-control-reset:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.6);
    background: var(--primary-color) !important;   /* defeat Leaflet's hover bg */
    color: var(--bg-primary) !important;
}

/* Disabled state (e.g. + at max zoom) — keep theme but mute */
.leaflet-control-zoom a.leaflet-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.leaflet-control-zoom a.leaflet-disabled:hover {
    transform: none;
    box-shadow: var(--shadow-soft);
}

/* Story Submit Modal + form fields + email verification moved to css/forms.css */

/* Custom marker styles */
.custom-marker {
    background: none !important;
    border: none !important;
}

.leaflet-marker-icon.custom-marker:hover,
.leaflet-marker-icon.custom-marker.marker-active {
    z-index: 9999 !important;
}

.marker-badge {
    position: relative;
    width: 60px;
    height: 60px;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.marker-badge:hover {
    transform: scale(1.05);
}

.marker-circle-bg {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--marker-color, #d4af37) 0%, var(--marker-dark, rgba(65, 65, 65, 0.95)) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(42, 74, 90, 0.5);
    border-radius: 50%;
    box-shadow: var(--shadow-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
    overflow: hidden;
}

/* City & Country markers: dark bg with spherical flag, region color border */
.marker-circle-bg.city-circle {
    background: rgba(20, 20, 25, 0.8);
    border: none;
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.15),
        0 0 3px rgba(var(--region-rgb, 255,255,255), 0.3);
}

/* Region top countries (flag + count) in region badge */
.region-flags {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    white-space: nowrap;
}

.region-flag-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;            /* breathing room between the flag and its story count */
    font-size: 11px;
    line-height: 1;
    opacity: 0.85;
}

/* Inline SVG flags used in place of OS emoji (stats rows, popups, region
   pills, recent stories). Locked to a uniform 4:3 box with object-fit:cover
   so flags of different official ratios (US 19:10, France 3:2, etc.) all
   render at the same size. A faint border keeps white-edged flags legible
   on dark backgrounds. */
.flag-inline {
    display: inline-block;
    width: 1.33em;
    height: 1em;
    object-fit: cover;
    vertical-align: -0.18em;
    border-radius: 2px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.marker-flag-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.65;
    border-radius: 50%;
    z-index: 0;
    filter: contrast(1.15) saturate(1.1);
}

/* Spherical gradient overlay for 3D effect */
.marker-circle-bg.city-circle::after,
.marker-circle-bg.country-circle::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background:
        radial-gradient(
            circle at 30% 20%,
            rgba(255, 255, 255, 0.55) 0%,
            rgba(255, 255, 255, 0.15) 20%,
            transparent 40%
        ),
        radial-gradient(
            circle at 70% 80%,
            rgba(0, 0, 0, 0.5) 0%,
            transparent 40%
        ),
        radial-gradient(
            circle at 50% 50%,
            transparent 30%,
            rgba(0, 0, 0, 0.25) 100%
        );
    box-shadow:
        inset 2px 2px 4px rgba(255, 255, 255, 0.3),
        inset -2px -2px 4px rgba(0, 0, 0, 0.4);
    z-index: 2;
    pointer-events: none;
}

.marker-number {
    color: var(--text-primary);
    font-size: 22px;
    font-weight: bold;
    line-height: 1;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 1), 0 0 14px rgba(0, 0, 0, 1), 0 0 22px rgba(0, 0, 0, 0.85), 0 0 30px rgba(0, 0, 0, 0.6);
    margin-top: -4px;
    position: relative;
    z-index: 1;
}

.marker-label {
    color: var(--text-primary);
    font-size: 10px;
    font-weight: 400;
    text-transform: lowercase;
    line-height: 1;
    margin-top: -2px;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.marker-pill-front {
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(var(--region-rgb, 255, 255, 255), 0.25);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-soft);
    height: auto;
    padding: 1px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: -2px;
    z-index: 2;
    white-space: nowrap;
    line-height: 1.1;
}

/* Shared heart reaction display */
.heart-reactions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-primary);
    opacity: 0.75;
}

.heart-reactions svg {
    flex-shrink: 0;
}

.pill-reactions {
    font-size: 11px;
    margin-top: 0;
}

.region-hearts {
    font-size: 10px;
    margin-top: 0;
}

.marker-text {
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 400;
    text-transform: lowercase;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

/* New story badge - shared styles for marker and cluster */
.marker-new-badge,
.cluster-new-badge {
    position: absolute;
    top: -4px;
    right: 4px;
    background: #fff;
    color: #555;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 10;
    line-height: 1;
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Region marker styles (larger) */
.region-marker .region-circle {
    width: 60px;
    height: 60px;
}

.region-marker .marker-number {
    font-size: 22px;
    margin-top: -6px;
}

.region-marker .marker-label {
    font-size: 11px;
}

.region-marker .marker-pill-front {
    top: 45px;
    bottom: auto;
    height: auto;
    padding: 3px 10px;
    flex-direction: column;
    gap: 1px;
}

.region-marker .marker-text {
    font-size: 13px;
    font-weight: 700;
}

.country-marker .marker-text {
    font-weight: 700;
}

.region-marker .marker-new-badge {
    top: -6px;
    right: 2px;
    min-width: 20px;
    height: 20px;
    font-size: 11px;
}

/* Map cluster styles */
.marker-cluster-custom {
    background: none !important;
    border: none !important;
}

.cluster-badge {
    position: relative;
    width: 70px;
    height: 70px;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.cluster-badge:hover {
    transform: scale(1.05);
}

.cluster-circle {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    background:
        linear-gradient(135deg, rgba(40, 40, 40, 0.4) 0%, rgba(40, 40, 40, 0.6) 100%),
        linear-gradient(45deg,
            rgba(255, 99, 132, 0.8) 0%,
            rgba(255, 205, 86, 0.8) 16.66%,
            rgba(75, 192, 192, 0.8) 33.33%,
            rgba(54, 162, 235, 0.8) 50%,
            rgba(153, 102, 255, 0.8) 66.66%,
            rgba(255, 99, 132, 0.8) 83.33%,
            rgba(255, 205, 86, 0.8) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(95, 125, 135, 0.8);
    border-radius: 50%;
    box-shadow: var(--shadow-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.cluster-cities {
    color: var(--text-primary);
    font-size: 22px;
    font-weight: bold;
    line-height: 1;
    position: relative;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 1), 0 0 14px rgba(0, 0, 0, 1), 0 0 22px rgba(0, 0, 0, 0.85), 0 0 30px rgba(0, 0, 0, 0.6);
    top: -2px;
}

.cluster-cities-label {
    color: var(--text-primary);
    font-size: 11px;
    line-height: 1;
    text-transform: lowercase;
    margin-top: -2px;
    position: relative;
    top: -2px;
}

.cluster-pill {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.03) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-soft);
    height: 20px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.cluster-stories {
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 600;
    text-transform: lowercase;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

/* Campaign marker styles */
.campaign-marker {
    background: none !important;
    border: none !important;
}

.campaign-badge {
    position: relative;
    width: 140px;
    cursor: default;
    transition: transform var(--transition-fast);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.campaign-circle-wrapper {
    position: relative;
    width: 56px;
    margin: 0 auto;
}

.campaign-circle {
    display: block;
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.3), 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    pointer-events: auto;
    margin: 0 auto;
}

.campaign-circle:hover {
    transform: scale(1.05);
}

.campaign-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.campaign-arrow {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 12px solid #e74c3c;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
    z-index: 5;
}

.campaign-pill {
    position: relative;
    margin-bottom: -8px;
    background: var(--text-primary);
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-soft);
    height: 18px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
    z-index: 3;
    cursor: pointer;
    pointer-events: auto;
}

.campaign-pill-hidden {
    opacity: 0;
    pointer-events: none;
}

.campaign-hashtag {
    color: var(--bg-primary);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

/* Pulsing animation for urgency */
@keyframes campaignPulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.3), 0 4px 15px rgba(0, 0, 0, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(231, 76, 60, 0.2), 0 4px 15px rgba(0, 0, 0, 0.3); }
}

.campaign-circle-wrapper .campaign-circle {
    animation: campaignPulse 2s ease-in-out infinite;
    transition: transform var(--transition-fast);
}

/* Event banner styles - matches exmuslim.me dark theme */
.event-banner {
    position: fixed;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 14px;
    background: #f5c518;
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    z-index: 300;
    transition: all var(--transition-fast);
    text-decoration: none;
    font-family: var(--font-family);
}

.event-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    text-decoration: none;
}

.event-banner--bottom-left {
    bottom: 28px;
    left: 10px;
}

.event-banner__title {
    color: var(--bg-secondary);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.event-banner__subtitle {
    color: #333;
    font-size: 11px;
    font-weight: 400;
    white-space: nowrap;
}

.event-banner--dimmed {
    opacity: 0.4;
}

.event-banner--dimmed:hover {
    opacity: 1;
}

/* Form section styling moved to css/forms.css */

/* Responsive design */
@media (max-width: 768px) {
    .form-group-row {
        flex-direction: column;
        gap: var(--space-sm);
    }

    /* But keep the compact optional fields in a row */
    .form-group-row.form-group-compact {
        flex-direction: row !important;
    }

    /* Keep location fields horizontal on mobile */
    .form-group-location {
        flex-direction: row !important;
    }

    .form-group-location .form-group-item {
        flex: 1;
        min-width: 0;
    }

    .form-group-item {
        flex: none;
    }

    /* Optional fields - keep all 4 in single row on mobile */
    .form-group-compact {
        display: flex !important;
        gap: 6px; /* Smaller gap on mobile */
    }

    .form-group-compact .form-group-item {
        flex: 1;
        min-width: 0; /* Prevent overflow */
    }

    /* Keep the compact font size we already have for mobile */
    .form-group-compact .form-select {
        font-size: 12px;
        padding: 8px 10px;
    }

    /* Belief field mobile styling */
    .form-group-belief .form-select,
    .form-group-belief .form-input {
        font-size: 12px;
        padding: 8px 10px;
    }

    .form-group-belief .form-label {
        font-size: 12px;
    }

    .sidebar {
        width: 100%;
        /* Position between zoom controls (top ~100px) and feedback button (bottom ~50px) */
        top: calc(50% + 40px) !important;
        left: 50% !important;
        transform: translate(-50%, -50%) scale(1) !important;
        max-height: calc(100vh - 160px) !important;
    }

    .header {
        top: 10px;
        right: 10px;
        padding: 12px 16px 16px 16px;
        max-width: 260px;
        text-align: center;
    }

    .header__title {
        font-size: var(--font-size-lg);
        margin-bottom: 4px;
    }

    .header__subtitle {
        font-size: var(--font-size-xs);
        margin-bottom: 10px;
    }

    .header__stats {
        font-size: var(--font-size-xs);
        margin-bottom: 10px;
        gap: 12px;
    }

    .submit-button {
        padding: 6px 14px;
        font-size: 12px;
        margin-top: 2px;
    }

    .directory-button {
        padding: 6px 14px;
        font-size: 12px;
        margin-top: 2px;
    }

    /* Collapsed header mobile adjustments */
    .header.collapsed {
        padding: 8px 45px 8px 12px;
        min-width: auto;
    }

    .header__collapsed {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .header__collapsed-title {
        font-size: 18px;
        margin-right: 90px;
    }

    .header__collapsed-stats {
        font-size: 12px;
        order: 2;
    }

    .header__collapsed-buttons {
        position: absolute;
        right: 28px;
        top: 8px;
        margin-left: 0;
        gap: 4px;
    }

    .header__collapsed-button,
    .header__collapsed-directory {
        padding: 3px 8px;
        font-size: 11px;
    }

    .header__toggle {
        right: 6px;
        top: 6px;
    }
}

/* Hide Leaflet attribution */
.leaflet-control-attribution {
    display: none !important;
}

/* Custom attribution badge */
.attribution-badge {
    position: fixed;
    bottom: 6px;
    left: 10px;
    color: var(--text-secondary);
    font-size: 13px;
    font-family: var(--font-family);
    z-index: 1;
    transition: var(--transition-fast);
    opacity: 0.5;
}

.attribution-badge:hover {
    color: var(--text-primary);
    opacity: 0.8;
}

/* Floating feedback button */
.feedback-button {
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    text-decoration: none;
    color: var(--bg-primary);
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.4);
}

.feedback-button:hover {
    transform: scale(1.1);
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.6);
}

.feedback-button svg {
    width: 18px;
    height: 18px;
}

/* Very small mobile screens */
@media (max-width: 320px) {
    /* Still keep in single row but make even more compact */
    .form-group-compact .form-select {
        font-size: 11px;
        padding: 6px 4px;
    }

    .form-group-compact .form-label {
        font-size: 10px;
    }

    /* Belief field very small screen styling */
    .form-group-belief .form-select,
    .form-group-belief .form-input {
        font-size: 11px;
        padding: 6px 8px;
    }

    .form-group-belief .form-label {
        font-size: 10px;
    }
}

/* ============================================
   REACTIONS SYSTEM STYLES
   ============================================ */

/* Story card reactions */
.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
}

.reaction-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.reaction-btn:hover:not(:disabled) {
    transform: scale(1.1);
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.reaction-btn:disabled {
    cursor: default;
}

.reaction-btn.reacted {
    color: white;
}

.reaction-count {
    font-weight: 500;
    min-width: 12px;
    text-align: center;
}

/* Reaction toast notifications */
.reaction-toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 24px;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.reaction-toast .toast-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.reaction-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Mobile adjustments for reactions */
@media (max-width: 480px) {
    .reaction-btn {
        padding: 2px 3px;
        font-size: 10px;
    }

    .reaction-emoji {
        font-size: 11px;
    }

    .reaction-toast {
        bottom: 40px;
        font-size: 13px;
        padding: 10px 16px;
    }

    /* Narrower collapsed header on mobile */
    .header.collapsed {
        padding: 10px 20px 10px 14px;
    }

    .header__collapsed-buttons {
        margin-right: 24px;
    }
}

/* Random Story Button */
.random-story-btn {
    position: fixed;
    bottom: 54px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: var(--bg-primary);
    cursor: pointer;
    z-index: 300;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.random-story-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.6);
}

.random-story-btn:active {
    transform: scale(0.95);
}

.random-story-btn.show {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.random-story-btn svg {
    width: 18px;
    height: 18px;
}

/* Recent stories + story stats + demographics modals moved to css/modals.css */
