/* ========================================
   MAD MAD MAD — Premium Event Directory
   Dark urban aesthetic with neon accents
   + Light theme support
   ======================================== */

/* === Design Tokens (Dark — default) === */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #16161f;
    --bg-card-hover: #1c1c28;
    --bg-glass: rgba(22, 22, 31, 0.8);

    --text-primary: #f0f0f5;
    --text-secondary: #8e8ea0;
    --text-muted: #7a7a90;

    --accent-magenta: #ff2d7b;
    --accent-cyan: #00f5d4;
    --accent-yellow: #fee440;
    --accent-purple: #9b5de5;

    --gradient-primary: linear-gradient(135deg, #ff2d7b, #ff6b9d);
    --gradient-hero: linear-gradient(135deg, #ff2d7b 0%, #9b5de5 50%, #00f5d4 100%);
    --gradient-card: linear-gradient(180deg, rgba(255, 45, 123, 0.08) 0%, transparent 60%);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(255, 45, 123, 0.15);

    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;

    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --container-max: 1200px;

    /* Theme-adaptive tokens */
    --border-subtle: rgba(255, 255, 255, 0.1);
    --border-faint: rgba(255, 255, 255, 0.05);
    --border-ghost: rgba(255, 255, 255, 0.03);
    --border-divider: rgba(255, 255, 255, 0.06);
    --border-input: rgba(255, 255, 255, 0.08);
    --border-checkbox: rgba(255, 255, 255, 0.15);
    --overlay-hover: rgba(255, 255, 255, 0.05);
    --navbar-bg: rgba(10, 10, 15, 0.85);
    --color-scheme: dark;
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238e8ea0' d='M6 8.5L1 3.5h10z'/%3E%3C/svg%3E");

    /* Hero & section glows */
    --hero-glow-magenta: rgba(255, 45, 123, 0.12);
    --hero-glow-cyan: rgba(0, 245, 212, 0.08);
    --hero-glow-purple: rgba(155, 93, 229, 0.06);
    --section-weekend-bg: linear-gradient(180deg, rgba(155, 93, 229, 0.05) 0%, transparent 100%);
    --overlay-faint: rgba(255, 255, 255, 0.05);
    --marker-border: rgba(255, 255, 255, 0.2);

    /* Focus ring for keyboard navigation */
    --focus-ring: 0 0 0 3px rgba(255, 45, 123, 0.4);
}

/* === Light Theme === */
[data-theme="light"] {
    --bg-primary: #f5f5f7;
    --bg-secondary: #eeeef0;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f0f5;
    --bg-glass: rgba(255, 255, 255, 0.85);

    --text-primary: #1a1a2e;
    --text-secondary: #55556a;
    --text-muted: #8e8ea0;

    --accent-magenta: #e0216a;
    --accent-cyan: #00b89c;
    --accent-yellow: #d4a800;
    --accent-purple: #7c3aed;

    --gradient-primary: linear-gradient(135deg, #e0216a, #f06292);
    --gradient-hero: linear-gradient(135deg, #e0216a 0%, #7c3aed 50%, #00b89c 100%);

    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 40px rgba(224, 33, 106, 0.08);

    --border-subtle: rgba(0, 0, 0, 0.1);
    --border-faint: rgba(0, 0, 0, 0.06);
    --border-ghost: rgba(0, 0, 0, 0.03);
    --border-divider: rgba(0, 0, 0, 0.08);
    --border-input: rgba(0, 0, 0, 0.12);
    --border-checkbox: rgba(0, 0, 0, 0.2);
    --overlay-hover: rgba(0, 0, 0, 0.04);
    --navbar-bg: rgba(245, 245, 247, 0.9);
    --color-scheme: light;
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2355556a' d='M6 8.5L1 3.5h10z'/%3E%3C/svg%3E");

    --hero-glow-magenta: rgba(224, 33, 106, 0.08);
    --hero-glow-cyan: rgba(0, 184, 156, 0.06);
    --hero-glow-purple: rgba(124, 58, 237, 0.04);
    --section-weekend-bg: linear-gradient(180deg, rgba(124, 58, 237, 0.04) 0%, transparent 100%);
    --overlay-faint: rgba(0, 0, 0, 0.03);
    --marker-border: rgba(0, 0, 0, 0.15);
}

/* === Reset & Base === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}

/* Global form element theme-aware reset */
input,
select,
textarea {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 0.65rem 1rem;
    outline: none;
    transition: border-color var(--transition);
    color-scheme: var(--color-scheme);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-magenta);
}

select {
    background-image: var(--select-arrow);
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Force styles on specific input types browsers love to override */
input[type="email"],
input[type="search"],
input[type="text"],
input[type="date"],
input[type="url"],
input[type="tel"],
input[type="number"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    color-scheme: var(--color-scheme);
}

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* === Navbar === */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--navbar-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-divider);
    height: 64px;
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.logo-accent {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-dot {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: color var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-magenta);
    border-radius: 1px;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 5px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

/* === Main Content === */
.main-content {
    padding-top: 64px;
    min-height: 100vh;
}

/* === Hero Section === */
.hero {
    position: relative;
    padding: 8rem 0 6rem;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, var(--hero-glow-magenta) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 30%, var(--hero-glow-cyan) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, var(--hero-glow-purple) 0%, transparent 40%);
    animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    0% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

.hero-content {
    position: relative;
    text-align: center;
}

.hero-title {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-line {
    display: block;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: -0.03em;
}

.hero-line.accent {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: clamp(4rem, 12vw, 9rem);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.event-count {
    color: var(--accent-cyan);
    font-family: var(--font-heading);
    font-weight: 600;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-xl);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition);
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 20px rgba(255, 45, 123, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 45, 123, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-checkbox);
}

.btn-outline:hover {
    border-color: var(--accent-magenta);
    color: var(--accent-magenta);
    background: rgba(255, 45, 123, 0.05);
}

.btn-sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
}

/* === Sections === */
.section {
    padding: 4rem 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.section-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.75rem;
    letter-spacing: -0.02em;
}

.section-link {
    color: var(--accent-magenta);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

.section-link:hover {
    color: var(--accent-cyan);
}

.section-weekend {
    background: var(--section-weekend-bg);
}

/* === Categories Grid === */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}


.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-faint);
    border-radius: var(--radius-md);
    transition: all var(--transition);
    text-align: center;
    position: relative;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    cursor: pointer;
}

.category-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--cat-color, var(--accent-magenta));
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.category-icon {
    font-size: 1.75rem;
    line-height: 1;
}

.category-name {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.category-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--overlay-faint);
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
}

/* Subcategory bar (eventos page) */
.subcategory-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 0;
}

.subcategory-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border-faint);
    border-radius: var(--radius-xl);
    border-left: 3px solid var(--cat-color, var(--accent-magenta));
    transition: all var(--transition);
    white-space: nowrap;
    cursor: pointer;
}

.subcategory-chip:hover {
    background: var(--bg-card-hover);
    border-color: var(--cat-color, var(--accent-magenta));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.subcategory-chip--active {
    background: var(--cat-color, var(--accent-magenta));
    color: white;
    border-color: var(--cat-color, var(--accent-magenta));
}

.subcategory-chip--active .subcategory-label,
.subcategory-chip--active .subcategory-count {
    color: white;
}

.subcategory-icon {
    font-size: 1rem;
    line-height: 1;
}

.subcategory-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
}

.subcategory-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: 0.15rem;
    background: var(--overlay-faint);
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
}

.subcategory-chip--active .subcategory-count {
    background: rgba(255, 255, 255, 0.25);
}

/* === Events Grid === */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.events-grid-small {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.event-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-faint);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease,
                border-color 0.3s ease;
}

.event-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-subtle);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), 0 0 20px rgba(255, 45, 123, 0.06);
}

.event-card:active {
    transform: translateY(-2px);
}

.event-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(90deg, rgba(var(--cat-color-rgb, 255, 45, 123), 0.1), transparent);
    border-bottom: 1px solid var(--border-ghost);
    border-left: 3px solid var(--cat-color, var(--accent-magenta));
}

.event-category {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-free {
    background: rgba(0, 245, 212, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 245, 212, 0.2);
}

.badge-lg {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
}

.badge-price {
    background: rgba(254, 228, 64, 0.15);
    color: var(--accent-yellow);
    border: 1px solid rgba(254, 228, 64, 0.2);
}

.badge-source {
    background: rgba(230, 57, 70, 0.15);
    color: #e63946;
    border: 1px solid rgba(230, 57, 70, 0.25);
    font-size: 0.75rem;
}

.source-badge-detail {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 0.75rem 1rem;
    background: rgba(230, 57, 70, 0.06);
    border: 1px solid rgba(230, 57, 70, 0.15);
    border-radius: var(--radius-md);
}

.source-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Category placeholder for events without images */
.event-card-placeholder {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--cat-color, var(--accent-magenta)) 12%, var(--bg-card)),
        color-mix(in srgb, var(--cat-color, var(--accent-magenta)) 4%, var(--bg-card)));
    position: relative;
    overflow: hidden;
}

.placeholder-icon {
    font-size: 3rem;
    opacity: 0.5;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    filter: grayscale(0.2);
}

.event-card:hover .placeholder-icon {
    transform: scale(1.15);
    opacity: 0.7;
}

.event-card-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    position: relative;
}

.event-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.event-card:hover .event-card-image img {
    transform: scale(1.08);
}

/* Subtle gradient overlay on image for text contrast */
.event-card-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, var(--bg-card) 0%, transparent 100%);
    pointer-events: none;
    opacity: 0.4;
}

.event-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.event-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.event-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex: 1;
}

.event-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: auto;
}

.event-date,
.event-time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.event-location {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === Eventos Page === */
.eventos-page {
    padding-top: 2rem;
}

.eventos-header {
    margin-bottom: 2rem;
}

.page-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 2.25rem;
    letter-spacing: -0.03em;
}

.page-subtitle {
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* === Filters === */
.filters-bar {
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-faint);
    border-radius: var(--radius-lg);
}

.filters-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.filters-row-secondary {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-ghost);
}

.filter-group {
    min-width: 0;
}

.filter-grow {
    flex: 1;
}

.filter-date-group {
    width: 155px;
    flex-shrink: 0;
}

.filter-free-group {
    flex-shrink: 0;
    padding-bottom: 0.65rem;
}

.filter-category {
    width: 240px;
    flex-shrink: 0;
}

.filter-distrito {
    flex: 1;
    min-width: 160px;
}

.filter-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.3rem;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 0.65rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: border-color var(--transition);
    outline: none;
}

.filter-input::placeholder {
    color: var(--text-muted);
}

.filter-input:focus,
.filter-select:focus {
    border-color: var(--accent-magenta);
}

.filter-select option {
    background: var(--bg-secondary);
}

.filter-date {
    color-scheme: var(--color-scheme);
    font-size: 0.85rem;
    padding: 0.65rem 0.6rem;
}

.map-date-filter {
    padding-bottom: 0.5rem;
    margin-bottom: 0.35rem;
    border-bottom: 1px solid var(--border-divider);
}

.map-date-filter .filter-date {
    width: 100%;
    padding: 0.45rem 0.6rem;
    font-size: 0.8rem;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    user-select: none;
    white-space: nowrap;
}

.filter-checkbox input {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-checkbox);
    border-radius: 4px;
    background: var(--bg-primary);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.filter-checkbox input:checked {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

.filter-checkbox input:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    color: var(--bg-primary);
    font-weight: 700;
}

/* === Pagination === */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 3rem;
    padding: 1rem 0;
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-family: var(--font-heading);
}

/* === Event Detail === */
.evento-detail {
    padding-top: 2rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    transition: color var(--transition);
}

.back-link:hover {
    color: var(--accent-magenta);
}

.detail-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2.5rem;
    align-items: start;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.event-category-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.8rem;
    background: var(--overlay-faint);
    border: 1px solid var(--cat-color, var(--accent-magenta));
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.detail-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 2.5rem;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
}

.detail-poster {
    margin: 1.5rem 0;
}

.detail-poster img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.detail-description {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.detail-no-desc {
    padding: 1.25rem;
    background: var(--overlay-faint);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-md);
    font-style: italic;
    color: var(--text-muted);
}

.detail-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-faint);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.detail-info-card h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-faint);
}

.detail-info-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.detail-info-list li {
    display: flex;
    gap: 0.75rem;
}

.info-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.detail-info-list li div {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.detail-info-list strong {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.detail-info-list span {
    font-size: 0.95rem;
}

.info-sub {
    font-size: 0.83rem !important;
    color: var(--text-muted) !important;
}

.detail-map-container {
    margin-top: 1.25rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-faint);
}

#detail-map {
    height: 220px;
    width: 100%;
}

.related-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-faint);
}

/* === Map Page === */
.mapa-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px);
}

.mapa-header {
    padding: 1.5rem 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-faint);
}

#map-container {
    flex: 1;
    position: relative;
}

#main-map {
    width: 100%;
    height: 100%;
}

.map-filters {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding: 0.75rem;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
}

.map-filter-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: transparent;
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.map-filter-btn:hover {
    background: var(--overlay-hover);
    color: var(--text-primary);
}

.map-filter-btn.active {
    background: var(--cat-color, var(--accent-magenta));
    color: white;
    border-color: transparent;
}

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

.custom-marker span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    border: 2px solid var(--marker-border);
    transition: transform 0.2s;
}

.custom-marker:hover span {
    transform: scale(1.2);
}

/* Map popup */
.map-popup {
    font-family: var(--font-body);
    font-size: 0.85rem;
    line-height: 1.5;
    max-width: 260px;
}

.map-popup strong {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    display: block;
    margin-bottom: 0.25rem;
}

.popup-meta,
.popup-location {
    color: #666;
    font-size: 0.8rem;
}

.popup-free {
    color: #00a884;
    font-weight: 500;
    font-size: 0.8rem;
}

.popup-link {
    display: inline-block;
    margin-top: 0.35rem;
    color: var(--accent-magenta) !important;
    font-weight: 500;
    font-size: 0.85rem;
}

/* Leaflet popup override */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius-md) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

/* === Empty State === */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

/* === Newsletter CTA === */
.newsletter-section {
    padding: 4rem 0 2rem;
}

.newsletter-card {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 45, 123, 0.2);
    border-radius: var(--radius-xl);
    padding: 3rem 2.5rem;
    text-align: center;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(255, 45, 123, 0.08), 0 0 120px rgba(155, 93, 229, 0.05);
}

.newsletter-glow {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(255, 45, 123, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 50%, rgba(155, 93, 229, 0.12) 0%, transparent 50%);
    pointer-events: none;
    animation: heroGlow 6s ease-in-out infinite alternate;
}

.newsletter-content {
    position: relative;
}

.newsletter-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.75rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.newsletter-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 480px;
    margin: 0 auto 1.5rem;
    line-height: 1.5;
}

.newsletter-form {
    max-width: 460px;
    margin: 0 auto;
}

.newsletter-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.newsletter-input {
    flex: 1;
    padding: 0.85rem 1.25rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--transition);
}

.newsletter-input::placeholder {
    color: var(--text-muted);
}

.newsletter-input:focus {
    border-color: var(--accent-magenta);
    box-shadow: 0 0 0 3px rgba(255, 45, 123, 0.1);
}

.newsletter-btn {
    white-space: nowrap;
    padding: 0.85rem 1.75rem;
}

.subscribe-result {
    margin-top: 0.75rem;
    min-height: 1.5rem;
}

.subscribe-msg {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    animation: fadeInUp 0.3s ease both;
}

.subscribe-success {
    background: rgba(0, 245, 212, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 245, 212, 0.2);
}

.subscribe-error {
    background: rgba(255, 45, 123, 0.1);
    color: var(--accent-magenta);
    border: 1px solid rgba(255, 45, 123, 0.2);
}

.subscribe-info {
    background: rgba(155, 93, 229, 0.1);
    color: var(--accent-purple);
    border: 1px solid rgba(155, 93, 229, 0.2);
}

/* === Footer === */
.footer {
    padding: 2.5rem 0;
    border-top: 1px solid var(--border-faint);
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.footer-newsletter {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-newsletter-label {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.footer-newsletter-form {
    display: flex;
    gap: 0.4rem;
    align-items: stretch;
}

.footer-newsletter-input {
    padding: 0.5rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
    width: 200px;
    transition: border-color var(--transition);
}

.footer-newsletter-input::placeholder {
    color: var(--text-muted);
}

.footer-newsletter-input:focus {
    border-color: var(--accent-magenta);
}

.footer-credits {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-credits a {
    color: var(--accent-cyan);
    transition: color var(--transition);
}

.footer-credits a:hover {
    color: var(--accent-magenta);
}

/* === Responsive === */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        padding: 1rem;
        flex-direction: column;
        gap: 0;
        border-bottom: 1px solid var(--border-divider);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-link {
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border-ghost);
    }

    .nav-toggle {
        display: flex;
    }

    .hero {
        padding: 5rem 0 3rem;
    }

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

    /* Horizontal scroll for featured/weekend event grids on mobile */
    .events-grid-scroll {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: 1rem;
        padding-bottom: 0.75rem;
    }

    .events-grid-scroll .event-card {
        flex: 0 0 85%;
        max-width: 320px;
        scroll-snap-align: start;
    }

    .events-grid-scroll::-webkit-scrollbar {
        height: 4px;
    }

    .events-grid-scroll::-webkit-scrollbar-track {
        background: var(--border-ghost);
        border-radius: 2px;
    }

    .events-grid-scroll::-webkit-scrollbar-thumb {
        background: var(--accent-magenta);
        border-radius: 2px;
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-title {
        font-size: 1.75rem;
    }

    .filters-row {
        flex-direction: column;
    }

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

    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.5rem;
    }

    .category-card {
        padding: 0.85rem 0.5rem;
    }

    .subcategory-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }

    .map-filters {
        top: auto;
        bottom: 1rem;
        right: 0.5rem;
        left: 0.5rem;
        flex-direction: row;
        flex-wrap: wrap;
        max-height: 120px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .footer-newsletter {
        align-items: center;
    }

    .footer-credits p {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem 0.5rem;
        line-height: 1.8;
    }

    .newsletter-input-group {
        flex-direction: column;
    }

    .newsletter-card {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 280px;
    }
}

/* === Theme Toggle === */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--overlay-hover);
    border: 1px solid var(--border-input);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-magenta);
    transform: scale(1.1);
}

/* Dark theme (default): show moon, hide sun */
.theme-icon-light {
    display: none;
}

.theme-icon-dark {
    display: inline;
}

/* Light theme: show sun, hide moon */
[data-theme="light"] .theme-icon-light {
    display: inline;
}

[data-theme="light"] .theme-icon-dark {
    display: none;
}

/* === Animations === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.event-card {
    animation: fadeInUp 0.4s ease both;
}

.events-grid .event-card:nth-child(1) {
    animation-delay: 0s;
}

.events-grid .event-card:nth-child(2) {
    animation-delay: 0.05s;
}

.events-grid .event-card:nth-child(3) {
    animation-delay: 0.1s;
}

.events-grid .event-card:nth-child(4) {
    animation-delay: 0.15s;
}

.events-grid .event-card:nth-child(5) {
    animation-delay: 0.2s;
}

.events-grid .event-card:nth-child(6) {
    animation-delay: 0.25s;
}

/* === Focus styles for keyboard navigation === */
:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.event-card:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring), var(--shadow-card);
    border-color: var(--accent-magenta);
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* === Skip to content link for screen readers === */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-magenta);
    color: white;
    padding: 0.5rem 1rem;
    z-index: 200;
    font-size: 0.9rem;
    transition: top 0.3s;
}

.skip-to-content:focus {
    top: 0;
}

/* === Reduced motion preference === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* HTMX transitions */
.htmx-swapping {
    opacity: 0.5;
    transition: opacity 0.2s;
}

.htmx-settling {
    opacity: 1;
    transition: opacity 0.3s;
}

/* === Sticky Email Capture Bar === */
.capture-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-divider);
    padding: 0.75rem 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.capture-bar-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.capture-bar-text {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.capture-bar-form {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    min-width: 250px;
}

.capture-bar-input {
    flex: 1;
    padding: 0.5rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
}

.capture-bar-input:focus {
    border-color: var(--accent-magenta);
}

.capture-bar-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem 0.5rem;
    transition: color var(--transition);
}

.capture-bar-close:hover {
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .capture-bar-text {
        width: 100%;
        font-size: 0.85rem;
    }

    .capture-bar-form {
        min-width: unset;
    }
}