/**
 * Happening Tonight – Module Stylesheet  (v1.4.0)
 *
 * v1.4.0: Bootstrap modal styles removed.
 * Inline form card (ht-form-wrap / ht-form-header) replaces ht-modal-header.
 *
 * Compatible with Bootstrap 5 (Joomla 5 default).
 */

/* ── Container ─────────────────────────────────────────────────── */
.mod-happening-tonight { font-family: inherit; }

/* ── Heading ───────────────────────────────────────────────────── */
.ht-heading {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -.3px;
}
.ht-heading i { color: #e94560; }

/* ── Flash messages ────────────────────────────────────────────── */
.ht-flash .alert {
    border-radius: 8px;
    font-weight: 500;
    animation: htSlideDown .35s ease;
}
@keyframes htSlideDown {
    from { opacity:0; transform:translateY(-10px); }
    to   { opacity:1; transform:translateY(0); }
}

/* ── Inline form wrapper ───────────────────────────────────────── */
.ht-form-wrap {
    animation: htSlideDown .3s ease;
    margin-bottom: 1.5rem;
}
/* When hidden attribute is removed, animate in */
.ht-form-wrap:not([hidden]) {
    display: block;
}

/* ── Inline form card header ───────────────────────────────────── */
.ht-form-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
    border-radius: calc(0.375rem - 1px) calc(0.375rem - 1px) 0 0;
}

/* ── Inline form error banner ──────────────────────────────────── */
.ht-form-err .alert { margin-bottom: 0; border-radius: 6px; }

/* ── Event cards ───────────────────────────────────────────────── */
.ht-event-card {
    border: none;
    border-left: 4px solid #e94560;
    border-radius: 10px;
    transition: transform .2s ease, box-shadow .2s ease;
    animation: htFadeIn .4s ease;
}
@keyframes htFadeIn {
    from { opacity:0; transform:translateY(12px); }
    to   { opacity:1; transform:translateY(0); }
}
.ht-event-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.12) !important;
}
.ht-event-card.ht-new-event { border-left-color: #0d6efd; }

/* ── Event image ───────────────────────────────────────────────── */
.ht-event-img {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: 8px;
}

/* ── Title ─────────────────────────────────────────────────────── */
.ht-event-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
}

/* ── Meta row ──────────────────────────────────────────────────── */
.ht-event-meta { font-size: .875rem; color: #555; }
.ht-meta-item  { display:inline-flex; align-items:center; gap:5px; }
.ht-meta-item i { color:#e94560; font-size:.8rem; flex-shrink:0; }

/* ── Description ───────────────────────────────────────────────── */
.ht-event-reason {
    font-size: .92rem;
    color: #444;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Maps link (venue address) ─────────────────────────────────── */
.ht-maps-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted currentColor;
    transition: color .15s;
}
.ht-maps-link:hover {
    color: #e94560;
    border-bottom-color: #e94560;
    text-decoration: none;
}

/* ── Contact links ─────────────────────────────────────────────── */
.ht-contact-link {
    font-size: .875rem;
    color: #0d6efd;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color .15s;
}
.ht-contact-link:hover { color:#e94560; text-decoration:underline; }

/* ── No-events placeholder ─────────────────────────────────────── */
.ht-no-events {
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

/* ── Badges ─────────────────────────────────────────────────────────────────
   Explicit hex colours + !important so Joomla template Bootstrap overrides
   (including dark-mode variable reassignments) can never make them unreadable.
   ─────────────────────────────────────────────────────────────────────────── */
.ht-event-badges .badge {
    font-size: .75rem;
    font-weight: 600;
    padding: .35em .65em;
    border: none;
}

/* Free Admission — blue */
.ht-event-badges .badge.bg-primary {
    background-color: #0d6efd !important;
    color: #ffffff !important;
}

/* Paid admission / price — slate-gray */
.ht-event-badges .badge.bg-secondary {
    background-color: #5a6270 !important;
    color: #ffffff !important;
}

/* Registration Required — amber */
.ht-event-badges .badge.bg-warning {
    background-color: #e6a817 !important;
    color: #1a1a1a !important;
}

/* Security Provided — green */
.ht-event-badges .badge.bg-success {
    background-color: #198754 !important;
    color: #ffffff !important;
}

/* "New" badge injected by AJAX — red accent */
.ht-event-card .badge.bg-danger {
    background-color: #e94560 !important;
    color: #ffffff !important;
}

/* ── Delete button ─────────────────────────────────────────────── */
.ht-delete-btn { opacity:.35; transition:opacity .2s; }
.ht-event-card:hover .ht-delete-btn { opacity:1; }

/* ── Form labels ───────────────────────────────────────────────── */
.ht-label {
    color: #333;
    font-size: .875rem;
    font-weight: 600;
    margin-bottom: 4px;
}

/* ── Focus ring ────────────────────────────────────────────────── */
.ht-event-form .form-control:focus,
.ht-event-form .form-select:focus {
    border-color: #e94560;
    box-shadow: 0 0 0 .2rem rgba(233,69,96,.2);
}

/* ── Radio groups ──────────────────────────────────────────────── */
.ht-radio-group { display:flex; flex-direction:column; gap:4px; }

/* ── Image preview ─────────────────────────────────────────────── */
.ht-image-preview {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    text-align: center;
}

/* ── Submit button ─────────────────────────────────────────────── */
.ht-submit-btn {
    background: linear-gradient(135deg,#e94560,#c0392b);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: .5rem 1.4rem;
    transition: opacity .2s;
}
.ht-submit-btn:hover:not(:disabled) { opacity:.9; color:#fff; }
.ht-submit-btn:disabled { opacity:.65; cursor:not-allowed; }

/* ── Required asterisk colour ──────────────────────────────────── */
.ht-event-form .text-danger { color: #dc3545 !important; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width:576px) {
    .ht-heading     { font-size:1.3rem; }
    .ht-event-title { font-size:1rem; }
    .ht-event-meta  { flex-direction:column; gap:4px !important; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   DARK MODE
   Triggered by Bootstrap 5 / Joomla 5:  [data-bs-theme="dark"] on <html>
   Fallback for OS-level pref:            @media (prefers-color-scheme: dark)
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Bootstrap 5 data-attribute dark mode ─────────────────────────────────── */
[data-bs-theme="dark"] .mod-happening-tonight .ht-heading,
[data-bs-theme="dark"] .mod-happening-tonight .ht-event-title {
    color: #e2e8f0;
}
[data-bs-theme="dark"] .mod-happening-tonight .ht-heading i { color: #f87171; }

[data-bs-theme="dark"] .mod-happening-tonight .ht-event-meta,
[data-bs-theme="dark"] .mod-happening-tonight .ht-meta-item { color: #94a3b8; }
[data-bs-theme="dark"] .mod-happening-tonight .ht-meta-item i { color: #f87171; }

[data-bs-theme="dark"] .mod-happening-tonight .ht-event-reason { color: #cbd5e1; }

[data-bs-theme="dark"] .mod-happening-tonight .ht-event-card {
    background-color: #1e293b;
    border-left-color: #f87171;
}
[data-bs-theme="dark"] .mod-happening-tonight .ht-event-card.ht-new-event {
    border-left-color: #60a5fa;
}
[data-bs-theme="dark"] .mod-happening-tonight .ht-event-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.45) !important;
}

[data-bs-theme="dark"] .mod-happening-tonight .ht-no-events {
    background: #0f172a;
    border-color: #334155;
    color: #94a3b8;
}

[data-bs-theme="dark"] .mod-happening-tonight .ht-label { color: #e2e8f0; }

[data-bs-theme="dark"] .mod-happening-tonight .ht-contact-link { color: #60a5fa; }
[data-bs-theme="dark"] .mod-happening-tonight .ht-contact-link:hover { color: #f87171; }

[data-bs-theme="dark"] .mod-happening-tonight .ht-maps-link { color: inherit; }
[data-bs-theme="dark"] .mod-happening-tonight .ht-maps-link:hover { color: #f87171; border-bottom-color: #f87171; }

[data-bs-theme="dark"] .mod-happening-tonight .ht-event-form .form-control:focus,
[data-bs-theme="dark"] .mod-happening-tonight .ht-event-form .form-select:focus {
    border-color: #f87171;
    box-shadow: 0 0 0 .2rem rgba(248,113,113,.25);
}

/* ── OS-level dark mode (prefers-color-scheme) ────────────────────────────── */
@media (prefers-color-scheme: dark) {
    .mod-happening-tonight .ht-heading,
    .mod-happening-tonight .ht-event-title { color: #e2e8f0; }
    .mod-happening-tonight .ht-heading i   { color: #f87171; }

    .mod-happening-tonight .ht-event-meta,
    .mod-happening-tonight .ht-meta-item   { color: #94a3b8; }
    .mod-happening-tonight .ht-meta-item i { color: #f87171; }

    .mod-happening-tonight .ht-event-reason { color: #cbd5e1; }

    .mod-happening-tonight .ht-event-card {
        background-color: #1e293b;
        border-left-color: #f87171;
    }
    .mod-happening-tonight .ht-event-card.ht-new-event { border-left-color: #60a5fa; }
    .mod-happening-tonight .ht-event-card:hover {
        box-shadow: 0 8px 24px rgba(0,0,0,.45) !important;
    }

    .mod-happening-tonight .ht-no-events {
        background: #0f172a;
        border-color: #334155;
        color: #94a3b8;
    }

    .mod-happening-tonight .ht-label        { color: #e2e8f0; }
    .mod-happening-tonight .ht-contact-link { color: #60a5fa; }
    .mod-happening-tonight .ht-contact-link:hover { color: #f87171; }
    .mod-happening-tonight .ht-maps-link:hover    { color: #f87171; border-bottom-color: #f87171; }

    .mod-happening-tonight .ht-event-form .form-control:focus,
    .mod-happening-tonight .ht-event-form .form-select:focus {
        border-color: #f87171;
        box-shadow: 0 0 0 .2rem rgba(248,113,113,.25);
    }
}
/* ── Print ─────────────────────────────────────────────────────── */
@media print {
    .ht-add-event-btn,
    .ht-form-wrap,
    .ht-delete-btn { display:none !important; }
}
