/* ========== BASE FONT SIZE ========== */
html {
    font-size: 110%; /* 17px if browser default is 16px – a small bump */
}
body {
    font-size: 1rem;
}

/* ========== DROPDOWN FONT SIZE ========== */
select,
.sort-bar select,
.zone-filter select,
#sortSelect,
#zoneSelect {
    font-size: 1rem !important;
}

/* ========== BASE & VARIABLES ========== */
:root {
    --primary-red: #C62828;
    --dark-bg: #1a1a1a;
    --gold-accent: #FFC107;
    --light-bg: #F9F9F9;
    --text-dark: #1e293b;
    --text-light: #475569;
    --border-light: #e2e8f0;
    --tag-bg: #FFE0B2;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, 'Segoe UI', 'Helvetica Neue', sans-serif;
}

body {
    background: var(--light-bg);
    color: var(--text-dark);
    scroll-behavior: smooth;
}

/* ========== NAVBAR ========== */
.navbar {
    background: var(--dark-bg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.logo {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-red), var(--gold-accent));
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}
.logo a {
    color: inherit;
    text-decoration: none;
}
.logo a:hover {
    color: inherit; /* keep the gradient */
}
.hamburger {
    display: block;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    color: white;
}
.nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0 0.5rem;
    list-style: none;
}
.nav-links.show { display: flex; }
.nav-links a {
    text-decoration: none;
    font-weight: 500;
    color: white;
    padding: 0.5rem;
    transition: 0.2s;
}
.nav-links a:hover { color: var(--gold-accent); }

@media (min-width: 768px) {
    .hamburger { display: none; }
    .nav-links { display: flex !important; width: auto; flex-direction: row; padding: 0; gap: 2rem; }
    .navbar { padding: 1rem 2rem; }
    .logo { font-size: 1.6rem; }


    .nav-share-btn {
        padding: 1rem 2rem;      /* matches the mobile menu link size */
    }

}

/* ========== NAVBAR SHARE BUTTON (consistent with nav links) ========== */
.nav-share-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;           /* same as nav links */
    color: white;               /* same as nav links */
    padding: 0.5rem;            /* same as nav links */
    transition: 0.2s;
    font-size: inherit;         /* inherits from parent (navbar) */
    font-family: inherit;
    text-decoration: none;
    line-height: inherit;       /* ensure vertical alignment */
    text-align: center;         /* helps on mobile */
    display: inline-block;      /* behaves like a link */
}

.nav-share-btn:hover {
    color: var(--gold-accent);  /* same hover effect as nav links */
}

/* ========== SEARCH BAR ========== */
.search-bar {
    max-width: 1400px;
    margin: 1rem auto 0.5rem;
    padding: 0 0.75rem;
}
.search-bar input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-light);
    border-radius: 60px;
    background: white;
    transition: 0.2s;
}
.search-bar input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(198,40,40,0.1);
}
@media (min-width: 768px) {
    .search-bar input { max-width: 400px; margin-left: auto; }
}

/* ========== SORT BAR ========== */
.sort-bar {
    max-width: 1400px;
    margin: 0.5rem auto 0;
    padding: 0 0.75rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}
.sort-bar select {
    padding: 0.4rem 0.8rem;
    border-radius: 30px;
    border: 1px solid var(--border-light);
    background: white;
    font-size: 0.9rem;
}

/* ========== FILTER ROW (zone & view toggle) ========== */
.filter-row {
    max-width: 1400px;
    margin: 0.5rem auto 0;
    padding: 0 0.75rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
}
.zone-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f1f5f9;
    padding: 0.3rem 0.8rem;
    border-radius: 40px;
}
.zone-filter select {
    padding: 0.3rem 0.6rem;
    border-radius: 30px;
    border: 1px solid var(--border-light);
    background: white;
}
.view-toggle {
    display: flex;
    gap: 0.5rem;
}
.view-btn {
    background: #f1f5f9;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 40px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.2s;
}
.view-btn.active {
    background: var(--primary-red);
    color: white;
}
@media (max-width: 640px) {
    .filter-row { flex-direction: column; align-items: stretch; }
    .zone-filter { justify-content: center; }
    .view-toggle { justify-content: center; }
}

/* ========== FILTER BAR (tags) ========== */
.filter-bar {
    max-width: 1400px;
    margin: 0.5rem auto 1rem;
    padding: 0 0.75rem;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.6rem;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
.filter-btn {
    background: #f1f5f9;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 60px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s;
    font-size: 0.9rem;
    color: var(--text-dark);
}
.filter-btn.active,
.filter-btn:hover {
    background: var(--primary-red);
    color: white;
}
@media (min-width: 640px) {
    .filter-bar { flex-wrap: wrap; justify-content: center; overflow-x: visible; }
}

/* ========== RESULT BAR ========== */
.result-bar {
    max-width: 1400px;
    margin: 0.5rem auto 0;
    padding: 0 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.9rem;
}
.clear-filters {
    background: none;
    border: 1px solid var(--primary-red);
    color: var(--primary-red);
    padding: 0.3rem 0.8rem;
    border-radius: 30px;
    cursor: pointer;
    transition: 0.2s;
}
.clear-filters:hover {
    background: var(--primary-red);
    color: white;
}

/* ========== FOOTER ========== */
footer {
    text-align: center;
    padding: 1.5rem 1rem;
    background: var(--dark-bg);
    color: #e0e0e0;
    font-size: 0.85rem;
    margin-top: 2rem;
}

/* ========== BACK TO TOP ========== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary-red);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: 0.2s;
    z-index: 1000;
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover {
    background: #8e0000;
    transform: translateY(-2px);
}

/* ========== SKELETON LOADERS ========== */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
}
.skeleton-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 1rem;
}
.skeleton-img {
    height: 140px;
    background: #e2e8f0;
    border-radius: 12px;
    margin-bottom: 1rem;
}
.skeleton-line {
    height: 1rem;
    background: #e2e8f0;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}
.skeleton-line.short { width: 60%; }
.skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.skeleton-list-item {
    background: white;
    border-radius: 20px;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}
.skeleton-list-img {
    width: 100px;
    height: 100px;
    background: #e2e8f0;
    border-radius: 12px;
}
.skeleton-list-content { flex: 1; }
.skeleton-list-line {
    height: 1rem;
    background: #e2e8f0;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

/* ========== LIGHTBOX ========== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}
.lightbox.show { display: flex; }
.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 3rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: 0.2s;
}
.lightbox-close:hover { color: #ccc; }

/* ========== FONT SIZE FIXES ========== */
.zone-filter select,
.clear-filters,
.result-bar {
    font-size: 1rem;
}

/* Credit style */
.footer-credit {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #94a3b8;
}
.footer-credit a {
    color: #e2e8f0;
    text-decoration: none;
    transition: 0.2s;
}
.footer-credit a:hover {
    color: var(--gold-accent);
    text-decoration: underline;
}


/* Combined search & sort row */
.search-sort-row {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 0.75rem;
    display: flex;
    flex-wrap: wrap;        /* allows wrap on small screens */
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.search-sort-row .search-bar {
    flex: 1 1 200px;        /* grow, shrink, base width */
    min-width: 150px;
}

.search-sort-row .search-bar input {
    width: 100%;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-light, #d1d5db);
    border-radius: 30px;
    font-size: 0.95rem;
    background: #f9fafb;
    transition: 0.2s;
    box-sizing: border-box;
}

.search-sort-row .search-bar input:focus {
    outline: none;
    border-color: var(--primary-red, #dc2626);
    background: white;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.search-sort-row .sort-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;         /* prevent shrinking */
}

.search-sort-row .sort-bar label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-dark, #1f2937);
    white-space: nowrap;
}

.search-sort-row .sort-bar select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-light, #d1d5db);
    border-radius: 30px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    appearance: auto;
    min-width: 140px;
}

/* On very narrow screens, allow the sort bar to wrap under the search */
@media (max-width: 480px) {
    .search-sort-row {
        flex-direction: column;
        align-items: stretch;
    }
    .search-sort-row .sort-bar {
        justify-content: flex-end;
    }
}


/* ========== PAGINATION (shared) ========== */
#paginationControls {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 0.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}
.page-btn {
    padding: 0.5rem 1.2rem;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
}
.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.page-info {
    font-size: 0.95rem;
    color: #374151;
}


/* ========== FILTER BUTTONS (shared) ========== */
.filter-btn {
    background: #f1f5f9;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 60px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s;
    font-size: 0.9rem;
    color: var(--text-dark);
}
.filter-btn.active,
.filter-btn:hover {
    background: var(--primary-red);
    color: white;
}

/* ========== FILTER ROW (shared) ========== */
.filter-row {
    max-width: 1400px;
    margin: 0.5rem auto 0;
    padding: 0 0.75rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
}


/* ========== EVENTS HEADER ========== */
.page-header {
    max-width: 1400px;
    margin: 1rem auto 0.5rem;
    padding: 0 1rem;
}
.page-header h1 {
    font-size: 2rem;
    margin-bottom: 0.3rem;
}
.page-header p {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

/* ========== SHARE QR MODAL (unique class) ========== */
.cwb-qr-modal {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.85) !important;
    z-index: 99999 !important;
    justify-content: center !important;
    align-items: center !important;
}
.cwb-qr-modal.active {
    display: flex !important;
}
.cwb-qr-modal-content {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    max-width: 90%;
    max-height: 90%;
    position: relative;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.cwb-qr-modal-content img {
    width: 200px;
    height: 200px;
    display: block;
    margin: 0 auto 1rem;
}
.cwb-qr-modal-close {
    position: absolute;
    top: 10px;
    right: 16px;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    color: #333;
}
.cwb-qr-modal-close:hover {
    color: var(--primary-red);
}

@media (max-width: 640px) {
    .search-sort-row .search-bar {
        flex: 0;          /* ← removes top/bottom margins */    }
}

#cwbQrContainer {
    display: flex;
    justify-content: center;
    margin: 0.5rem 0;
}
.QRvCard .card-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.QRvCard .card-qr img {
    /* remove any scaling – the library creates an inline canvas/img */
    max-width: 100%;
    height: auto;
}

.fab-register {
    position: fixed;
    bottom: 6rem;
    right: 2rem;
    background: var(--primary-red);
    color: white;
    padding: 0.8rem 1.2rem;
    border-radius: 60px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    text-decoration: none;
    font-weight: 500;
    z-index: 999;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.fab-register:hover {
    transform: scale(1.05);
    background: #8e0000;
}