/* ==========================================================================
   Eventside brand theme — remaps Bootstrap 5's default blue to the navy and
   orange from the Eventside logo. Bootstrap 5.3 scopes most component colors
   through local CSS custom properties (e.g. .btn-primary { --bs-btn-bg: ... }),
   so re-declaring the same properties on the same selectors here — loaded
   after bootstrap.min.css — wins the cascade without a Sass rebuild.
   ========================================================================== */
:root,
[data-bs-theme="light"] {
    --bs-primary: #011640;
    --bs-primary-rgb: 1, 22, 64;
    --bs-link-color: #011640;
    --bs-link-color-rgb: 1, 22, 64;
    --bs-link-hover-color: #fd4c2b;
    --bs-link-hover-color-rgb: 253, 76, 43;
    --bs-focus-ring-color: rgba(1, 22, 64, .25);

    /* Brand accents, available for one-off use (badges, highlights, etc). */
    --eventside-navy: #011640;
    --eventside-navy-rgb: 1, 22, 64;
    --eventside-orange: #fd4c2b;
    --eventside-orange-rgb: 253, 76, 43;
}

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #011640;
    --bs-btn-border-color: #011640;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #011338;
    --bs-btn-hover-border-color: #011338;
    --bs-btn-focus-shadow-rgb: 1, 22, 64;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #011132;
    --bs-btn-active-border-color: #011132;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #011640;
    --bs-btn-disabled-border-color: #011640;
}

.btn-outline-primary {
    --bs-btn-color: #011640;
    --bs-btn-border-color: #011640;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #011640;
    --bs-btn-hover-border-color: #011640;
    --bs-btn-focus-shadow-rgb: 1, 22, 64;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #011640;
    --bs-btn-active-border-color: #011640;
    --bs-btn-disabled-color: #011640;
    --bs-btn-disabled-border-color: #011640;
}

.alert-primary {
    --bs-alert-color: #011640;
    --bs-alert-bg: #e9ebf1;
    --bs-alert-border-color: #c7ccd5;
    --bs-alert-link-color: #011640;
}

.form-check-input:checked,
.form-switch .form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.form-range::-webkit-slider-thumb { background-color: var(--bs-primary); }
.form-range::-moz-range-thumb { background-color: var(--bs-primary); }
.form-range:focus::-webkit-slider-thumb { box-shadow: 0 0 0 1px #fff, 0 0 0 .25rem var(--bs-focus-ring-color); }
.form-range:focus::-moz-range-thumb { box-shadow: 0 0 0 1px #fff, 0 0 0 .25rem var(--bs-focus-ring-color); }

.form-control:focus,
.form-select:focus {
    border-color: rgba(1, 22, 64, .5);
    box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color);
}

.text-accent { color: var(--eventside-orange) !important; }
.bg-accent { background-color: var(--eventside-orange) !important; }
.border-accent { border-color: var(--eventside-orange) !important; }

/* ---- Marketing homepage ---- */
.home-hero {
    background: radial-gradient(circle at 15% 20%, #04244f 0%, var(--eventside-navy) 55%, #010d29 100%);
    color: #fff;
}
.home-hero .lead { color: rgba(255, 255, 255, .82); }
.home-stat-strip { background: #010d29; }
.home-feature-icon {
    width: 46px;
    height: 46px;
    border-radius: .65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(1, 22, 64, .08);
    color: var(--eventside-navy);
    flex: 0 0 auto;
}
.home-feature-card { transition: transform .15s ease, box-shadow .15s ease; }
.home-feature-card:hover, .home-feature-card:focus-within { transform: translateY(-3px); box-shadow: var(--bs-box-shadow) !important; }
.home-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--eventside-navy);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex: 0 0 auto;
}
.home-cta-band { background: linear-gradient(120deg, var(--eventside-navy), #04244f 60%, #0a1c3d); color: #fff; }
.home-feature-icon-accent { background: rgba(253, 76, 43, .1); color: var(--eventside-orange); }
.home-feature-icon svg { width: 24px; height: 24px; display: block; }

.home-hero-art { position: relative; min-height: 380px; }
.home-hero-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.home-floating-card {
    position: absolute;
    background: #fff;
    color: var(--eventside-navy);
    border-radius: .75rem;
    box-shadow: 0 .75rem 1.5rem rgba(1, 22, 64, .3);
    padding: .5rem .75rem;
    display: flex;
    align-items: center;
    gap: .55rem;
    max-width: 190px;
}
.home-floating-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: rgba(1, 22, 64, .08);
    color: var(--eventside-navy);
}
.home-floating-icon svg { width: 16px; height: 16px; display: block; }
.home-floating-card.is-accent .home-floating-icon { background: rgba(253, 76, 43, .12); color: var(--eventside-orange); }
.home-floating-card-1 { top: 4%; left: -2%; --tilt: -4deg; transform: rotate(var(--tilt)); }
.home-floating-card-2 { top: 0; right: -2%; --tilt: 3deg; transform: rotate(var(--tilt)); }
.home-floating-card-3 { bottom: 10%; left: 1%; --tilt: -2deg; transform: rotate(var(--tilt)); }
@media (prefers-reduced-motion: no-preference) {
    .home-floating-card { animation: home-float 5s ease-in-out infinite; }
    .home-floating-card-2 { animation-delay: .6s; }
    .home-floating-card-3 { animation-delay: 1.2s; }
}
@keyframes home-float {
    0%, 100% { transform: translateY(0) rotate(var(--tilt, 0deg)); }
    50% { transform: translateY(-8px) rotate(var(--tilt, 0deg)); }
}

html { overflow-x: hidden; }
body { min-width: 320px; }
img, video { max-width: 100%; }
#app-main { min-height: calc(100vh - 72px); }
#app-main[aria-busy="true"] { opacity: .65; transition: opacity .15s ease; }
#app-progress {
    position: fixed;
    z-index: 1100;
    inset: 0 auto auto 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--eventside-navy), var(--eventside-orange));
    opacity: 0;
    transition: width .25s ease, opacity .2s ease;
}
#app-progress.is-loading { width: 75%; opacity: 1; }
#app-progress.is-complete { width: 100%; opacity: 0; }
.ajax-notice { position: sticky; top: 72px; z-index: 1020; }

@media (max-width: 767.98px) {
    .navbar-collapse .btn { width: 100%; }
    .card-body { padding: 1.25rem !important; }
    .display-5 { font-size: clamp(2rem, 11vw, 3rem); }
    .input-group-text { max-width: 42%; overflow: hidden; text-overflow: ellipsis; }
    .auth-shell #app-main > .container { padding: 0 !important; }
    .auth-shell #app-main .card { width: 100% !important; }
}

.navbar-brand { display: inline-flex; align-items: center; }
.navbar-logo { height: 40px; width: auto; }

@media (max-width: 575.98px) {
    .navbar-logo { height: 32px; }
}

/* Collapsible admin sections (categories, forums, etc.) */
details > summary { cursor: pointer; }
details > summary::marker { color: var(--bs-secondary-color); }
details[open] > summary { margin-bottom: .25rem; }

/* Small poster/author avatar used on listing cards (jobs, marketplace, etc.) */
.listing-avatar { width: 32px; height: 32px; flex: 0 0 32px; object-fit: cover; font-size: .8rem; }
.listing-avatar-lg { width: 52px; height: 52px; flex: 0 0 52px; object-fit: cover; font-size: 1.1rem; }

.navbar .dropdown-menu { min-width: 17rem; }
.navbar .dropdown-item { padding-top: .65rem; padding-bottom: .65rem; }
.dashboard-summary { transition: transform .15s ease, box-shadow .15s ease; }
.dashboard-summary:hover, .dashboard-summary:focus-visible { transform: translateY(-2px); box-shadow: var(--bs-box-shadow) !important; }

@media (max-width: 991.98px) {
    #eventside-navigation .navbar-nav { gap: .35rem; }
    #eventside-navigation .nav-link, #eventside-navigation .btn { width: 100%; padding: .7rem .85rem; text-align: left; }
    #eventside-navigation .dropdown-menu { position: static; width: 100%; min-width: 0; margin: .15rem 0 .5rem; box-shadow: none !important; border-color: var(--bs-border-color); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
.presence-dot {
    display: inline-block;
    width: .55rem;
    height: .55rem;
    margin-right: .35rem;
    border-radius: 50%;
    background: var(--bs-secondary-color);
    vertical-align: .05rem;
}

[data-presence-online="1"] .presence-dot {
    background: var(--bs-success);
    box-shadow: 0 0 0 .15rem rgba(var(--bs-success-rgb), .14);
}

.live-chat-popup {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1080;
    width: min(390px, calc(100vw - 2rem));
    height: min(560px, calc(100dvh - 2rem));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bs-body-bg);
}

.live-chat-popup[hidden] {
    display: none;
}

.live-chat-popup-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.live-chat-popup-message {
    max-width: 82%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.live-chat-popup-message.sent {
    margin-left: auto;
    background: var(--bs-primary);
    color: #fff;
}

.live-chat-popup-message.received {
    margin-right: auto;
    background: var(--bs-tertiary-bg);
}

.live-chat-popup textarea {
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    resize: none;
    overflow-y: auto;
}

/* Long profile or page names must not widen commercial documents on phones. */
.card-body > .d-flex.justify-content-between.gap-4 {
    flex-wrap: wrap;
}

.card-body > .d-flex.justify-content-between.gap-4 .text-end {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 575.98px) {
    .live-chat-popup {
        right: .5rem;
        bottom: .5rem;
        width: calc(100vw - 1rem);
        height: min(72dvh, 580px);
    }
}

/* Briefly flashed on the element a #hash link (e.g. from a notification)
   scrolls to, such as a specific job application in the applications list. */
.eventside-highlight {
    animation: eventside-highlight-fade 2.5s ease-out;
    border-radius: .5rem;
}

@keyframes eventside-highlight-fade {
    0% { background-color: rgba(var(--bs-primary-rgb), .18); }
    100% { background-color: transparent; }
}
