/* =============================================================================
   HINDU TEMPLES PORTAL — Virtual Events Streaming (Wave 36)
   =============================================================================
   Live aarti discovery, HLS player, tip modal, live commerce overlay.
   REM-only sizing. Mobile-first. Touch targets >= 2.75rem.
   Saffron palette aligned with social.css and finances.css.
   ========================================================================== */


/* =============================================================================
   1. PAGE SHELL
   ========================================================================== */

.events-page {
    padding-top: 2rem;
    padding-bottom: 4rem;
}

.events-page .container,
.streaming-detail-page .container {
    max-width: 75rem;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 48rem) {
    .events-page .container,
    .streaming-detail-page .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

.streaming-hero {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 1rem;
    background: linear-gradient(180deg, rgba(255, 153, 51, 0.08), transparent);
    border-radius: 1rem;
}

.streaming-hero h1 {
    font-size: 1.75rem;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.streaming-hero .streaming-tagline {
    font-size: 1rem;
    color: var(--text-muted, #6b7280);
    margin: 0;
    max-width: 40rem;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 48rem) {
    .streaming-hero h1 { font-size: 2.25rem; }
}


/* =============================================================================
   2. FILTER BAR
   ========================================================================== */

.streaming-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: var(--bg-secondary, #f9fafb);
    border-radius: 0.75rem;
    align-items: center;
}

.streaming-filter-chip {
    min-height: 2.75rem;
    min-width: 2.75rem;
    padding: 0.5rem 1rem;
    border: 0.0625rem solid var(--border-primary, #d1d5db);
    border-radius: 999px;
    background: #fff;
    color: var(--text-primary, #1f2937);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.streaming-filter-chip:hover {
    border-color: var(--saffron, #FF9933);
}

.streaming-filter-chip[aria-pressed="true"] {
    background: var(--saffron, #FF9933);
    border-color: var(--saffron, #FF9933);
    color: #fff;
}

.streaming-filter-chip__live-dot {
    color: #dc2626;
    font-size: 0.625rem;
}

.streaming-filter-select {
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    border: 0.0625rem solid var(--border-primary, #d1d5db);
    border-radius: 0.5rem;
    background: #fff;
    font-size: 0.875rem;
    cursor: pointer;
}


/* =============================================================================
   3. EVENT CARD GRID + CARD
   ========================================================================== */

.streaming-events-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 48rem) {
    .streaming-events-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
}

@media (min-width: 64rem) {
    .streaming-events-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 80rem) {
    .streaming-events-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.streaming-event-card {
    background: #fff;
    border: 0.0625rem solid var(--border-primary, #e5e7eb);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.06);
    transition: transform 200ms ease, box-shadow 200ms ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.streaming-event-card:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.streaming-event-card:focus-visible {
    outline: 0.125rem solid var(--saffron, #FF9933);
    outline-offset: 0.125rem;
}

.streaming-event-card__thumb {
    aspect-ratio: 16 / 9;
    background: #f3f4f6;
    overflow: hidden;
    position: relative;
}

.streaming-event-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.streaming-event-card__thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--saffron, #FF9933);
    font-size: 2.5rem;
    background: linear-gradient(135deg, #fff7ed, #fde68a);
}

.streaming-event-card__body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.streaming-event-card__title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.35;
    color: var(--text-primary, #1f2937);
}

.streaming-event-card__temple {
    font-size: 0.875rem;
    color: var(--text-muted, #6b7280);
    margin: 0;
}

.streaming-event-card__starts-at {
    font-size: 0.875rem;
    color: var(--text-muted, #6b7280);
    margin: 0;
}

.streaming-event-card__type {
    background: #eff6ff;
    color: #1e40af;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
    display: inline-block;
}

.streaming-event-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 0.5rem;
}


/* =============================================================================
   4. STATUS PILLS
   ========================================================================== */

.streaming-pill {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.0375rem;
}

.streaming-pill--scheduled { background: #fef3c7; color: #92400e; }
.streaming-pill--live      { background: #fee2e2; color: #991b1b; animation: stream-pulse 2s infinite; }
.streaming-pill--ended     { background: #e5e7eb; color: #374151; }
.streaming-pill--cancelled { background: #fee2e2; color: #6b7280; }
.streaming-pill--archived  { background: #ede9fe; color: #5b21b6; }

@keyframes stream-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.55; }
}


/* =============================================================================
   5. EMPTY / UNAVAILABLE STATES
   ========================================================================== */

.streaming-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted, #6b7280);
    background: var(--bg-secondary, #f9fafb);
    border-radius: 1rem;
}

.streaming-empty-state i {
    font-size: 2.5rem;
    color: var(--saffron, #FF9933);
    display: block;
    margin-bottom: 1rem;
}

.streaming-empty-state h3 {
    font-size: 1.125rem;
    margin: 0 0 0.5rem 0;
    color: var(--text-primary, #1f2937);
}

.streaming-empty-state p {
    font-size: 0.9375rem;
    max-width: 32rem;
    margin: 0 auto;
}


/* =============================================================================
   6. PLAYER FRAME
   ========================================================================== */

.streaming-detail-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
    margin-top: 1.5rem;
}

@media (min-width: 64rem) {
    .streaming-detail-grid {
        grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr);
    }
}

.streaming-player-frame {
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 0.75rem;
    overflow: hidden;
    position: relative;
}

.streaming-player-frame video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.streaming-player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    padding: 1.5rem;
    text-align: center;
    z-index: 2;
}

.streaming-player-overlay i {
    font-size: 2.5rem;
    color: var(--saffron, #FF9933);
    margin-bottom: 0.75rem;
}

.streaming-player-overlay h3 {
    font-size: 1.25rem;
    margin: 0 0 0.5rem 0;
}

.streaming-player-overlay p {
    font-size: 0.9375rem;
    max-width: 28rem;
    margin: 0;
    opacity: 0.85;
}

.streaming-webrtc-cta {
    min-height: 2.75rem;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--saffron, #FF9933);
    color: #fff;
    border-radius: 0.5rem;
    border: 0;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.streaming-webrtc-cta:hover {
    background: var(--saffron-dark, #E68A2E);
    text-decoration: none;
}

.streaming-webrtc-overlay {
    position: relative;
}

.streaming-webrtc-room-pending {
    margin-top: 1rem;
    font-size: 0.875rem;
    opacity: 0.7;
}


/* =============================================================================
   7. EVENT TITLE / META BLOCK
   ========================================================================== */

.streaming-event-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.streaming-event-header h1 {
    font-size: 1.5rem;
    margin: 0;
    line-height: 1.25;
}

@media (min-width: 48rem) {
    .streaming-event-header h1 { font-size: 1.875rem; }
}

.streaming-event-breadcrumb {
    font-size: 0.875rem;
    color: var(--text-muted, #6b7280);
}

.streaming-event-breadcrumb a {
    color: var(--saffron, #FF9933);
    text-decoration: none;
}

.streaming-event-breadcrumb a:hover { text-decoration: underline; }

.streaming-event-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
    color: var(--text-muted, #6b7280);
}


/* =============================================================================
   8. SIDE PANEL (chat / tips / about tabs)
   ========================================================================== */

#streaming-side-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #fff;
    border: 0.0625rem solid var(--border-primary, #e5e7eb);
    border-radius: 0.75rem;
    overflow: hidden;
}

.streaming-side-tabs {
    display: flex;
    border-bottom: 0.0625rem solid var(--border-primary, #e5e7eb);
}

.streaming-side-tab {
    flex: 1;
    min-height: 2.75rem;
    padding: 0.625rem 0.75rem;
    background: transparent;
    border: 0;
    border-bottom: 0.1875rem solid transparent;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted, #6b7280);
    cursor: pointer;
}

.streaming-side-tab[aria-selected="true"] {
    color: var(--saffron, #FF9933);
    border-bottom-color: var(--saffron, #FF9933);
}

.streaming-side-panel__body {
    padding: 0.75rem;
}

.streaming-side-panel__pane[hidden] {
    display: none;
}

.streaming-chat-pane {
    height: 24rem;
    overflow-y: auto;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 0.5rem;
}

.streaming-chat-message {
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.625rem;
    background: #fff;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    line-height: 1.4;
    box-shadow: 0 0.03125rem 0.125rem rgba(0, 0, 0, 0.04);
}

.streaming-chat-message__sender {
    font-weight: 600;
    color: var(--saffron-dark, #E68A2E);
    margin-right: 0.25rem;
}

.streaming-chat-message__amount {
    color: #059669;
    font-weight: 600;
}

.streaming-tip-row__message {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.streaming-chat-empty {
    text-align: center;
    color: var(--text-muted, #6b7280);
    font-size: 0.875rem;
    padding: 1.5rem 0;
}


/* =============================================================================
   9. TIP BUTTON + MODAL
   ========================================================================== */

.streaming-tip-button {
    min-height: 2.75rem;
    min-width: 2.75rem;
    padding: 0.625rem 1.25rem;
    background: var(--saffron, #FF9933);
    color: #fff;
    border: 0;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 160ms ease;
}

.streaming-tip-button:hover {
    background: var(--saffron-dark, #E68A2E);
}

.streaming-tip-button:focus-visible {
    outline: 0.125rem solid var(--saffron-dark, #E68A2E);
    outline-offset: 0.125rem;
}

.streaming-tip-modal {
    border: 0;
    border-radius: 1rem;
    padding: 0;
    width: min(28rem, calc(100vw - 2rem));
    max-width: 28rem;
}

.streaming-tip-modal::backdrop {
    background: rgba(0, 0, 0, 0.55);
}

.streaming-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 0.0625rem solid var(--border-primary, #e5e7eb);
}

.streaming-modal-header h2 {
    font-size: 1.125rem;
    margin: 0;
}

.streaming-modal-close {
    min-height: 2.75rem;
    min-width: 2.75rem;
    background: transparent;
    border: 0;
    color: var(--text-muted, #6b7280);
    font-size: 1.125rem;
    cursor: pointer;
    border-radius: 0.5rem;
}

.streaming-modal-close:hover { background: #f3f4f6; }

.streaming-modal-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.streaming-tip-modal__amount-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.streaming-tip-modal__amount-button {
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    border: 0.0625rem solid var(--border-primary, #d1d5db);
    border-radius: 0.5rem;
    background: #fff;
    color: var(--text-primary, #1f2937);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease;
}

.streaming-tip-modal__amount-button:hover {
    border-color: var(--saffron, #FF9933);
}

.streaming-tip-modal__amount-button[aria-pressed="true"] {
    border-color: var(--saffron, #FF9933);
    background: #fff7ed;
    color: var(--saffron-dark, #E68A2E);
}

.streaming-tip-modal__custom-input {
    min-height: 2.75rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 0.0625rem solid var(--border-primary, #d1d5db);
    border-radius: 0.5rem;
    font-size: 1rem;
}

.streaming-tip-modal__message {
    width: 100%;
    min-height: 5rem;
    padding: 0.625rem 0.75rem;
    border: 0.0625rem solid var(--border-primary, #d1d5db);
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    font-family: inherit;
    resize: vertical;
}

.streaming-tip-modal__anonymous-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
}

.streaming-tip-modal__field-label {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    display: block;
}

.streaming-tip-modal__error {
    color: #b91c1c;
    font-size: 0.875rem;
    min-height: 1.25rem;
}

.streaming-modal-footer {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding: 1rem 1.25rem;
    border-top: 0.0625rem solid var(--border-primary, #e5e7eb);
}

.streaming-modal-footer .streaming-btn-ghost {
    min-height: 2.75rem;
    padding: 0.625rem 1rem;
    background: transparent;
    border: 0.0625rem solid var(--border-primary, #d1d5db);
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.streaming-modal-footer .streaming-btn-primary {
    min-height: 2.75rem;
    padding: 0.625rem 1.25rem;
    background: var(--saffron, #FF9933);
    color: #fff;
    border: 0;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
}

.streaming-modal-footer .streaming-btn-primary:hover {
    background: var(--saffron-dark, #E68A2E);
}

.streaming-modal-footer .streaming-btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}


/* =============================================================================
   10. LIVE COMMERCE OVERLAY
   ========================================================================== */

.streaming-commerce-overlay {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    max-width: 18rem;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 0.75rem;
    padding: 0.75rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.18);
    transition: transform 240ms ease-out, opacity 240ms ease-out;
    z-index: 3;
}

.streaming-commerce-overlay[hidden] { display: none; }

.streaming-commerce-overlay__title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    color: var(--text-primary, #1f2937);
}

.streaming-commerce-overlay__price {
    font-size: 0.9375rem;
    color: #059669;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.streaming-commerce-overlay__row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.streaming-commerce-overlay__thumb {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 0.5rem;
    object-fit: cover;
    flex-shrink: 0;
}

.streaming-commerce-overlay__cta {
    min-height: 2.75rem;
    min-width: 2.75rem;
    padding: 0.5rem 0.875rem;
    background: var(--saffron, #FF9933);
    color: #fff;
    border: 0;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 0.5rem;
}

.streaming-commerce-overlay__cta:hover {
    background: var(--saffron-dark, #E68A2E);
}

.streaming-commerce-overlay__close {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    min-height: 2rem;
    min-width: 2rem;
    background: transparent;
    border: 0;
    color: var(--text-muted, #6b7280);
    cursor: pointer;
    border-radius: 0.25rem;
}


/* =============================================================================
   11. ABOUT PANE (event description)
   ========================================================================== */

.streaming-about-pane {
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--text-primary, #1f2937);
}

.streaming-about-pane h4 {
    font-size: 0.9375rem;
    margin: 0 0 0.5rem 0;
}

.streaming-about-pane p { margin: 0 0 0.75rem 0; }
.streaming-about-pane dl { margin: 0; }
.streaming-about-pane dt { font-weight: 600; margin-top: 0.5rem; font-size: 0.8125rem; color: var(--text-muted, #6b7280); }
.streaming-about-pane dd { margin: 0; font-size: 0.9375rem; }


/* =============================================================================
   12. TICKET CTA + TICKET MODAL
   ========================================================================== */

.streaming-ticket-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.75rem;
}

.streaming-ticket-cta-row--prominent {
    margin-top: 1rem;
}

.streaming-ticket-modal {
    border: 0;
    border-radius: 1rem;
    padding: 0;
    width: min(26rem, calc(100vw - 2rem));
}

.streaming-ticket-modal::backdrop {
    background: rgba(0, 0, 0, 0.55);
}

.streaming-ticket-summary {
    background: #f9fafb;
    border-radius: 0.5rem;
    padding: 0.75rem;
    font-size: 0.9375rem;
}

.streaming-ticket-summary dt { font-weight: 500; }
.streaming-ticket-summary dd { margin: 0 0 0.375rem 0; }

.streaming-ticket-disclaimer {
    font-size: 0.875rem;
    color: var(--text-muted, #6b7280);
    margin: 0;
}
