/* =========================================
   Events Page Styles
   ========================================= */

.events-body {
    background: var(--bg-white);
}

/* Events page content aligns with navbar (.container is 1200px). */

/* Hero Underline Decoration */
.hero-underline {
    position: relative;
    display: inline-block;
    color: #FCD34D;
    font-style: italic;
}

.hero-underline::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 4px;
    height: 12px;
    background: rgba(252, 211, 77, 0.3);
    border-radius: 4px;
    z-index: -1;
}

/* =========================================
   Events Hero
   ========================================= */
.events-hero {
    position: relative;
    padding: 180px 24px 120px;
    color: white;
    min-height: 88vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.events-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

.events-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform-origin: center center;
    animation: heroKenBurns 20s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
    will-change: transform;
}

@keyframes heroKenBurns {
    from { transform: scale(1); }
    to   { transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
    .events-hero-image { animation: none; }
}

.events-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg,
        rgba(15, 23, 42, 0.78) 0%,
        rgba(0, 40, 100, 0.62) 50%,
        rgba(0, 102, 255, 0.55) 100%);
}

.events-hero-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 64px;
    align-items: flex-end;
}

.events-hero-text { max-width: 620px; }


.events-hero h1 {
    font-size: clamp(2.4rem, 5vw, 4.25rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin: 0 0 20px;
}

.events-hero-sub {
    font-size: var(--text-lg);
    line-height: 1.6;
    opacity: 0.92;
    margin: 0 0 28px;
    max-width: 540px;
}

.events-hero-stats {
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    font-size: var(--text-base);
}

.events-hero-stats .stat-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.92);
    position: relative;
}

.events-hero-stats .stat-item strong {
    font-weight: 700;
    color: #fff;
}

.events-hero-stats .stat-item + .stat-item::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    margin-right: 10px;
}

.events-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.events-hero-actions .btn { padding: 12px 28px; }

/* Next Event card */
.events-hero-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.hero-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.hero-card-eyebrow {
    font-size: var(--text-xs);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
}

.hero-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-blue-light);
    color: var(--primary-blue);
    border-radius: var(--radius-pill);
    padding: 5px 12px;
    font-size: var(--text-xs);
    font-weight: 600;
}
.hero-card-badge i { width: 14px; height: 14px; }

.hero-card-body {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.hero-card-info { min-width: 0; }

.hero-card-day {
    font-size: var(--text-sm);
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.hero-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 10px;
    letter-spacing: -0.01em;
    color: var(--text-dark);
}

.hero-card-loc {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-sm);
    color: var(--text-muted);
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
}
.hero-card-loc i { width: 13px; height: 13px; }

.hero-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.hero-card-foot .mini-avatars img {
    width: 32px;
    height: 32px;
    border-width: 2px;
    margin-left: -8px;
}
.hero-card-foot .mini-avatars img:first-child { margin-left: 0; }

.hero-card-going {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-left: 10px;
}
.hero-card-going strong { font-weight: 700; color: var(--text-dark); }

.btn-sm { padding: 8px 18px; font-size: var(--text-sm); }

@media (max-width: 1024px) {
    .events-hero { padding: 150px 24px 90px; min-height: auto; }
    .events-hero-inner {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .events-hero-text { max-width: 100%; }
    .events-hero-card { max-width: 520px; }
}

@media (max-width: 768px) {
    .events-hero { padding: 130px 20px 70px; }
    .events-hero-stats { gap: 10px 14px; font-size: var(--text-sm); }
    .events-hero-stats .stat-item + .stat-item::before { display: none; }
    .events-hero-card { max-width: 100%; padding: 18px; }
    .hero-card-title { font-size: 1.1rem; }
    .events-hero-actions .btn { flex: 1 1 100%; text-align: center; }
}

@media (max-width: 480px) {
    .events-hero h1 { font-size: clamp(2rem, 8vw, 2.6rem); }
    .hero-card-body { gap: 12px; }
    .hero-card-foot { flex-wrap: wrap; }
}

/* Search Bar */
.events-search-bar {
    background: white;
    border-radius: var(--radius-pill);
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: 720px;
    margin: 0 auto var(--space-2xl);
    box-shadow: var(--shadow-lg);
}

.search-field {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    min-width: 0;
}

.search-field i {
    width: 18px;
    height: 18px;
    color: var(--text-faint);
    flex-shrink: 0;
}

.search-field input,
.search-field select {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--font-main);
    font-size: var(--text-base);
    color: var(--text-dark);
    font-weight: 500;
    min-width: 0;
    outline: none;
}

.search-field input::placeholder {
    color: var(--text-faint);
}

.search-divider {
    width: 1px;
    height: 28px;
    background: var(--border-light);
}

.search-submit {
    padding: 14px 28px;
    flex-shrink: 0;
}

/* Hero stats */
.events-hero-stats {
    display: inline-flex;
    gap: 48px;
    padding: 20px 32px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-xl);
}

.hero-stat {
    text-align: center;
    line-height: 1.2;
}

.hero-stat strong {
    display: block;
    font-size: var(--text-3xl);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero-stat span {
    font-size: var(--text-sm);
    opacity: 0.85;
}

/* =========================================
   Featured Event Section
   ========================================= */
.featured-event-section {
    padding: var(--section-pad) 0 24px;
}

.section-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: var(--space-2xl);
}

.section-header-inline h2 {
    font-size: clamp(2rem, 3.5vw, 2.75rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-dark);
    letter-spacing: -0.02em;
    margin-top: var(--space-sm);
}

.featured-event {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    background: white;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

.featured-image {
    position: relative;
    min-height: 480px;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--ease-out-expo);
}

.featured-event:hover .featured-image img {
    transform: scale(1.04);
}

.featured-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.4) 100%);
}

.featured-badges {
    position: absolute;
    top: 24px;
    left: 24px;
    display: flex;
    gap: 8px;
}

.event-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: white;
    color: var(--text-dark);
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.3px;
    box-shadow: var(--shadow-sm);
}

.event-badge i {
    width: 14px;
    height: 14px;
}

.badge-cycling { color: #0066FF; }
.badge-padel { color: var(--primary-blue); }
.badge-running { color: #EA580C; }
.badge-social { color: #16A34A; }

.badge-featured {
    background: linear-gradient(135deg, #F59E0B, #EF4444);
    color: white;
}

.featured-live {
    position: absolute;
    bottom: 24px;
    left: 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(10px);
    color: white;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    font-size: var(--text-sm);
    font-weight: 600;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22C55E;
    animation: pulse 2s infinite;
}

.featured-content {
    padding: 40px;
    display: flex;
    flex-direction: column;
}

.featured-meta-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: center;
}

.featured-date-box {
    flex-shrink: 0;
    width: 72px;
    height: 80px;
    border-radius: var(--radius-md);
    background: var(--primary-blue-light);
    color: var(--primary-blue);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.date-month {
    font-size: var(--text-xs);
    font-weight: 800;
    letter-spacing: 1.5px;
}

.date-day {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.featured-day {
    display: block;
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.featured-info h3 {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.featured-desc {
    color: var(--text-muted);
    font-size: var(--text-base);
    line-height: 1.6;
    margin-bottom: var(--space-lg);
}

.featured-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 20px 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 24px;
}

.detail-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-light);
    border-radius: var(--radius-pill);
    font-size: var(--text-sm);
    color: var(--text-body);
    font-weight: 500;
}

.detail-chip i {
    width: 14px;
    height: 14px;
    color: var(--primary-blue);
}

.difficulty-chip {
    font-weight: 600;
}

.difficulty-easy { background: rgba(34, 197, 94, 0.1); color: #16A34A; }
.difficulty-easy i { color: #16A34A; }
.difficulty-medium { background: rgba(245, 158, 11, 0.1); color: #D97706; }
.difficulty-medium i { color: #D97706; }
.difficulty-hard { background: rgba(239, 68, 68, 0.1); color: #DC2626; }
.difficulty-hard i { color: #DC2626; }

.featured-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: auto;
}

.featured-attendees {
    display: flex;
    align-items: center;
    gap: 12px;
}

.featured-attendees .mini-avatars {
    display: inline-flex;
    align-items: center;
}

.featured-attendees .mini-avatars img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    margin-left: -10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.featured-attendees .mini-avatars img:first-child {
    margin-left: 0;
}

.featured-attendees strong {
    display: block;
    font-size: var(--text-base);
    color: var(--text-dark);
    font-weight: 700;
}

.featured-attendees span {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.featured-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-ghost {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-light);
}

.btn-ghost:hover {
    background: white;
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
}

/* =========================================
   All Events Section
   ========================================= */
.all-events-section {
    padding: 24px 0 var(--section-pad);
}

.events-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: clamp(10px, 1.2vw, 16px);
    flex-wrap: wrap;
    margin-bottom: clamp(20px, 2.5vw, 32px);
}

.event-category-tabs {
    position: relative;
    display: flex;
    gap: clamp(2px, 0.4vw, 6px);
    padding: clamp(4px, 0.5vw, 6px);
    background: white;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-light);
    isolation: isolate;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-wrap: nowrap;
    /* Smooth horizontal scroll + momentum on touch, with a little breathing
       room so scrollIntoView() doesn't jam a tab against the edge. */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-padding-inline: 8px;
}

.event-category-tabs::-webkit-scrollbar { display: none; }

/* FLIP morphing highlight — physically slides between tabs */
.evt-tab-indicator {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--primary-blue);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-blue);
    z-index: 0;
    opacity: 0;
    pointer-events: none;
    will-change: transform, width, height;
}

.evt-tab {
    position: relative;
    z-index: 1;
    padding: clamp(7px, 1vw, 10px) clamp(12px, 1.6vw, 20px);
    border-radius: var(--radius-pill);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: clamp(0.78rem, 0.85vw + 0.5rem, var(--text-sm));
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: clamp(4px, 0.6vw, 8px);
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.3s ease;
    font-family: var(--font-main);
}

.evt-tab:hover:not(.active) { color: var(--text-dark); }

.evt-tab.active {
    color: white;
}

.evt-tab.active i {
    color: white;
}

.evt-tab i { width: 16px; height: 16px; transition: color 0.3s ease; }

.evt-tab .count {
    background: rgba(255, 255, 255, 0.25);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: 700;
    min-width: 22px;
    text-align: center;
    transition: background 0.3s ease, color 0.3s ease;
}

.evt-tab:not(.active) .count {
    background: var(--bg-light);
    color: var(--text-muted);
}

.evt-tab.active .count {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

/* View Toggle */
.events-view-toggle {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: white;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-light);
    flex-shrink: 0;
}

.view-btn {
    padding: clamp(7px, 0.9vw, 8px) clamp(10px, 1.4vw, 16px);
    border-radius: var(--radius-pill);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: clamp(0.78rem, 0.85vw + 0.5rem, var(--text-sm));
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-main);
    transition: all var(--duration-normal);
}

.view-btn i { width: 16px; height: 16px; flex-shrink: 0; }

.view-btn.active {
    background: var(--text-dark);
    color: white;
}

/* Icon-only view toggle on narrow viewports */
@media (max-width: 560px) {
    .view-btn {
        padding: 8px;
    }
    .view-btn .view-btn-label {
        display: none;
    }
}

/* =========================================
   Events Grid
   ========================================= */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap: clamp(12px, 1.4vw, 20px);
}

/* Override .event-card's fixed clamp() width (which is sized for horizontal
   scroll carousels) so cards stretch to fill the grid track. */
.events-grid > .event-card {
    width: 100%;
    max-width: none;
}

/* Event card base styles now in styles.css */

.event-card-badges {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
    z-index: 2;
}

.event-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-light);
}

/* Share button ripple feel */
.featured-share,
.featured-bookmark {
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s var(--ease-out-expo), color 0.25s ease;
}

.featured-share:hover,
.featured-bookmark:hover {
    transform: translateY(-2px);
}

.featured-share:active,
.featured-bookmark:active {
    transform: scale(0.93);
}

.event-card.full .event-card-rsvp {
    background: var(--text-faint);
    cursor: not-allowed;
}

/* Spots indicator (floats over event image, bottom-left) */
.spots-left-indicator {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: white;
    font-weight: 700;
    padding: 4px 10px;
    background: rgba(220, 38, 38, 0.92);
    backdrop-filter: blur(6px);
    border-radius: var(--radius-pill);
    z-index: 2;
}

.spots-left-indicator .pulse-badge {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
    animation: pulse-dot 1.4s ease-in-out infinite;
}

.spots-left-indicator.urgent {
    color: white;
    background: rgba(220, 38, 38, 0.95);
    animation: pulse-badge 2s ease-in-out infinite;
}

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

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

/* ---- Event card content (missing classes) ---- */
/* Sub-elements now in styles.css */

.event-desc {
    font-size: var(--text-sm);
    color: var(--text-body);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Standalone mini-avatars container (card footer) */


.event-card-attendees .mini-avatars img:first-child {
    margin-left: 0;
}

.ec-attendee-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    gap: 2px;
}

.ec-attendee-info > span:first-child,
.ec-attendee-info .ec-going {
    font-size: var(--text-xs);
    color: var(--text-body);
}

.ec-attendee-info strong {
    font-weight: 800;
    color: var(--text-dark);
}

/* Make the whole event card clickable. We keep the inner Join + bookmark
   buttons stop-propagating their own clicks (handled in events.js). */
.events-grid > .event-card {
    cursor: pointer;
    transition: transform 0.25s var(--ease-out-expo), box-shadow 0.25s ease;
}
.events-grid > .event-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.events-grid > .event-card:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 3px;
}

.events-load-more {
    text-align: center;
    margin-top: var(--space-2xl);
}

#events-load-more-btn {
    transition: transform 0.25s var(--ease-out-expo), background 0.25s ease;
}

#events-load-more-btn:hover { transform: none; }
#events-load-more-btn:active { transform: scale(0.97); }
#events-load-more-btn i { transition: transform 0.5s var(--ease-out-expo); }
#events-load-more-btn:hover i { transform: rotate(180deg); }

/* Active date filter banner (shown when user clicks a calendar day) */
.active-date-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px;
    margin-bottom: 18px;
    background: rgba(0, 102, 255, 0.08);
    border: 1px solid rgba(0, 102, 255, 0.18);
    border-radius: var(--radius-pill);
    color: var(--text-dark);
    font-size: var(--text-sm);
    font-weight: 600;
    animation: banner-in 0.35s var(--ease-out-back);
}

.active-date-banner i {
    width: 16px;
    height: 16px;
    color: var(--primary-blue);
    vertical-align: middle;
    margin-right: 6px;
}

.active-date-banner .btn-sm {
    padding: 6px 14px;
    font-size: var(--text-xs);
}

@keyframes banner-in {
    0%   { transform: translateY(-8px); opacity: 0; }
    100% { transform: translateY(0);    opacity: 1; }
}

/* Empty state when no events match filter */
.events-empty {
    grid-column: 1 / -1;
    padding: 64px 32px;
    text-align: center;
    border: 1.5px dashed var(--border-light);
    border-radius: var(--radius-xl);
    background: var(--bg-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.events-empty i {
    width: 48px;
    height: 48px;
    color: var(--text-faint);
    margin-bottom: 4px;
}

.events-empty h3 {
    font-size: var(--text-xl);
    font-weight: 800;
    color: var(--text-dark);
}

.events-empty p {
    font-size: var(--text-base);
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* =========================================
   Calendar View
   ========================================= */
.events-calendar-view {
    background: white;
    border-radius: var(--radius-xl);
    padding: clamp(12px, 2.4vw, 32px);
    border: 1px solid var(--border-light);
}

.calendar-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}

.calendar-header h3 {
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.01em;
    min-width: 200px;
    text-align: center;
}

.cal-nav {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    transition: all var(--duration-normal);
}

.cal-nav:hover {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.calendar-weekdays > div {
    text-align: center;
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.cal-day {
    min-width: 0;
    min-height: clamp(64px, 9vw, 120px);
    border-radius: var(--radius-md);
    padding: 8px;
    background: var(--bg-light);
    border: 1px solid transparent;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all var(--duration-fast);
    font-family: var(--font-main);
    text-align: left;
}

.cal-day:hover:not(.cal-day-empty):not(.cal-day-muted) {
    background: white;
    border-color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 102, 255, 0.12);
}

.cal-day.cal-day-has-events {
    background: rgba(0, 102, 255, 0.04);
    border-color: rgba(0, 102, 255, 0.12);
}

.cal-day.cal-day-has-events::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-blue);
    opacity: 0.8;
}

.cal-day-today {
    background: rgba(0, 102, 255, 0.08) !important;
    border-color: var(--primary-blue) !important;
}

.cal-day-empty {
    background: transparent;
    cursor: default;
    opacity: 0.3;
}

.cal-day-num {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.cal-day.today .cal-day-num {
    background: var(--primary-blue);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
}

.cal-day-events {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.cal-event-pill {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    min-width: 0;
    max-width: 100%;
}

.cal-event-cycling { background: rgba(0, 102, 255, 0.12); color: #0052cc; }
.cal-event-padel { background: rgba(139, 92, 246, 0.12); color: #7C3AED; }
.cal-event-running { background: rgba(234, 88, 12, 0.12); color: #C2410C; }
.cal-event-social { background: rgba(22, 163, 74, 0.12); color: #15803D; }

.cal-event-more {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
}

.calendar-legend {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-weight: 600;
}

.legend-item .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-cycling { background: #0066FF; }
.dot-padel { background: #8B5CF6; }
.dot-running { background: #EA580C; }
.dot-social { background: #16A34A; }

/* =========================================
   Past Events / Highlights
   ========================================= */
.past-events-section {
    padding: var(--section-pad) 0;
    background: var(--bg-light);
}

.past-events-section .section-header {
    margin-bottom: 60px;
}

.highlights-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 16px;
}

.highlight-card {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    height: 240px;
    cursor: pointer;
}

.highlight-large {
    grid-column: 1;
    grid-row: 1 / 3;
    height: auto;
}

.highlight-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out-expo);
}

.highlight-card:hover img {
    transform: scale(1.06);
}

.highlight-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,0.8) 100%);
    z-index: 1;
}

.highlight-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    color: white;
    z-index: 2;
}

.highlight-date {
    font-size: var(--text-xs);
    font-weight: 700;
    opacity: 0.9;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 4px;
    display: block;
}

.highlight-info h4 {
    font-size: var(--text-lg);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 4px;
}

.highlight-large .highlight-info h4 {
    font-size: var(--text-2xl);
}

.highlight-attended {
    font-size: var(--text-sm);
    opacity: 0.85;
}

/* =========================================
   Newsletter
   ========================================= */
.newsletter-section {
    padding: 0 24px var(--section-pad);
}

.newsletter-box {
    background: linear-gradient(135deg, #0066FF 0%, #0044CC 100%);
    border-radius: var(--radius-2xl);
    padding: 64px;
    color: white;
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 48px;
}

.newsletter-box::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
}

.newsletter-box::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
}

.newsletter-content {
    position: relative;
    z-index: 2;
}

.newsletter-content h2 {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 8px 0 12px;
    color: white;
}

.newsletter-content p {
    opacity: 0.9;
    font-size: var(--text-base);
    line-height: 1.6;
    max-width: 380px;
}

.newsletter-form {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 8px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.newsletter-form input {
    flex: 1;
    min-width: 220px;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: white;
    font-family: var(--font-main);
    font-size: var(--text-base);
    outline: none;
}

.newsletter-form input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.newsletter-visual {
    position: relative;
    z-index: 2;
    justify-self: end;
}

.newsletter-visual img {
    width: 200px;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
    animation: float 6s ease-in-out infinite;
}

/* =========================================
   RSVP Modal
   ========================================= */
.rsvp-modal-content {
    max-width: 500px;
}

.rsvp-event-preview {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.rsvp-event-preview img {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.rsvp-event-preview > div {
    flex: 1;
    min-width: 0;
}

.rsvp-event-date {
    display: block;
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--primary-blue);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.rsvp-event-preview h3 {
    font-size: var(--text-lg);
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.2;
    margin-bottom: 4px;
}

.rsvp-event-location {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.rsvp-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rsvp-field label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.rsvp-field input:not([type="checkbox"]) {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-family: var(--font-main);
    transition: border-color var(--duration-normal);
}

.rsvp-field input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: var(--text-sm) !important;
    color: var(--text-body);
    margin-bottom: 0 !important;
    font-weight: 500 !important;
}

.checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-light);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.quantity-picker {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 6px;
    background: var(--bg-light);
    border-radius: var(--radius-pill);
    width: fit-content;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: white;
    color: var(--text-dark);
    font-weight: 700;
    font-size: var(--text-lg);
    cursor: pointer;
    box-shadow: var(--shadow-xs);
    transition: all var(--duration-normal);
    font-family: var(--font-main);
}

.qty-btn:hover {
    background: var(--primary-blue);
    color: white;
}

#rsvp-qty {
    min-width: 30px;
    text-align: center;
    font-weight: 700;
    color: var(--text-dark);
}

.rsvp-submit {
    margin-top: 8px;
}

/* ----- Simplified casual-event RSVP additions ----- */
.rsvp-intro {
    margin: 0;
    padding: 12px 16px;
    background: var(--primary-blue-light);
    color: var(--text-body);
    font-size: var(--text-sm);
    line-height: 1.5;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary-blue);
}

.rsvp-field-hint {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-faint);
    margin-top: 6px;
}

.rsvp-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0;
    color: var(--text-faint);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.rsvp-divider::before,
.rsvp-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

.btn-whatsapp {
    background: #25D366;
    color: white;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: background var(--duration-normal), transform var(--duration-normal);
}
.btn-whatsapp:hover {
    background: #1DA851;
    transform: translateY(-1px);
}
.btn-whatsapp svg {
    width: 18px;
    height: 18px;
}

.rsvp-already {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 0;
    padding: 14px 16px;
    background: #F0FDF4;
    color: #16A34A;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 600;
    flex-wrap: wrap;
}
.rsvp-already svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.rsvp-already .btn-text {
    margin-left: auto;
    background: none;
    border: none;
    color: #DC2626;
    font-weight: 600;
    font-size: var(--text-sm);
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    font-family: var(--font-main);
}

/* Modal base (reused from store) */
.modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-normal);
}

.modal.open {
    opacity: 1;
    pointer-events: all;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 440px;
    width: calc(100% - 32px);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    transform: scale(0.95);
    transition: transform var(--duration-normal) var(--ease-out-expo);
}

.modal.open .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-light);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    transition: background var(--duration-normal);
    z-index: 2;
}

.modal-close:hover { background: var(--border-light); }

/* Toast (reused) */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(200%);
    background: var(--text-dark);
    color: white;
    padding: 14px 24px;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-xl);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: var(--text-sm);
    z-index: 400;
    transition: transform var(--duration-normal) var(--ease-out-back);
}

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

.toast i {
    width: 18px;
    height: 18px;
    color: #22C55E;
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 1024px) {
    .featured-event {
        grid-template-columns: 1fr;
    }
    .featured-image { min-height: 340px; }
    .highlights-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
    }
    .highlight-large {
        grid-column: span 2;
        grid-row: auto;
        height: 260px;
    }
    .newsletter-box {
        grid-template-columns: 1fr;
        padding: 48px;
        text-align: center;
    }
    .newsletter-visual { justify-self: center; }
}

@media (max-width: 768px) {
    .events-hero {
        margin: 16px 16px 0;
        padding: 100px 24px 60px;
        border-radius: var(--radius-xl);
    }

    .events-search-bar {
        flex-direction: column;
        border-radius: var(--radius-lg);
        padding: 12px;
    }

    .search-divider { display: none; }

    .search-field {
        width: 100%;
        padding: 12px;
        border-bottom: 1px solid var(--border-light);
    }

    .search-submit {
        width: 100%;
        margin-top: 4px;
    }

    .events-hero-stats {
        gap: 24px;
        padding: 16px 20px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .section-header-inline {
        flex-direction: column;
        align-items: flex-start;
    }

    .featured-content {
        padding: 28px;
    }

    .featured-meta-row {
        align-items: flex-start;
    }

    .featured-bottom {
        flex-direction: column;
        align-items: stretch;
    }

    .featured-actions { justify-content: space-between; }

    .events-filter-bar {
        gap: 10px;
        flex-wrap: nowrap;
        align-items: center;
    }

    /* Let the scrollable tab strip take the remaining width; keep the view
       toggle at its natural size beside it. */
    .events-filter-bar .event-category-tabs {
        flex: 1 1 auto;
        min-width: 0;
    }

    .events-filter-bar .events-view-toggle {
        flex: 0 0 auto;
    }

    .event-card {
        max-width: 100%;
    }

    .calendar-grid,
    .calendar-weekdays {
        gap: 4px;
    }

    .cal-day {
        min-height: 60px;
        padding: 4px;
    }

    .cal-event-pill {
        font-size: 0.55rem;
        padding: 1px 4px;
    }

    .highlights-grid {
        grid-template-columns: 1fr;
    }

    .highlight-large {
        grid-column: auto;
        height: 240px;
    }

    .newsletter-form {
        flex-direction: column;
        border-radius: var(--radius-lg);
    }

    .newsletter-form input {
        width: 100%;
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .events-hero-content h1 {
        font-size: 2.25rem;
    }
    .calendar-weekdays > div {
        font-size: 0.65rem;
    }
    .cal-day-num { font-size: 0.75rem; }
}
