/*
 * Promelore app theme.
 *
 * These design tokens (colors, fonts, spacing) are the single source of
 * truth from the marketing site (MomentHive-Web repo, styles/styles.css)
 * and must stay in sync with it - this file adapts that same look onto
 * Bootstrap 5's component classes rather than introducing a different
 * palette. The layout sets data-bs-theme="dark" so Bootstrap's own
 * components start from its dark variant, and these tokens refine it.
 *
 * Surfaces are solid (no glass, glows or gradient text); the neon palette
 * is used for accents only.
 *
 * Loaded after bootstrap.min.css and site.css so these rules win.
 */

:root,
[data-bs-theme="dark"] {
    /* Brand palette */
    --midnight: #0b1530;
    --cyan: #22d3ee;
    --pink: #f472d0;
    --gold: #ffd166;
    --gold-hover: #ffdc85;
    --lilac: #a78bfa;
    --cream: #f4ebdd;

    --pink-rgb: 244, 114, 208;
    --lilac-rgb: 167, 139, 250;
    --cyan-rgb: 34, 211, 238;
    --gold-rgb: 255, 209, 102;
    --bg-rgb: 7, 13, 32;

    /* Surfaces + text */
    --bg: #070d20;
    --bg-alt: #0b1530;
    --surface: #0e1836;
    --surface-raised: #121f43;
    --line: #1f2b52;
    --line-strong: #3a4878;
    --text: #eef0fa;
    --text-soft: #a9b0c8;
    --text-muted: #7c84a3;

    --font-display: "Playfair Display", Georgia, serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    --radius: 14px;

    /* Re-point Bootstrap's own theme variables at the same tokens so
       components that read --bs-* directly (buttons, forms, links,
       borders, tables) pick up the brand automatically. */
    --bs-body-font-family: var(--font-body);
    --bs-body-bg: var(--bg);
    --bs-body-bg-rgb: var(--bg-rgb);
    --bs-body-color: var(--text);
    --bs-body-color-rgb: 238, 240, 250;
    --bs-emphasis-color: #fff;
    --bs-secondary-color: var(--text-soft);
    --bs-secondary-bg: var(--bg-alt);
    --bs-tertiary-bg: var(--surface);
    --bs-heading-color: var(--text);
    --bs-border-color: var(--line);
    --bs-border-color-translucent: var(--line);
    --bs-border-radius: 10px;
    --bs-border-radius-sm: 8px;
    --bs-border-radius-lg: var(--radius);
    --bs-link-color: var(--cyan);
    --bs-link-color-rgb: var(--cyan-rgb);
    --bs-link-hover-color: var(--gold);
    --bs-link-hover-color-rgb: var(--gold-rgb);
    --bs-primary: var(--lilac);
    --bs-primary-rgb: var(--lilac-rgb);
    --bs-secondary: var(--text-soft);
    --bs-secondary-rgb: 169, 176, 200;
    --bs-focus-ring-color: rgba(var(--lilac-rgb), 0.35);
    --bs-form-valid-color: #6ee7b7;
    --bs-form-invalid-color: #fb7185;
}

body {
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    /* Playfair defaults to old-style figures; lining ones read better in stats and dates. */
    font-variant-numeric: lining-nums;
    font-weight: 600;
    color: var(--text);
}

a {
    text-decoration-color: rgba(var(--cyan-rgb), 0.4);
}

.text-muted {
    color: var(--text-soft) !important;
}

.text-danger {
    color: #fb7185 !important;
}

/* Italic accent used in headlines ("tells a story"). */
.accent {
    font-style: italic;
    color: var(--gold);
}

.eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 0.6rem;
}

/* ---------- Buttons ---------- */

.btn {
    border-radius: 999px;
    font-weight: 600;
    transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary,
.btn-primary:focus {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--midnight);
}

.btn-primary:hover {
    background: var(--gold-hover);
    border-color: var(--gold-hover);
    color: var(--midnight);
    transform: translateY(-1px);
}

.btn-primary:active,
.btn-primary:focus-visible,
.btn-primary:disabled {
    background: var(--gold) !important;
    border-color: var(--gold) !important;
    color: var(--midnight) !important;
}

.btn-secondary,
.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-dark {
    background: transparent;
    color: var(--text);
    border-color: var(--line-strong);
}

.btn-secondary:hover,
.btn-outline-secondary:hover,
.btn-outline-primary:hover,
.btn-outline-dark:hover,
.btn-secondary:active,
.btn-outline-secondary:active,
.btn-outline-primary:active,
.btn-outline-dark:active {
    background: var(--surface-raised) !important;
    color: var(--text) !important;
    border-color: var(--cream) !important;
}

.btn-link {
    color: var(--cyan);
}

.btn-link:hover {
    color: var(--gold);
}

.btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(var(--cyan-rgb), 0.45) !important;
}

/* Status-coloured buttons (success/warning/danger) keep their semantic
   hue for clarity - only the shape/weight is brought in line. */
.btn-success, .btn-outline-success,
.btn-warning, .btn-outline-warning,
.btn-danger, .btn-outline-danger {
    font-weight: 600;
}

/* ---------- Forms ---------- */

.form-control,
.form-select {
    background-color: var(--bg);
    color: var(--text);
    border-color: var(--line-strong);
    border-radius: 10px;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--bg);
    color: var(--text);
    border-color: var(--lilac);
    box-shadow: 0 0 0 3px rgba(var(--lilac-rgb), 0.25);
}

.form-check-input {
    background-color: var(--bg);
    border-color: var(--line-strong);
    accent-color: var(--gold);
}

.form-check-input:checked {
    background-color: var(--lilac);
    border-color: var(--lilac);
}

.form-check-input:focus {
    border-color: var(--lilac);
    box-shadow: 0 0 0 3px rgba(var(--lilac-rgb), 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--text);
}

.form-text {
    color: var(--text-soft);
}

.input-group-text {
    background: var(--surface-raised);
    color: var(--text-soft);
    border-color: var(--line-strong);
}

/* ---------- Cards / surfaces ---------- */

.card {
    --bs-card-bg: var(--surface);
    --bs-card-cap-bg: var(--surface-raised);
    border-color: var(--line);
    border-radius: var(--radius);
    transition: border-color 0.2s ease;
}

.card:hover {
    border-color: var(--line-strong);
}

.card-img-top {
    border-top-left-radius: calc(var(--radius) - 1px);
    border-top-right-radius: calc(var(--radius) - 1px);
}

.list-group {
    --bs-list-group-bg: var(--surface);
    --bs-list-group-border-color: var(--line);
    --bs-list-group-color: var(--text);
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--line);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.025);
    --bs-table-striped-color: var(--text);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
    --bs-table-hover-color: var(--text);
}

.table thead th {
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.alert {
    border-radius: 10px;
}

.alert-info {
    --bs-alert-bg: rgba(var(--cyan-rgb), 0.1);
    --bs-alert-border-color: rgba(var(--cyan-rgb), 0.35);
    --bs-alert-color: #a5f3fc;
}

.alert-light,
.alert-secondary {
    --bs-alert-bg: var(--surface);
    --bs-alert-border-color: var(--line);
    --bs-alert-color: var(--text);
}

/* Neutral "chip" badges (plan name, "You", "In development"). */
.badge.bg-light {
    background: var(--surface-raised) !important;
    color: var(--text) !important;
    border-color: var(--line-strong) !important;
}

.badge.bg-dark {
    background: var(--lilac) !important;
    color: var(--midnight);
}

.badge.bg-secondary {
    background: var(--line-strong) !important;
    color: var(--text);
}

hr {
    border-top-color: var(--line);
    opacity: 1;
}

/* ---------- Header / nav ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(var(--bg-rgb), 0.96);
    border-bottom: 1px solid var(--line);
}

.site-header .navbar-brand {
    display: flex;
    align-items: center;
    white-space: nowrap;
    padding: 0;
}

.brand-wordmark {
    height: 34px;
    width: auto;
}

.site-header .nav-link {
    color: var(--text-soft) !important;
    font-weight: 500;
    transition: color 0.15s ease;
}

.site-header .nav-link:hover,
.site-header .nav-link.active {
    color: var(--text) !important;
}

/* Link out to the marketing site: an outlined pill, divided from the
   app's own nav so it doesn't read as another app page. */
.site-header .nav-link-website {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.85rem !important;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-size: 0.9rem;
}

.site-header .nav-link-website:hover {
    border-color: var(--gold);
    color: var(--gold) !important;
}

@media (min-width: 992px) {
    .site-header .nav-item-website {
        display: flex;
        align-items: center;
        margin-right: 0.75rem;
        padding-right: 0.75rem;
        border-right: 1px solid var(--line-strong);
    }
}

@media (max-width: 991.98px) {
    .site-header .nav-item-website {
        margin: 0.5rem 0;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid var(--line);
    }
}

.site-header .navbar-toggler {
    border-color: var(--line-strong);
}

.site-header .navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(var(--lilac-rgb), 0.35);
}

/* ---------- Footer ---------- */

.site-footer {
    border-top: 1px solid var(--line) !important;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.site-footer .footer-tagline {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--text-soft);
}

.site-footer a {
    color: var(--text-soft);
}

.site-footer a:hover {
    color: var(--gold);
}

/* ---------- Welcome hero (signed-out home) ---------- */

.welcome-hero {
    position: relative;
    isolation: isolate;
    padding: 1rem 0 9rem;
}

.welcome-hero::after {
    /* Illumination track along the foot of the hero */
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 150px;
    background: url("../images/light-trails.svg") center / cover no-repeat;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    pointer-events: none;
    z-index: -1;
}

img {
    height: auto;
}

/* Photo collage: one main shot with two "prints" pinned over it
   (same treatment as the marketing site's hero). */
.welcome-collage {
    position: relative;
    max-width: 520px;
    margin: 0 auto 2.5rem;
    padding: 1.5rem 1.25rem 2.75rem;
}

.welcome-collage .collage-main {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid var(--line-strong);
}

.welcome-collage .collage-print {
    position: absolute;
    width: 38%;
    aspect-ratio: 1;
    object-fit: cover;
    padding: 7px 7px 22px;
    background: var(--cream);
    border-radius: 4px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}

.welcome-collage .print-a {
    left: 0;
    bottom: 0;
    transform: rotate(-6deg);
}

.welcome-collage .print-b {
    right: 0;
    top: 0;
    transform: rotate(5deg);
}

.welcome-hero h1 {
    font-size: clamp(2.4rem, 5vw, 3.6rem);
}

/* ---------- Auth / guest join card ---------- */

.auth-card {
    width: 100%;
    max-width: 440px;
    margin: 2.5rem auto 3rem;
    padding: 2.5rem 2.25rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    overflow: hidden;
}

/* Event photo across the top of the card, bleeding to its edges. */
.auth-photo {
    display: block;
    width: calc(100% + 4.5rem);
    max-width: none;
    margin: -2.5rem -2.25rem 0;
    aspect-ratio: 16 / 7;
    object-fit: cover;
}

.auth-card h1 {
    font-size: 1.9rem;
    margin-bottom: 0.5rem;
}

.auth-mark {
    width: 52px;
    height: 52px;
    margin-bottom: 1.1rem;
}

/* With a photo above, the mark overlaps its bottom edge. */
.auth-photo + .auth-mark {
    position: relative;
    margin-top: -26px;
    border-radius: 12px;
    box-shadow: 0 0 0 4px var(--surface);
}

@media (max-width: 575.98px) {
    .auth-card {
        padding: 2rem 1.4rem;
        margin-top: 1.25rem;
    }

    .auth-photo {
        width: calc(100% + 2.8rem);
        margin: -2rem -1.4rem 0;
    }

    .brand-wordmark {
        height: 28px;
    }
}

/* ---------- Admin dashboard ---------- */

.stat-tile,
.chart-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    height: 100%;
    transition: border-color 0.2s ease;
}

.stat-tile:hover {
    border-color: var(--line-strong);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cyan);
}

.stat-value {
    font-family: var(--font-display);
    font-variant-numeric: lining-nums tabular-nums;
    font-size: 2rem;
    line-height: 1.2;
    color: var(--text);
}

.stat-sub {
    font-size: 0.85rem;
    color: var(--text-soft);
}

.chart-card h2 {
    font-size: 1.1rem;
    margin-bottom: 0.15rem;
}

.chart-sub {
    font-size: 0.82rem;
    color: var(--text-soft);
    margin-bottom: 0.9rem;
}

/* Chart series colours, drawn from the brand palette. */
.chart-c0 { --chart-color: var(--cyan); }
.chart-c1 { --chart-color: var(--pink); }
.chart-c2 { --chart-color: var(--gold); }
.chart-c3 { --chart-color: var(--lilac); }
.chart-c4 { --chart-color: #6b7aa6; } /* muted slate blue, clearly quieter than the brand hues */

.donut-svg {
    width: 130px;
    height: 130px;
    flex-shrink: 0;
}

.donut-ring {
    stroke: var(--line);
}

.donut-segment {
    stroke: var(--chart-color);
}

.donut-total {
    font-family: var(--font-display);
    font-variant-numeric: lining-nums;
    font-size: 8px;
    fill: var(--text);
}

.chart-legend li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    margin-bottom: 0.3rem;
}

.chart-swatch {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 3px;
    background: var(--chart-color);
    flex-shrink: 0;
}

.legend-value {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
    color: var(--text-soft);
    white-space: nowrap;
}

.bar-chart li {
    display: grid;
    grid-template-columns: minmax(70px, 34%) 1fr auto;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
    font-size: 0.88rem;
}

.bar-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-label a {
    color: var(--text);
    text-decoration: none;
}

.bar-label a:hover {
    color: var(--gold);
    text-decoration: underline;
}

.bar-track {
    background: var(--line);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}

.bar-fill {
    background: var(--pink);
    height: 100%;
    border-radius: 999px;
}

.bar-value {
    font-variant-numeric: tabular-nums;
    color: var(--text-soft);
    white-space: nowrap;
}

.line-chart {
    width: 100%;
    height: auto;
    display: block;
}

.chart-grid {
    stroke: var(--line);
    stroke-width: 1;
}

.chart-axis-label {
    font-size: 10px;
    fill: var(--text-soft);
}

.chart-area {
    fill: rgba(var(--pink-rgb), 0.12);
}

.chart-line {
    stroke: var(--pink);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.chart-dot {
    fill: var(--pink);
    stroke: var(--bg);
    stroke-width: 1.5;
}

.chart-dot:hover {
    r: 5;
}

@media (prefers-reduced-motion: reduce) {
    .btn,
    .card,
    .stat-tile {
        transition: none;
    }
}
