/* ========================================
   1. CSS CUSTOM PROPERTIES / THEMING
   ======================================== */
:root {
    /* Brand colors */
    --crc-green: #34C759;
    --crc-orange: #FF6B35;
    --crc-blue: #007AFF;
    --crc-red: #FF3B30;
    --crc-teal: #32ADE6;
    --crc-purple: #8B5CF6;

    /* Light theme (default) */
    --crc-bg-base: #f2f2f7;
    --crc-bg-primary: #ffffff;
    --crc-bg-secondary: #f2f2f7;
    --crc-bg-tertiary: #e5e5ea;
    --crc-text-primary: #1d1d1f;
    --crc-text-secondary: #6e6e73;
    --crc-text-tertiary: #aeaeb2;
    --crc-separator: rgba(60, 60, 67, 0.12);

    /* Glass */
    --crc-glass-bg: rgba(255, 255, 255, 0.78);
    --crc-glass-bg-thick: rgba(255, 255, 255, 0.92);
    --crc-glass-border: rgba(0, 0, 0, 0.06);
    --crc-glass-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);

    /* Component tokens */
    --crc-radius-sm: 8px;
    --crc-radius-md: 12px;
    --crc-radius-lg: 16px;
    --crc-radius-xl: 20px;
    --crc-radius-pill: 999px;
    --crc-transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/**
 * Community Run Calendar - Frontend Styles
 */

/* ========== AUTH MODAL ========== */
.crc-auth-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--crc-transition);
}

.crc-auth-modal-backdrop.visible {
    opacity: 1;
    visibility: visible;
}

.crc-auth-modal {
    background: var(--crc-glass-bg-thick);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid var(--crc-glass-border);
    border-radius: var(--crc-radius-xl);
    padding: 28px;
    max-width: 400px;
    width: 92%;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
    transform: scale(0.95) translateY(10px);
    transition: transform var(--crc-transition);
}

.crc-auth-modal-backdrop.visible .crc-auth-modal {
    transform: scale(1) translateY(0);
}

.crc-auth-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.crc-auth-modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--crc-text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.crc-auth-modal-title i { color: var(--crc-orange); }

.crc-auth-modal-close {
    color: var(--crc-text-tertiary);
    font-size: 1.2rem;
    padding: 4px;
    transition: color var(--crc-transition);
    cursor: pointer;
    background: none;
    border: none;
}
.crc-auth-modal-close:hover { color: var(--crc-text-primary); }

.crc-auth-modal-body { margin-bottom: 22px; }

.crc-auth-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--crc-separator);
    margin-bottom: 16px;
}

.crc-auth-tab {
    flex: 1;
    padding: 10px 0;
    text-align: center;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--crc-text-tertiary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all var(--crc-transition);
}

.crc-auth-tab:hover { color: var(--crc-text-secondary); }

.crc-auth-tab.active {
    color: var(--crc-blue);
    border-bottom-color: var(--crc-blue);
}

.crc-auth-field {
    margin-bottom: 14px;
    text-align: left;
}

.crc-auth-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--crc-text-secondary);
    margin-bottom: 5px;
}

.crc-auth-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--crc-separator);
    border-radius: var(--crc-radius-sm);
    background: var(--crc-bg-primary);
    color: var(--crc-text-primary);
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    transition: border-color var(--crc-transition);
}

.crc-auth-field input:focus {
    border-color: var(--crc-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

.crc-auth-error {
    display: none;
    color: var(--crc-red);
    font-size: 0.78rem;
    margin-bottom: 12px;
    padding: 8px 10px;
    background: rgba(255, 59, 48, 0.08);
    border-radius: var(--crc-radius-sm);
}

.crc-auth-submit {
    width: 100%;
    margin-top: 4px;
    margin-bottom: 12px;
    background: var(--crc-blue);
    color: white;
}

.crc-auth-switch {
    text-align: center;
    font-size: 0.78rem;
    color: var(--crc-text-tertiary);
    margin: 0;
}

.crc-auth-switch a {
    color: var(--crc-blue);
    text-decoration: none;
    font-weight: 500;
}

.crc-auth-switch a:hover {
    text-decoration: underline;
}

/* ========== Variables ========== */
:root {
    --crc-blue: #2563eb;
    --crc-green: #16a34a;
    --crc-orange: #ea580c;
    --crc-purple: #7c3aed;
    --crc-teal: #32ADE6;
    --crc-gold: #f59e0b;
    --crc-grey: #9ca3af;
    --crc-dark: #1f2937;
    --crc-light: #f9fafb;
    --crc-border: #e5e7eb;
    --crc-radius: 12px;
    --crc-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --crc-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* ========== App Container ========== */
.crc-app {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ========== Page Nav ========== */
.crc-page-nav {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
    margin-top: 12px;
}

/* ========== Widget Footer Nav ========== */
.crc-widget-footer-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--crc-separator);
}

.crc-widget-footer-link {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--crc-blue);
    text-decoration: none;
    transition: opacity var(--crc-transition);
}

.crc-widget-footer-link:hover {
    opacity: 0.7;
}

/* ========== Filter Bar ========== */
.crc-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border-radius: var(--crc-radius);
    box-shadow: var(--crc-shadow);
    margin-top: 24px;
    margin-bottom: 24px;
    align-items: flex-end;
}

.crc-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 140px;
}

/* Type row — full width, forces a new line in the flex container */
.crc-filter-group--full {
    flex: 0 0 100%;
    border-top: 1px solid var(--crc-border);
    padding-top: 12px;
}

.crc-filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--crc-grey);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crc-filter {
    padding: 8px 12px;
    border: 1px solid var(--crc-border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--crc-light);
    transition: border-color 0.2s;
}

.crc-filter:focus {
    outline: none;
    border-color: var(--crc-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ========== Distance Range Slider (dual-handle) ========== */
.crc-filter-group--distance {
    flex: 0 0 100%;
    min-width: 0;
}

.crc-distance-slider-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

/* Animated badge showing current range / zone */
.crc-distance-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--crc-blue);
    background: rgba(0, 122, 255, 0.08);
    padding: 4px 12px;
    border-radius: var(--crc-radius-pill);
    transition: color var(--crc-transition), background var(--crc-transition);
    white-space: nowrap;
}

.crc-distance-label.zone-hm {
    color: var(--crc-orange);
    background: rgba(255, 107, 53, 0.1);
}

.crc-distance-label.zone-m {
    color: var(--crc-green);
    background: rgba(52, 199, 89, 0.1);
}

/* Outer rail container — positions track, fill, and both thumbs */
.crc-range-slider {
    position: relative;
    height: 24px;           /* thumb diameter + breathing room  */
    display: flex;
    align-items: center;
    margin-bottom: 28px;    /* space below for tick labels       */
    --crc-thumb-color: var(--crc-blue);
}

/* ── Track & fill ─────────────────────────────────────────── */

.crc-range-track,
.crc-range-fill {
    position: absolute;
    height: 5px;
    border-radius: var(--crc-radius-pill);
    left: 0;
    right: 0;
    pointer-events: none;
}

.crc-range-track {
    background: var(--crc-bg-tertiary);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.crc-range-fill {
    background: var(--crc-blue);
    width: 100%;
    transition: background var(--crc-transition);
}

/* ── Range inputs (stacked) ───────────────────────────────── */

.crc-range-input {
    position: absolute;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;   /* only the thumb is interactive     */
    outline: none;
    z-index: 3;
}

/* ── Webkit thumb ─────────────────────────────────────────── */

.crc-range-input::-webkit-slider-runnable-track { background: transparent; }

.crc-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    pointer-events: all;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--crc-bg-primary);
    border: 2.5px solid var(--crc-thumb-color);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14),
                0 0 0 0px rgba(0, 122, 255, 0.12);
    cursor: grab;
    transition: border-color var(--crc-transition),
                transform 0.14s ease,
                box-shadow 0.14s ease;
}

.crc-range-input::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16),
                0 0 0 6px rgba(0, 122, 255, 0.1);
}

.crc-range-input:active::-webkit-slider-thumb {
    cursor: grabbing;
    transform: scale(1.2);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18),
                0 0 0 8px rgba(0, 122, 255, 0.14);
}

/* ── Firefox thumb ────────────────────────────────────────── */

.crc-range-input::-moz-range-track  { background: transparent; }
.crc-range-input::-moz-range-thumb {
    pointer-events: all;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--crc-bg-primary);
    border: 2.5px solid var(--crc-thumb-color);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
    cursor: grab;
    transition: border-color var(--crc-transition);
}

/* ── Tick marks ───────────────────────────────────────────── */

.crc-slider-ticks {
    position: absolute;
    bottom: -24px;
    left: 0;
    right: 0;
    pointer-events: none;
}

.crc-slider-tick {
    position: absolute;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    opacity: 0.75;
}

.crc-slider-tick::before {
    content: '';
    display: block;
    width: 2px;
    height: 5px;
    background: currentColor;
    border-radius: 2px;
}

.crc-slider-tick--hm { color: var(--crc-orange); }
.crc-slider-tick--m  { color: var(--crc-green);  }

/* ========== Map ========== */
.crc-map {
    height: 550px;
    border-radius: var(--crc-radius);
    box-shadow: var(--crc-shadow);
    z-index: 1;
}

/* ========== Event Card Grid ========== */
.crc-event-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.crc-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px;
    color: var(--crc-grey);
    font-size: 16px;
}

.crc-no-events {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px;
    color: var(--crc-grey);
}

/* ========== Event Card ========== */
.crc-card {
    background: #fff;
    border-radius: var(--crc-radius);
    box-shadow: var(--crc-shadow);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.crc-card:hover {
    box-shadow: var(--crc-shadow-lg);
    transform: translateY(-2px);
}

/* ── Today's event highlight ───────────────────────────────── */
.crc-card.is-today {
    border: 2px solid var(--crc-green);
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0),
                0 4px 20px rgba(52, 199, 89, 0.18);
}

.crc-card.is-today:hover {
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0),
                0 8px 28px rgba(52, 199, 89, 0.25);
    transform: translateY(-3px);
}

/* "I DAG" chip — positioned in the top-right of the card image */
.crc-today-chip {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    background: var(--crc-green);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: var(--crc-radius-pill);
    box-shadow: 0 2px 8px rgba(52, 199, 89, 0.45);
    animation: crc-pulse-glow 2.4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes crc-pulse-glow {
    0%, 100% { box-shadow: 0 2px 8px  rgba(52, 199, 89, 0.45); }
    50%       { box-shadow: 0 2px 18px rgba(52, 199, 89, 0.75); }
}

/* Date row turns green on today's card */
.crc-card.is-today .is-today-date svg { color: var(--crc-green); }
.crc-card.is-today .is-today-date span {
    color: var(--crc-green);
    font-weight: 700;
}

.crc-card-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--crc-light);
}

.crc-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crc-card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--crc-light) 0%, var(--crc-border) 100%);
    color: var(--crc-grey);
    font-size: 48px;
}

/* ========== Dynamic Badges ========== */
.crc-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Badges container for multiple badges in event cards */
.crc-card-image .crc-badges-container {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: calc(100% - 60px); /* Leave room for favorite button */
}

.crc-card-image .crc-badges-container .crc-badge {
    position: static;
}

.badge-gadelob {
    background: var(--crc-blue);
}

.badge-ocr {
    background: var(--crc-orange);
}

.badge-trail {
    background: var(--crc-green);
}

.badge-ultra {
    background: var(--crc-purple);
}

.badge-lob {
    background: var(--crc-teal);
}

/* Inline badges (not absolutely positioned) */
.crc-badge-inline {
    position: static;
    display: inline-block;
    margin-right: 6px;
    margin-bottom: 6px;
}

/* ========== Distance Tag Input ========== */
.crc-distance-tag-input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    padding: 6px 10px;
    border: 1px solid var(--crc-separator);
    border-radius: var(--crc-radius-sm);
    background: var(--crc-bg-primary);
    cursor: text;
    width: 100%;
    box-sizing: border-box;
    transition: border-color var(--crc-transition), box-shadow var(--crc-transition);
}

.crc-distance-tag-input:focus-within {
    border-color: var(--crc-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
    outline: none;
}

.crc-distance-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.crc-distance-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 6px 3px 10px;
    background: var(--crc-blue);
    color: #fff;
    border-radius: var(--crc-radius-pill);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.crc-distance-tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    width: 16px;
    height: 16px;
    padding: 0;
    transition: background var(--crc-transition);
}

.crc-distance-tag-remove:hover {
    background: rgba(255, 255, 255, 0.45);
}

.crc-distance-text-input {
    border: none !important;
    outline: none !important;
    background: transparent;
    min-width: 180px;
    flex: 1;
    font-size: 14px;
    padding: 2px 0;
    box-shadow: none !important;
    color: var(--crc-text-primary);
}

.crc-distance-text-input::placeholder {
    color: var(--crc-text-tertiary);
}

/* Distance tags displayed on cards and widgets */
.crc-card-distance-tags,
.crc-widget-distance-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex-basis: 100%; /* always sits on its own row inside .crc-widget-item-meta */
    margin-top: 4px;
}

.crc-dist-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--crc-radius-pill);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    background: rgba(0, 122, 255, 0.1);
    color: var(--crc-blue);
}

.crc-dist-pill.dist-half-marathon {
    background: rgba(50, 173, 230, 0.12);
    color: var(--crc-teal);
}

.crc-dist-pill.dist-marathon {
    background: rgba(255, 107, 53, 0.12);
    color: var(--crc-orange);
}

.crc-dist-pill.dist-ultra {
    background: rgba(175, 82, 222, 0.12);
    color: var(--crc-purple);
}

/* ========== Strong Arm (Favorite) ========== */
.crc-strong-arm {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    padding: 0;
}

.crc-strong-arm:hover {
    transform: scale(1.15);
    background: #fff;
}

.crc-strong-arm svg {
    width: 20px;
    height: 20px;
    fill: var(--crc-grey);
    transition: fill 0.2s;
}

.crc-strong-arm.is-favorited svg {
    fill: var(--crc-gold);
}

/* ========== Card Body ========== */
.crc-card-body {
    padding: 16px;
}

.crc-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--crc-dark);
    margin: 0 0 8px;
    line-height: 1.3;
}

.crc-card-title a {
    color: inherit;
    text-decoration: none;
}

.crc-card-title a:hover {
    color: var(--crc-blue);
}

.crc-card-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.crc-card-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
}

.crc-card-meta-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    fill: currentColor;
}

.crc-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--crc-border);
}

.crc-card-views {
    font-size: 12px;
    color: var(--crc-grey);
}

/* ========== Buttons ========== */
.crc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.crc-btn:active {
    transform: scale(0.97);
}

.crc-btn-primary {
    background: var(--crc-blue);
    color: #fff;
}

.crc-btn-primary:hover {
    background: #1d4ed8;
    color: #fff;
}

.crc-btn-outline {
    background: transparent;
    border: 1.5px solid var(--crc-blue);
    color: var(--crc-blue);
}

.crc-btn-outline:hover {
    background: var(--crc-blue);
    color: #fff;
}

/* ========== Submission Form ========== */
.crc-submit-form {
    max-width: 720px;
    margin: 0 auto;
    background: #fff;
    padding: 32px;
    border-radius: var(--crc-radius);
    box-shadow: var(--crc-shadow);
}

.crc-form-field {
    margin-bottom: 20px;
}

.crc-form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--crc-dark);
    font-size: 14px;
}

.crc-form-field input[type="text"],
.crc-form-field input[type="url"],
.crc-form-field input[type="date"],
.crc-form-field select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--crc-border);
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

.crc-form-field input:focus,
.crc-form-field select:focus {
    outline: none;
    border-color: var(--crc-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.crc-form-row {
    display: flex;
    gap: 16px;
}

.crc-form-half {
    flex: 1;
}

.crc-field-hint {
    font-size: 12px;
    color: var(--crc-grey);
    margin-top: 4px;
}

.crc-form-message .crc-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.crc-form-message .crc-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.crc-notice {
    text-align: center;
    padding: 32px;
    background: var(--crc-light);
    border-radius: var(--crc-radius);
    color: #6b7280;
}

/* ========== Leaflet Popup ========== */
.crc-popup {
    font-size: 13px;
    line-height: 1.4;
}

.crc-popup strong {
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}

.crc-popup a {
    color: var(--crc-blue);
    text-decoration: none;
    font-weight: 600;
}

/* ========== Widgets ========== */
.crc-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    color: #1d1d1f;
}

.crc-widget--vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.crc-widget--horizontal {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* Vertical item: row layout (image left, content right) */
.crc-widget-item--v {
    display: flex;
    gap: 14px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(60, 60, 67, 0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.crc-widget-item--v:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
}

.crc-widget-item--v .crc-widget-item-image {
    position: relative;
    width: 100px;
    height: 80px;
    flex-shrink: 0;
    overflow: hidden;
}

.crc-widget-item--v .crc-widget-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crc-widget-item--v .crc-widget-item-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px 14px 10px 0;
    flex: 1;
    min-width: 0;
}

/* Horizontal item: card layout (image top, content bottom) */
.crc-widget-item--h {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(60, 60, 67, 0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.crc-widget-item--h:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
}

.crc-widget-item--h .crc-widget-item-image {
    position: relative;
    width: 100%;
    height: 130px;
    overflow: hidden;
}

.crc-widget-item--h .crc-widget-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crc-widget-item--h .crc-widget-item-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 10px 12px;
}

.crc-widget-item--h .crc-widget-item-footer {
    margin-top: auto;
}

/* Shared widget item parts */
.crc-widget-item-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f2f2f7;
    color: #aeaeb2;
    font-size: 32px;
}

/* Widget header — matches .rrw-header / .rrw-title from Ruteplanner */
.crc-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

.crc-widget-header-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: #1d1d1f;
}

.crc-widget-header-title i {
    margin-right: 6px;
    color: #e63946;
}

/* Card title — base style */
.crc-widget-item-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1d1d1f;
    text-decoration: none;
    line-height: 1.3;
    margin-bottom: 5px;
    display: block;
}

.crc-widget-item-title:hover {
    color: var(--crc-blue);
}

/* Marquee wrapper — clips overflow so animation is clean */
.crc-widget-item-title-wrap {
    overflow: hidden;
    position: relative;
    margin-bottom: 5px;
}

/* The inner span that slides when text overflows */
.crc-widget-item-title-text {
    display: inline-block;
    white-space: nowrap;
}

.crc-widget-item-title-text.crc-marquee {
    animation: crc-title-marquee var(--crc-marquee-duration, 6s) ease-in-out infinite;
}

@keyframes crc-title-marquee {
    0%,
    20%  { transform: translateX(0); }
    80%,
    100% { transform: translateX(var(--crc-marquee-offset, 0px)); }
}

.crc-widget-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 0.75rem;
    color: #6e6e73;
    margin-bottom: 10px;
}

.crc-widget-meta-date::before,
.crc-widget-meta-loc::before,
.crc-widget-meta-dist::before {
    margin-right: 4px;
    font-size: 0.7rem;
    color: #aeaeb2;
}

.crc-widget-meta-date::before {
    content: "📅";
}

.crc-widget-meta-loc::before {
    content: "📍";
}

.crc-widget-meta-dist::before {
    content: "📏";
}

.crc-widget-item-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.crc-btn-sm {
    padding: 5px 14px;
    font-size: 0.78rem;
    border-radius: var(--crc-radius-pill);
}

.crc-widget-empty {
    text-align: center;
    padding: 24px 16px;
    color: #6e6e73;
    font-size: 0.88rem;
    background: #f2f2f7;
    border-radius: 12px;
}

.crc-widget-item-image .crc-widget-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: calc(100% - 20px);
}

.crc-widget-item-image .crc-widget-badges .crc-badge {
    position: static;
    font-size: 10px;
    padding: 3px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ========== Checkbox Filter Pills ========== */
.crc-filter-group--checkboxes {
    min-width: 200px;
}

.crc-filter-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.crc-checkbox-label {
    display: inline-flex;
    cursor: pointer;
    margin: 0;
}

.crc-checkbox-label input[type="checkbox"] {
    display: none;
}

.crc-checkbox-pill {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: var(--crc-light);
    border: 1.5px solid var(--crc-border);
    color: #6b7280;
    transition: all 0.2s;
    user-select: none;
}

.crc-checkbox-label input:checked + .crc-checkbox-pill {
    color: #fff;
    border-color: transparent;
}

.badge-gadelob-label input:checked + .crc-checkbox-pill {
    background: var(--crc-blue);
}

.badge-ocr-label input:checked + .crc-checkbox-pill {
    background: var(--crc-orange);
}

.badge-trail-label input:checked + .crc-checkbox-pill {
    background: var(--crc-green);
}

.badge-ultra-label input:checked + .crc-checkbox-pill {
    background: var(--crc-purple);
}

.badge-lob-label input:checked + .crc-checkbox-pill {
    background: var(--crc-teal);
}

/* ========== Single Event Page ========== */
.crc-single {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 32px;
    max-width: 1200px;
    margin: 32px auto;
    padding: 0 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.crc-single-content {
    min-width: 0;
}

.crc-single-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--crc-dark);
    margin: 0 0 24px;
    line-height: 1.2;
}

.crc-single-body {
    font-size: 16px;
    line-height: 1.7;
    color: #374151;
}

.crc-single-body p {
    margin-bottom: 16px;
}

.crc-single-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Event location map */
.crc-event-map-wrap {
    margin-top: 32px;
}

#crc-event-map {
    width: 100%;
    height: 340px;
    border-radius: var(--crc-radius-md);
    overflow: hidden;
    border: 1px solid var(--crc-separator);
}

.crc-event-map-popup {
    font-size: 13px;
    line-height: 1.5;
}

.crc-event-map-popup strong {
    display: block;
    margin-bottom: 2px;
}

/* Sidebar Panel */
.crc-sidebar-panel {
    background: #fff;
    border-radius: var(--crc-radius);
    box-shadow: var(--crc-shadow);
    overflow: hidden;
    position: sticky;
    top: 32px;
}

.crc-sidebar-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.crc-sidebar-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crc-sidebar-image .crc-badge {
    top: 12px;
    left: 12px;
}

.crc-sidebar-image .crc-badges-container {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.crc-sidebar-image .crc-badges-container .crc-badge {
    position: static;
}

.crc-sidebar-details {
    padding: 20px;
}

.crc-sidebar-heading {
    font-size: 16px;
    font-weight: 700;
    color: var(--crc-dark);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--crc-border);
}

.crc-sidebar-dl {
    margin: 0 0 20px;
}

.crc-sidebar-dl dt {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--crc-grey);
    margin-bottom: 2px;
}

.crc-sidebar-dl dd {
    font-size: 15px;
    font-weight: 600;
    color: var(--crc-dark);
    margin: 0 0 14px 0;
}

.crc-btn-full {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px 20px;
    font-size: 16px;
    box-sizing: border-box;
}

/* ========== Responsive ========== */
@media (max-width: 899px) {
    .crc-widget--horizontal {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .crc-widget-item--h .crc-widget-item-image {
        height: 110px;
    }
}

@media (max-width: 768px) {
    .crc-single {
        grid-template-columns: 1fr;
    }

    .crc-sidebar-panel {
        position: static;
    }
    .crc-filter-bar {
        flex-direction: column;
    }

    .crc-filter-group {
        min-width: 100%;
    }

    .crc-event-list {
        grid-template-columns: 1fr;
    }

    .crc-map {
        height: 300px;
    }

    .crc-form-row {
        flex-direction: column;
        gap: 0;
    }

    .crc-submit-form {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .crc-widget--horizontal {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .crc-widget-item--h {
        border-radius: 8px;
    }

    .crc-widget-item--h .crc-widget-item-image {
        height: 85px;
    }

    .crc-widget-item--h .crc-widget-item-body {
        padding: 7px 9px;
    }

    .crc-widget--horizontal .crc-widget-item-title {
        font-size: 0.77rem;
        margin-bottom: 3px;
    }

    .crc-widget--horizontal .crc-widget-item-meta {
        font-size: 0.68rem;
        gap: 2px 6px;
        margin-bottom: 6px;
    }

    .crc-widget--horizontal .crc-btn-sm {
        padding: 4px 10px;
        font-size: 0.7rem;
    }

    .crc-widget--horizontal .crc-widget-item-image .crc-badge {
        font-size: 9px;
        padding: 2px 7px;
    }

    .crc-widget-footer-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}


/* =====================================================================
 * Admin Floating Button & Modal
 * ===================================================================== */

/* Floating Button */
.crc-admin-float-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #2271b1;
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 9998;
}

.crc-admin-float-btn:hover {
    background: #135e96;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

.crc-admin-float-btn:focus {
    outline: 3px solid #135e96;
    outline-offset: 2px;
}

.crc-admin-float-btn svg {
    width: 24px;
    height: 24px;
}

/* Modal Overlay */
.crc-admin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.crc-admin-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

/* Modal Content */
.crc-admin-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Modal Header */
.crc-admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.crc-admin-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1d2327;
}

.crc-admin-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.crc-admin-modal-close:hover,
.crc-admin-modal-close:focus {
    background: #f0f0f0;
    color: #000;
}

.crc-admin-modal-close:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Tabs */
.crc-admin-modal-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    background: #f6f7f7;
}

.crc-admin-modal-tab {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
}

.crc-admin-modal-tab:hover {
    color: #2271b1;
    background: #fff;
}

.crc-admin-modal-tab.active {
    color: #2271b1;
    background: #fff;
    border-bottom-color: #2271b1;
}

.crc-admin-modal-tab:focus {
    outline: 2px solid #2271b1;
    outline-offset: -2px;
}

/* Modal Body */
.crc-admin-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.crc-admin-tab-content {
    display: none;
}

.crc-admin-tab-content.active {
    display: block;
}

/* Form Styles */
.crc-admin-form-group {
    margin-bottom: 20px;
}

.crc-admin-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #1d2327;
    font-size: 14px;
}

.crc-admin-input,
.crc-admin-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: border-color 0.2s ease;
}

.crc-admin-input:focus,
.crc-admin-textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.crc-admin-textarea {
    resize: vertical;
}

/* Input with inline action button */
.crc-input-with-btn {
    display: flex;
    align-items: stretch;
    gap: 0;
}
.crc-input-with-btn .crc-admin-input {
    flex: 1;
    border-radius: 4px 0 0 4px;
}
.crc-input-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    background: #f6f7f7;
    border: 1px solid #8c8f94;
    border-left: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    color: #50575e;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.crc-input-action-btn:hover {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

/* Messages */
.crc-admin-messages {
    margin-bottom: 16px;
}

.crc-admin-error,
.crc-admin-success {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 14px;
}

.crc-admin-error {
    background: #fcf0f1;
    border-left: 4px solid #d63638;
    color: #50575e;
}

.crc-admin-success {
    background: #edfaef;
    border-left: 4px solid #00a32a;
    color: #1d2327;
}

/* Buttons */
.crc-admin-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.crc-admin-btn-primary {
    background: #2271b1;
    color: #fff;
}

.crc-admin-btn-primary:hover {
    background: #135e96;
}

.crc-admin-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .crc-admin-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .crc-admin-modal-body {
        padding: 16px;
    }

    .crc-admin-float-btn {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }
}

/* =====================================================================
 * User Request Change Floating Button & Modal
 * ===================================================================== */

.crc-request-change-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    height: 44px;
    padding: 0 16px;
    border-radius: 22px;
    background: #34C759;
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    z-index: 9998;
}

.crc-request-change-btn:hover {
    background: #28a745;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transform: scale(1.03);
}

.crc-request-change-btn:focus {
    outline: 3px solid #28a745;
    outline-offset: 2px;
}

.crc-request-change-btn svg {
    flex-shrink: 0;
}

.crc-request-modal-intro {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0 0 16px;
}

@media (max-width: 600px) {
    .crc-request-change-btn span {
        display: none;
    }
    .crc-request-change-btn {
        width: 48px;
        height: 48px;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
        bottom: 16px;
        left: 16px;
    }
}

/* Admin modal: multi-column form rows */
.crc-admin-form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.crc-admin-form-row .crc-admin-form-group {
    margin-bottom: 0;
    min-width: 0;
}

.crc-admin-form-group--grow {
    flex: 1;
    min-width: 140px;
}

/* Admin modal: featured image section */
.crc-admin-image-section {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 12px;
    background: #f6f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    flex-wrap: wrap;
}

.crc-admin-image-preview-wrap {
    width: 120px;
    min-height: 80px;
    background: #e0e0e0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

#crc-admin-img-preview {
    width: 120px;
    height: 90px;
    object-fit: cover;
    display: block;
    border-radius: 4px;
}

#crc-admin-no-image {
    font-size: 12px;
    color: #787c82;
    text-align: center;
    padding: 8px;
}

.crc-admin-image-controls {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.crc-admin-image-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.crc-admin-file-label {
    cursor: pointer;
    display: inline-block;
}

.crc-admin-image-url-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.crc-admin-image-url-row .crc-admin-input {
    flex: 1;
    padding: 8px 10px;
    font-size: 13px;
}

/* Admin modal: map picker */
.crc-admin-map-picker {
    width: 100%;
    height: 260px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    margin-top: 6px;
}

.crc-map-picker-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.crc-map-picker-toolbar .button,
.crc-map-picker-toolbar button {
    font-size: 12px;
    padding: 4px 10px;
    height: auto;
    line-height: 1.5;
}

.crc-geocode-status {
    font-size: 12px;
    color: #666;
}

.crc-map-coords-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 6px;
    font-size: 12px;
    color: #555;
}

.crc-map-coords-row input[type="number"] {
    width: 130px;
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    display: inline-block;
    vertical-align: middle;
}

/* Address autocomplete dropdown */
.crc-address-autocomplete-wrap {
    position: relative;
    width: 100%;
}
.crc-address-autocomplete-wrap input {
    width: 100%;
    box-sizing: border-box;
}
.crc-address-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100001;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    margin: 0;
    padding: 0;
    list-style: none;
    max-height: 220px;
    overflow-y: auto;
}
.crc-address-dropdown-item {
    padding: 9px 12px;
    font-size: 13px;
    color: #1d1d1f;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.4;
}
.crc-address-dropdown-item:last-child {
    border-bottom: none;
}
.crc-address-dropdown-item:hover,
.crc-address-dropdown-item.is-focused {
    background: #f0f6fc;
    color: #007AFF;
}

/* Admin modal: form footer (Save + Delete) */
.crc-admin-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    margin-top: 8px;
    gap: 12px;
}

.crc-admin-btn-danger {
    background: #d63638;
    color: #fff;
}

.crc-admin-btn-danger:hover {
    background: #b32d2e;
}

.crc-admin-btn-danger:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Admin modal: distance tag input */
#crc-admin-edit-form .crc-distance-tag-input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: text;
    min-height: 40px;
    transition: border-color 0.2s ease;
}

#crc-admin-edit-form .crc-distance-tag-input:focus-within {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

#crc-admin-edit-form .crc-distance-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

#crc-admin-edit-form .crc-distance-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #2271b1;
    color: #fff;
    padding: 2px 8px 2px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

#crc-admin-edit-form .crc-distance-tag-remove {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
}

#crc-admin-edit-form .crc-distance-tag-remove:hover {
    color: #fff;
}

#crc-admin-edit-form .crc-distance-text-input {
    border: none;
    outline: none;
    font-size: 14px;
    min-width: 80px;
    flex: 1;
    padding: 2px 0;
    background: transparent;
}

/* Admin modal: Quill WYSIWYG editor */
.crc-admin-quill-editor {
    min-height: 150px;
    border: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.crc-admin-quill-editor .ql-editor {
    min-height: 150px;
}

/* Quill toolbar sits just above the editor area */
#crc-admin-edit-form .ql-toolbar {
    border: 1px solid #ddd;
    border-radius: 4px 4px 0 0;
    border-bottom: none;
}

#crc-admin-edit-form .ql-container {
    border: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
    font-size: 14px;
}

#crc-admin-edit-form .ql-container:focus-within {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

/* ========== FAQ Modal ========== */
.crc-form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.crc-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.crc-modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 24px 32px;
    border: 1px solid #888;
    width: 80%;
    max-width: 720px;
    border-radius: var(--crc-radius);
    position: relative;
    box-shadow: var(--crc-shadow-lg);
    max-height: 80vh;
    overflow-y: auto;
}

.crc-modal-close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
}

.crc-modal-close:hover,
.crc-modal-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.crc-modal-content h1 {
    font-size: 24px;
    margin-top: 0;
    color: var(--crc-dark);
}

.crc-modal-content h2 {
    font-size: 20px;
    border-bottom: 1px solid var(--crc-border);
    padding-bottom: 8px;
    margin-top: 24px;
    color: var(--crc-dark);
}

.crc-modal-content p, .crc-modal-content li {
    font-size: 15px;
    line-height: 1.6;
    color: #374151;
}

/* ========== Registration Modal ========== */
.crc-register-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9990;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crc-register-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.crc-register-modal {
    position: relative;
    z-index: 9991;
    background: #fff;
    padding: 32px 40px;
    border-radius: var(--crc-radius);
    box-shadow: var(--crc-shadow-lg);
    width: 90%;
    max-width: 420px;
    text-align: center;
}

.crc-register-modal h3 {
    font-size: 22px;
    color: var(--crc-dark);
    margin: 0 0 8px;
}

.crc-register-modal p {
    color: #6b7280;
    font-size: 15px;
    margin: 0 0 24px;
}

#crc-register-form {
    text-align: left;
}

#crc-register-form .crc-form-field {
    margin-bottom: 16px;
}

.crc-register-login-link {
    margin-top: 20px !important;
    font-size: 14px !important;
}

.crc-register-login-link a {
    color: var(--crc-blue);
    font-weight: 600;
    text-decoration: none;
}
.crc-register-login-link a:hover {
    text-decoration: underline;
}

/* =====================================================================
 * Date-range picker (Flatpickr)
 * ===================================================================== */

.crc-filter-group--date-range {
    min-width: 220px;
}

.crc-date-range-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.crc-date-range-input {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--crc-border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--crc-light);
    cursor: pointer;
    width: 100%;
    min-width: 190px;
    color: var(--crc-dark);
    transition: border-color 0.2s;
}

.crc-date-range-input:focus {
    outline: none;
    border-color: var(--crc-blue, #007AFF);
    box-shadow: 0 0 0 3px rgba(0,122,255,0.12);
}

.crc-date-range-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: var(--crc-gray, #6b7280);
    padding: 0 2px;
    display: none;
    transition: color 0.15s;
}

.crc-date-range-clear.is-visible {
    display: block;
}

.crc-date-range-clear:hover {
    color: var(--crc-dark, #111827);
}

/* ── Flatpickr – moderne tema ───────────────────────────────────────── */

.flatpickr-calendar {
    border: none !important;
    border-radius: 20px !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 4px 16px rgba(0,0,0,0.08) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    padding: 0 0 12px !important;
    overflow: hidden !important;
    background: #fff !important;
    width: 320px !important;
}

/* Header — månedsnavn + navigationspilar */
.flatpickr-months {
    background: linear-gradient(135deg, #007AFF 0%, #0055cc 100%) !important;
    padding: 16px 12px 14px !important;
    border-radius: 0 !important;
}

.flatpickr-months .flatpickr-month {
    background: transparent !important;
    color: #fff !important;
    fill: #fff !important;
    height: 36px !important;
}

.flatpickr-current-month {
    font-size: 16px !important;
    font-weight: 700 !important;
    letter-spacing: -0.3px !important;
    padding-top: 4px !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 16px !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months:hover,
.flatpickr-current-month input.cur-year:hover {
    background: rgba(255,255,255,0.15) !important;
    border-radius: 6px !important;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    color: rgba(255,255,255,0.85) !important;
    fill: rgba(255,255,255,0.85) !important;
    top: 16px !important;
    padding: 6px !important;
    border-radius: 8px !important;
    transition: background 0.15s !important;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    background: rgba(255,255,255,0.2) !important;
    color: #fff !important;
    fill: #fff !important;
}

/* Ugedage-header */
.flatpickr-weekdays {
    background: #f5f7fa !important;
    padding: 8px 0 4px !important;
    border-bottom: 1px solid #eef0f4 !important;
}

span.flatpickr-weekday {
    background: transparent !important;
    color: #9ca3af !important;
    fill: #9ca3af !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* Dag-grid */
.flatpickr-days {
    padding: 8px 10px 0 !important;
    border: none !important;
    width: 320px !important;
}

.dayContainer {
    width: 300px !important;
    min-width: 300px !important;
    max-width: 300px !important;
}

.flatpickr-day {
    border-radius: 10px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #1d1d1f !important;
    border: none !important;
    height: 36px !important;
    line-height: 36px !important;
    max-width: 36px !important;
    transition: background 0.15s, color 0.15s, transform 0.1s !important;
}

.flatpickr-day:hover:not(.flatpickr-disabled):not(.startRange):not(.endRange):not(.selected) {
    background: #f0f5ff !important;
    color: #007AFF !important;
    transform: scale(1.08) !important;
}

/* Dage udenfor måneden */
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: #d1d5db !important;
}

/* Deaktiverede dage */
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: #e5e7eb !important;
}

/* Interval-highlight */
.flatpickr-day.inRange {
    background: #dbeafe !important;
    border-color: transparent !important;
    border-radius: 0 !important;
    box-shadow: -5px 0 0 #dbeafe, 5px 0 0 #dbeafe !important;
    color: #1e40af !important;
}

/* Start- og slutdato */
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
    background: #007AFF !important;
    border-color: #007AFF !important;
    border-radius: 10px !important;
    color: #fff !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 12px rgba(0,122,255,0.4) !important;
    transform: scale(1.05) !important;
}

.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange {
    box-shadow: none !important;
}

/* Forbind inRange-bjælken til start/slut */
.flatpickr-day.startRange {
    border-radius: 10px 0 0 10px !important;
}
.flatpickr-day.endRange {
    border-radius: 0 10px 10px 0 !important;
}
.flatpickr-day.startRange.endRange {
    border-radius: 10px !important;
}

/* I dag */
.flatpickr-day.today {
    border: 2px solid #007AFF !important;
    color: #007AFF !important;
    font-weight: 700 !important;
}
.flatpickr-day.today:hover {
    background: #007AFF !important;
    color: #fff !important;
}
.flatpickr-day.today.inRange {
    border-color: transparent !important;
}

/* Enkelt valgt dato */
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: #007AFF !important;
    border-color: #007AFF !important;
    border-radius: 10px !important;
    color: #fff !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 12px rgba(0,122,255,0.4) !important;
}

/* =====================================================================
 * Custom map pin markers
 * ===================================================================== */

/*
 * .crc-pin-fan  – zero-size anchor element placed at the lat/lng point.
 * .crc-pin      – one pin per race-type, rotated around its own tip.
 * .crc-pin-body – coloured rectangular label showing the date.
 * .crc-pin-tip  – CSS triangle that forms the pointy bottom of the pin.
 *
 * Dimensions:
 *   body:  ~22 px tall  (font 10 px + padding 3+3 + border 1+1 + line-height gap)
 *   tip:   10 px tall
 *   total: ~32 px
 *   width: 52 px
 *
 * The pin element is offset so that its tip sits exactly at (0,0) of the
 * fan container, which Leaflet places at the event's coordinates.
 *   top:              -32px  → moves tip to y=0
 *   left:             -26px  → centres the 52 px body on x=0
 *   transform-origin: 26px 32px  → rotation axis is the tip
 */

.crc-pin-fan {
    position: relative;
    width: 0;
    height: 0;
}

.crc-pin {
    position: absolute;
    top: -32px;
    left: -26px;
    width: 52px;
    transform-origin: 26px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: filter 0.15s;
}

.crc-pin:hover {
    filter: brightness(1.15) drop-shadow(0 3px 6px rgba(0,0,0,0.35));
    z-index: 9999 !important;
}

.crc-pin-body {
    background: var(--pin-color, #007AFF);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    padding: 3px 5px;
    border-radius: 5px;
    white-space: nowrap;
    text-align: center;
    min-width: 40px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.28);
    border: 1px solid rgba(255,255,255,0.35);
}

.crc-pin-tip {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 10px solid var(--pin-color, #007AFF);
}

/* Reset absolute badge positioning inside the popup */
.crc-popup .crc-badge {
    position: static;
}

/* Popup layout */
.crc-popup-date {
    font-size: 12px;
    color: #6b7280;
    margin: 2px 0 6px;
}

.crc-popup-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 8px;
    margin: 4px 0 6px;
}

.crc-popup-distance {
    font-size: 12px;
    color: #374151;
}

.crc-popup-types {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

