@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
    /* Brand palette */
    --cerulean: #236f92;
    --midnight: #163145;
    --yellow-green: #80b545;
    --sandy-brown: #e4ae4a;
    --silver: #bababb;
    --ink: #0f1f2f;
    --paper: #f7fafc;

    /* Semantic */
    --brand-primary: var(--cerulean);
    --brand-secondary: var(--midnight);
    --brand-accent: var(--yellow-green);
    --brand-warm: var(--sandy-brown);
    --brand-muted: var(--silver);

    /* Typography */
    --font-display: 'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;

    /* Radii & shadows */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-soft: 0 10px 30px rgba(22, 49, 69, 0.12);
    --shadow-card: 0 12px 40px rgba(0, 0, 0, 0.08);
}

html, body {
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--ink);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--brand-secondary);
}

a {
    color: var(--brand-primary);
}

.btn-primary {
    background: linear-gradient(120deg, var(--cerulean), var(--midnight));
    border-color: var(--midnight);
    color: #fff;
    box-shadow: var(--shadow-soft);
}

.btn-outline-primary {
    border-color: var(--cerulean);
    color: var(--cerulean);
}

.badge-brand {
    background: var(--brand-accent);
    color: #0e1a0f;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-weight: 600;
}

.card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.nav-link.active {
    background: linear-gradient(120deg, var(--cerulean), var(--midnight));
    color: #fff !important;
}

.form-control:focus, .form-select:focus {
    border-color: var(--cerulean);
    box-shadow: 0 0 0 0.2rem rgba(35, 111, 146, 0.2);
}

.glass-panel {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

/* ---------- App surfaces ---------- */
:root {
    --surface: rgba(255, 255, 255, 0.92);
    --surface-strong: rgba(255, 255, 255, 0.98);
    --surface-muted: rgba(255, 255, 255, 0.70);
    --border-soft: rgba(22, 49, 69, 0.10);
    --shadow-elev: 0 18px 60px rgba(15, 31, 47, 0.10);
}

body {
    background: radial-gradient(1200px 700px at 10% 5%, rgba(35, 111, 146, 0.16), transparent 55%),
                radial-gradient(900px 600px at 85% 10%, rgba(128, 181, 69, 0.14), transparent 55%),
                var(--paper);
}

/* ---------- Top / filter bars ---------- */
.home-topbar {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-elev);
}

.home-topbar .input-group-text {
    border: 0;
    background: transparent;
}

.home-topbar .form-control {
    border: 0;
    background: transparent;
}

.home-topbar .form-control:focus {
    box-shadow: none;
}

.home-chip-row {
    background: var(--surface-muted);
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    padding: 0.35rem 0.5rem;
}

.home-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    border: 1px solid rgba(35, 111, 146, 0.25);
    background: rgba(35, 111, 146, 0.06);
    color: var(--brand-secondary);
    font-weight: 600;
}

.home-chip:hover {
    background: rgba(35, 111, 146, 0.10);
}

.home-chip .material-icons {
    font-size: 16px;
    line-height: 1;
}

/* Venue tags (detail page) */
.venue-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.venue-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: rgba(22, 49, 69, 0.04);
    color: var(--brand-secondary);
    font-weight: 600;
}

.venue-tag-chip .tag-icon {
    font-size: 14px;
    line-height: 1;
}

.venue-tag-chip .tag-name {
    font-size: 0.85rem;
}

/* ---------- Map shell ---------- */
.map-shell {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-elev);
    border: 1px solid var(--border-soft);
    background: var(--surface-strong);
}


/* ---------- Venues card + list ---------- */
.venues-panel {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-elev);
}

.venues-panel .card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border-soft);
}

.venue-list-item {
    padding: 0.85rem 0.9rem;
}

.venue-list-item:hover {
    background: rgba(35, 111, 146, 0.04);
}

.venue-thumb {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
    flex: 0 0 auto;
    border: 1px solid rgba(22, 49, 69, 0.10);
    background: rgba(255, 255, 255, 0.7);
}

.venue-title {
    font-weight: 700;
    letter-spacing: 0.1px;
}

.venue-meta {
    color: rgba(15, 31, 47, 0.65);
}

/* Compact icon actions */
.venue-actions {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.35rem;
}

.venue-actions .btn {
    border-radius: 10px;
}

.venue-actions .btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.venue-actions .btn-icon .material-icons {
    font-size: 18px;
    line-height: 1;
}

.venue-actions .btn-focus {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    color: rgba(22, 49, 69, 0.70);
}

.venue-actions .btn-focus:hover {
    color: var(--brand-primary);
}

.venue-actions .btn-focus .material-icons {
    font-size: 20px;
    line-height: 1;
}

.refresh-button.is-loading .material-icons {
    animation: rc-spin 1s linear infinite;
}

@keyframes rc-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Mobile filter modal */
.filter-modal.card {
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-elev);
    border-radius: var(--radius-lg);
}

/* Offcanvas / accordion refinement */
.offcanvas {
    border-left: 1px solid var(--border-soft);
}

.accordion-button {
    font-family: var(--font-display);
    font-weight: 600;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(35, 111, 146, 0.15);
}

/* Buttons */
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-soft);
    color: var(--brand-secondary);
}

.btn-ghost:hover {
    background: rgba(22, 49, 69, 0.04);
}


/* ---------- Mobile: compact filter bar + floating toggle ---------- */
.mobile-filter-bar {
    position: sticky;
    top: 0;
    z-index: 1030;
    padding: 0.5rem 0.75rem;
    backdrop-filter: blur(10px);
}

.mobile-filter-bar .filter-input {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    box-shadow: var(--shadow-elev);
    padding: 0.35rem 0.5rem;
}

.mobile-filter-bar .filter-trigger {
    width: 52px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
}

.mobile-filter-bar .filter-trigger .material-icons {
    font-size: 22px;
    line-height: 1;
}

/* Floating map/list toggle (does not consume layout space) */
.mobile-toggle-bar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 1050;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    padding: 8px;
    box-shadow: var(--shadow-elev);
    display: inline-flex;
    gap: 8px;
}

.toggle-button {
    width: 52px;
    height: 44px;
    border-radius: 999px;
    border: 0;
    background: transparent;
    color: rgba(22, 49, 69, 0.70);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.toggle-button .material-icons {
    font-size: 22px;
    line-height: 1;
}

.toggle-button.active {
    background: rgba(35, 111, 146, 0.10);
    color: var(--brand-primary);
    box-shadow: inset 0 0 0 2px rgba(35, 111, 146, 0.25);
}


/* Ensure the main content doesn't add bottom padding for the floating toggle */
.row.g-4 {
    margin-bottom: 0;
}

/* Reduce venue list panel bottom gap */
.venues-panel .card-body {
    max-height: calc(100dvh - 200px) !important;
}

html, body, .container-fluid {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* ---------- Home layout: reduce bottom gap + restore top spacing ---------- */
/* ---------- Home layout: reduce bottom gap + restore top spacing ---------- */
.home-main {
    padding-top: 0.5rem;
    padding-bottom: 0;
    /* tighter to remove remaining gap */
    min-height: calc(100vh - 110px);
}

/* Ensure the grid itself also has a minimum height to stretch cards */
.home-grid {
    min-height: calc(100vh - 160px);
}

/* Make bootstrap columns stretch so children can be 100% height */
.home-grid > [class*="col-"] {
    display: flex;
    flex-direction: column;
}

/* Only apply flex/height stretch on the Home grid */
.home-grid .map-shell,
.home-grid .venues-panel {
    flex: 1 1 auto;
    height: 100%;
}

/* Map fills its container instead of using a separate vh calc */
#adminMap {
    height: 100%;
    min-height: 520px;
}

@media (max-width: 768px) {
    .home-main {
        min-height: calc(100vh - 90px);
        padding-top: 0.4rem;
    }

    .home-grid {
        min-height: calc(100vh - 130px);
    }

    #adminMap {
        min-height: 380px;
    }
}

/* Let list scroll within the card body without forcing extra page height */
.venues-panel .card-body {
    overflow-y: auto;
    max-height: none !important;
}
/* Match main website navigation color */
.navbar, .navbar.bg-light, .navbar.bg-white {
    background-color: var(--cerulean) !important;
}

.navbar .nav-link,
.navbar .navbar-brand {
    color: #fff !important;
}

.navbar .nav-link:hover {
    color: rgba(255,255,255,0.85) !important;
}
/* VenueDetails map fills the shell height */
.venue-detail-page .map-shell {
    height: clamp(280px, 42vh, 460px);
}

.venue-detail-page #venueDetailMap {
    height: 100%;
}

@media (max-width: 768px) {
    .venue-detail-page .map-shell {
        height: clamp(240px, 36vh, 360px);
    }
}

/* Popup tag icons for map popups */
.popup-tags {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.popup-tag-icon {
    font-size: 14px;
    line-height: 1;
    opacity: 0.9;
}

.popup-tag-icon:hover {
    opacity: 1;
}

.popup-tag-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 18px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(15, 31, 47, 0.80);
    background: rgba(22, 49, 69, 0.06);
    border: 1px solid rgba(22, 49, 69, 0.12);
    line-height: 1;
}

/* ---------- Auth layout ---------- */
.auth-layout {
    position: relative;
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(22, 49, 69, 0.08), rgba(35, 111, 146, 0.08));
}

.auth-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 15%, rgba(128, 181, 69, 0.18), transparent 40%),
        radial-gradient(circle at 85% 20%, rgba(228, 174, 74, 0.18), transparent 40%),
        radial-gradient(circle at 70% 85%, rgba(35, 111, 146, 0.20), transparent 50%);
    pointer-events: none;
}

.auth-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1.5rem;
}

.auth-shell {
    width: min(520px, 92vw);
}

.auth-card {
    padding: 2.25rem;
    text-align: center;
    background: var(--surface-strong);
}

.auth-brand {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    background: rgba(22, 49, 69, 0.08);
    color: var(--brand-secondary);
    font-weight: 700;
    margin-bottom: 1.2rem;
}

.auth-logo {
    font-family: var(--font-display);
    letter-spacing: 0.4px;
}

.auth-subtitle {
    font-size: 0.85rem;
    opacity: 0.75;
    text-transform: uppercase;
}

.auth-title {
    font-family: var(--font-display);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-copy {
    color: rgba(15, 31, 47, 0.65);
    margin-bottom: 1.5rem;
}

.auth-actions {
    display: grid;
    gap: 0.75rem;
}

.auth-hint {
    margin-top: 1rem;
    color: rgba(15, 31, 47, 0.6);
    font-size: 0.85rem;
}

/* ---------- Planner ---------- */
.planner-layout {
    padding: 1.5rem 1.5rem 2rem;
}

.planner-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.planner-kicker {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--brand-primary);
    font-weight: 600;
}

.planner-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.planner-map-shell {
    background: var(--surface-strong);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-elev);
    overflow: hidden;
    min-height: 560px;
}

#plannerMap,
#plannerMapShare {
    width: 100%;
    height: 100%;
    min-height: 560px;
}

.planner-list .card-header {
    background: var(--surface);
}

.planner-day-label {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand-secondary);
    background: rgba(22, 49, 69, 0.05);
    border-top: 1px solid var(--border-soft);
}

.planner-day-toggle {
    width: 100%;
    border: none;
    background: rgba(22, 49, 69, 0.05);
    border-top: 1px solid var(--border-soft);
    padding: 0.65rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: var(--brand-secondary);
    text-align: left;
}

.planner-day-toggle:hover {
    background: rgba(22, 49, 69, 0.08);
}

.planner-day-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.planner-day-meta .material-icons {
    font-size: 20px;
}

.planner-rest-day {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
    background: rgba(22, 49, 69, 0.02);
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.planner-rest-day .material-icons {
    font-size: 24px;
    color: var(--brand-accent);
}

.planner-rest-day input {
    max-width: 400px;
}

.planner-rest-day .btn-link {
    padding: 0.25rem;
    color: var(--text-muted);
    text-decoration: none;
}

.planner-rest-day .btn-link:hover {
    color: var(--brand-primary);
}

.planner-item {
    border: none;
    border-bottom: 1px solid var(--border-soft);
}

.planner-item-top {
    display: flex;
    gap: 0.75rem;
}

.planner-item-clickable {
    cursor: pointer;
}


.planner-item-actions {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.planner-item-thumb {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid var(--border-soft);
    background: rgba(22, 49, 69, 0.08);
}

.planner-item-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem;
    border-radius: 10px;
    border: 1px dashed rgba(22, 49, 69, 0.25);
    color: rgba(22, 49, 69, 0.7);
    cursor: grab;
    touch-action: none;
}

.planner-item-handle:active {
    cursor: grabbing;
}

.planner-drag-ghost {
    opacity: 0.5;
    background: rgba(35, 111, 146, 0.08);
    border-radius: var(--radius-md);
}

.planner-drag-chosen {
    box-shadow: 0 12px 30px rgba(22, 49, 69, 0.18);
}

.planner-dragging {
    opacity: 0.85;
}

.planner-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
}

.planner-note {
    margin-top: 0.5rem;
}

.planner-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
}

.planner-reorder {
    display: flex;
    gap: 0.35rem;
}

.planner-empty {
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--brand-secondary);
}

.planner-share {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    background: var(--surface);
    margin-bottom: 1rem;
}

.planner-share-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: min(520px, 100%);
}

.planner-share-actions input {
    flex: 1;
    min-width: 220px;
}

.planner-request-card {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: 1rem;
}

.planner-request-card .form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: rgba(15, 31, 47, 0.7);
}

.planner-auth-card {
    max-width: 480px;
    margin: 2rem auto;
    padding: 2rem;
    text-align: center;
    background: var(--surface-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-soft);
}


@media (max-width: 991px) {
    #plannerMap,
    #plannerMapShare {
        min-height: 420px;
        height: 60vh;
    }
}
.planner-note-preview {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: rgba(15, 31, 47, 0.7);
}

.planner-note-preview.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.planner-note-toggle {
    padding: 0;
    font-size: 0.8rem;
    text-decoration: none;
}

.rc-toast {
    position: fixed;
    right: 1.25rem;
    bottom: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 12px 24px rgba(15, 33, 45, 0.25);
    z-index: 1055;
    background: #1f3d4f;
    color: #ffffff;
}

.rc-toast-info {
    background: #1f3d4f;
}

.rc-toast-success {
    background: #1b5e3c;
}

.rc-toast-error {
    background: #8c2b2f;
}

.rc-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 33, 45, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 1050;
}

.rc-modal {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid rgba(22, 49, 69, 0.1);
    box-shadow: 0 18px 40px rgba(15, 33, 45, 0.25);
    max-width: 420px;
    width: 100%;
}

.rc-modal-header {
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid #e6edf2;
}

.rc-modal-header h5 {
    font-weight: 600;
    color: #102836;
}

.rc-modal-body {
    padding: 1rem 1.25rem;
    color: #1c2b33;
}

.rc-modal-footer {
    padding: 0 1.25rem 1.25rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}
