/* ============================================
   Bethany Baptist Church - Sermons Page Styles
   Self-contained stylesheet
   ============================================ */

/* ============================================
   THEME VARIABLES
   ============================================ */
:root {
    --bg:               #ffffff;
    --text:             #222222;
    --nav-bg:           #2c2c2c;
    --card-bg:          #ffffff;
    --accent:           #333333;
    --muted:            #666666;
    --footer-bg:        #2c2c2c;
    --footer-text:      #ffffff;
    --player-bg:        #f8f9fa;
    --tab-active:       #0b5ed7;
    --pill-active:      #198754;
    --dropdown-bg:      #ffffff;
    --dropdown-text:    #000000;
    --dropdown-hover-bg:#f0f0f0;
    --border-color:     #dee2e6;
}

[data-theme="dark"] {
    --bg:               #121212;
    --text:             #e0e0e0;
    --nav-bg:           #0d63e0;
    --footer-bg:        #0d63e0;
    --footer-text:      #ffffff;
    --card-bg:          #1e1e1e;
    --accent:           #cccccc;
    --muted:            #999999;
    --player-bg:        #2a2a2a;
    --dropdown-bg:      #2c2c2c;
    --dropdown-text:    #e0e0e0;
    --dropdown-hover-bg:#3c3c3c;
    --border-color:     #444444;
}

/* ============================================
   THEME OVERRIDE — Bootstrap text-muted
   ============================================ */
.sermons-tab-content .text-muted,
.live-cards-sidebar .text-muted {
    color: var(--muted) !important;
}

/* ============================================
   GLOBAL RESET + TYPOGRAPHY
   ============================================ */
html, body {
    background-color: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    transition: background-color 250ms ease, color 250ms ease;
}

h1, h2, h3, h4, h5 {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

p {
    margin-bottom: 1rem;
}

.container, .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* ============================================
   HEADER BACKGROUND
   ============================================ */
.header-bg {
    width: 100%;
    background-color: var(--nav-bg);
    background-image: linear-gradient(to bottom, #2c2c2c, #1a1a1a);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

/* ============================================
   Header / Navbar Styling
   ============================================ */
.navbar.small-menu {
    padding-top: 0.2rem !important;
    padding-bottom: 0 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

/* Logo */
.header-logo {
    width: 200px !important;
    max-width: 200px !important;
    height: auto;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.header-logo:hover,
.header-logo:focus {
    transform: scale(1.10);
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Light mode logo - invert black logo to white for dark header */
.header-logo {
    filter: invert(1) brightness(1.1);
}

/* Dark mode logo - restore original black logo for blue header */
[data-theme="dark"] .header-logo {
    filter: none;
}

/* Smaller menu font + readability */
.navbar.small-menu .nav-link {
    font-size: 0.85rem !important;
    letter-spacing: 0.3px;
}

/* Ensure no vertical shift of menu block */
.navbar.small-menu .navbar-nav {
    margin-top: 0 !important;
}

/* Clean underline animation */
.navbar.small-menu .nav-link {
    position: relative;
}

.navbar.small-menu .nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0.15rem;
    width: 0%;
    height: 2px;
    background: #fff;
    transition: width 0.25s ease;
}

.navbar.small-menu .nav-link:hover::after,
.navbar.small-menu .nav-link:focus::after {
    width: 100%;
}

/* Base nav links */
.nav-link {
    transition: all 0.3s ease;
    margin: 0 5px;
    font-weight: 500;
    color: #fff !important;
}

.nav-link:hover,
.nav-link:focus {
    transform: scale(1.08);
    outline: none;
}

/* Active page highlighting */
.navbar.small-menu .nav-link.active {
    border-bottom: 3px solid #fff;
    font-weight: 700;
    background-color: rgba(0,0,0,0.12);
    border-radius: 4px 4px 0 0;
}

/* Toggler styling (mobile) */
.navbar-toggler {
    border-color: rgba(255,255,255,0.7);
}

.navbar-toggler-icon {
    filter: brightness(1.2);
}

/* Dropdowns */
.dropdown-menu {
    border-radius: 6px;
    border: 1px solid #555;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
    background-color: #fff;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.dropdown-item {
    padding: 0.6rem 1.1rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    color: #000;
    font-size: 0.95rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: #f0f0f0;
    border-left: 3px solid #333;
    font-weight: 600;
    outline: none;
}

/* ============================================
   Mobile Header / Dropdown Behavior
   ============================================ */

@media (max-width: 991px) {
    .navbar.small-menu .navbar-nav {
        margin-top: 0.5rem !important;
    }

    .navbar.small-menu .nav-link {
        padding-top: 0.4rem !important;
        padding-bottom: 0.4rem !important;
        text-align: center;
    }

    .dropdown-menu {
        box-shadow: none;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .dropdown-item {
        text-align: center;
    }
}

/* ============================================
   PAGE TITLE
   ============================================ */
.sermons-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--tab-active);
    margin-top: 0;
}

.sermons-subtitle {
    color: var(--muted);
    font-size: 1rem;
}

/* ============================================
   MAIN TABS (Audio | Video)
   ============================================ */
.sermons-tabs {
    border-bottom: 2px solid #dee2e6;
}

.sermons-tabs .nav-link {
    color: var(--accent) !important;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.65rem 1.4rem;
    border-radius: 0.4rem 0.4rem 0 0;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sermons-tabs .nav-link:hover {
    background-color: rgba(11, 94, 215, 0.08);
    color: var(--tab-active) !important;
    transform: none;
}

.sermons-tabs .nav-link.active {
    background-color: #fff;
    color: var(--tab-active) !important;
    border-color: #dee2e6 #dee2e6 #fff;
    font-weight: 700;
}

[data-theme="dark"] .sermons-tabs .nav-link {
    color: #ccc !important;
}

[data-theme="dark"] .sermons-tabs .nav-link.active {
    background-color: var(--card-bg);
    color: #6ea8fe !important;
}

/* ============================================
   TAB CONTENT AREA
   ============================================ */
.sermons-tab-content {
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 0.4rem 0.4rem;
    padding: 1.5rem;
    background-color: var(--card-bg);
    min-height: 300px;
}

[data-theme="dark"] .sermons-tab-content {
    border-color: #444;
}

/* ============================================
   PREACHER PILLS (sub-tabs inside Audio)
   ============================================ */
.preacher-pills .nav-link {
    color: var(--accent) !important;
    background-color: transparent;
    border: 1px solid #ccc;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.4rem 1rem;
    margin: 0.25rem;
    transition: all 0.25s ease;
}

.preacher-pills .nav-link:hover {
    background-color: rgba(25, 135, 84, 0.1);
    border-color: var(--pill-active);
    color: var(--pill-active) !important;
    transform: none;
}

.preacher-pills .nav-link.active {
    background-color: var(--pill-active);
    border-color: var(--pill-active);
    color: #fff !important;
    font-weight: 700;
}

[data-theme="dark"] .preacher-pills .nav-link {
    color: #ccc !important;
    border-color: #555;
}

[data-theme="dark"] .preacher-pills .nav-link.active {
    background-color: #146c43;
    border-color: #146c43;
    color: #fff !important;
}

/* ============================================
   PREACHER HEADING
   ============================================ */
.preacher-heading {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--tab-active);
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #dee2e6;
}

/* ============================================
   MEDIA PLAYER CARD
   ============================================ */
.player-card {
    background-color: var(--player-bg);
    border-color: #ced4da !important;
}

audio {
    display: block;
    width: 100%;
    max-width: 90%;
    margin: 0 auto;
    border-radius: 0.3rem;
    outline: none;
}

.sermon-video {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 0.3rem;
    outline: none;
    object-fit: contain;
}

/* ============================================
   SERMON SELECT DROPDOWNS
   ============================================ */
.sermon-select-wrap {
    min-width: 220px;
}

.sermon-year-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.sermon-select {
    font-size: 0.875rem;
    width: 220px;
}

/* ============================================
   FOOTER
   ============================================ */
footer,
.footer-content {
    background-color: var(--footer-bg);
    background-image: linear-gradient(to bottom, #2c2c2c, #1a1a1a);
    color: var(--footer-text);
    padding-top: 2rem;
    padding-bottom: 0.5rem;
}

.footer-heading {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 3px solid #666;
    padding-bottom: 10px;
}

.footer-address,
.footer-contact,
.footer-text {
    color: #fff;
    line-height: 1.8;
    font-size: 0.95rem;
}

.footer-contact a,
.footer-links a,
.footer-social a {
    color: #fff !important;
    transition: all 0.3s ease;
}

.footer-links a:hover,
.footer-contact a:hover,
.footer-social a:hover {
    transform: scale(1.08);
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

/* Footer column spacing */
.footer-content .row > [class^="col-"],
.footer-content .row > [class*=" col-"] {
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .footer-content .row > [class^="col-"],
    .footer-content .row > [class*=" col-"] {
        margin-bottom: 0.5rem;
    }
}

/* Dark mode navbar adjustments */
[data-theme="dark"] .header-bg {
    background-color: var(--nav-bg);
    background-image: linear-gradient(to bottom, #0d63e0, #0b5ed7);
}

/* Dark mode footer adjustments */
[data-theme="dark"] footer,
[data-theme="dark"] .footer-content {
    background-color: var(--footer-bg);
    background-image: linear-gradient(to bottom, #0d63e0, #0b5ed7);
    color: var(--footer-text);
}

/* Dark mode heading styles */
[data-theme="dark"] .footer-heading {
    border-bottom-color: #555;
    color: var(--text);
}

/* Dark mode dropdown styles */
[data-theme="dark"] .dropdown-menu {
    background-color: var(--dropdown-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .dropdown-item {
    color: var(--dropdown-text);
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background-color: var(--dropdown-hover-bg);
    color: var(--dropdown-text);
}

.footer-divider {
    border-color: #444;
}

.footer-copyright {
    font-size: 0.875rem;
    color: #aaa;
    margin-bottom: 0;
}

.footer-copyright a {
    color: #aaa;
    text-decoration: underline;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.4rem;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 767.98px) {
    .sermons-title {
        font-size: 1.6rem;
    }

    .sermons-tab-content {
        padding: 1rem 0.75rem;
    }

    .sermon-select {
        width: 100%;
    }

    .sermon-select-wrap {
        width: 100%;
    }

    .preacher-pills .nav-link {
        font-size: 0.8rem;
        padding: 0.35rem 0.75rem;
    }
}

/* ============================================
   LIVE RECORDINGS — IFRAME PLAYER
   ============================================ */
.live-player-wrap {
    background-color: #000;
}

.live-iframe {
    border: none;
    width: 100%;
    height: 100%;
}

#livePlayerPrompt {
    background-color: var(--player-bg);
    font-size: 0.95rem;
    min-height: 180px;
}

/* ============================================
   LIVE RECORDINGS — VIDEO CARDS
   ============================================ */
.live-card {
    cursor: pointer;
    border-radius: 0.4rem;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background-color: var(--card-bg);
    border: 1px solid #dee2e6;
}

.live-card:hover,
.live-card:focus {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.15) !important;
    outline: 2px solid var(--tab-active);
    outline-offset: 2px;
}

.live-card-thumb {
    width: 100%;
    height: 144px;
    object-fit: cover;
    display: block;
}

.live-card-thumb-placeholder {
    width: 100%;
    height: 144px;
    background-color: #e9ecef;
    font-size: 2.25rem;
}

[data-theme="dark"] .live-card-thumb-placeholder {
    background-color: #2a2a2a;
}

.live-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Platform badges */
.live-badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    border-radius: 0.25rem;
    padding: 0.2em 0.5em;
}

.live-badge-yt {
    background-color: #ff0000;
    color: #fff;
}

.live-badge-fb {
    background-color: #1877f2;
    color: #fff;
}

[data-theme="dark"] .live-card {
    border-color: #444;
}

/* ============================================
   LIVE RECORDINGS — NOTIFICATION CARD (single featured video)
   ============================================ */
.live-notify-card {
    cursor: pointer;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}

.live-notify-card:hover,
.live-notify-card:focus {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2) !important;
    outline: 2px solid var(--tab-active);
    outline-offset: 2px;
}

.live-notify-thumb-wrap {
    position: relative;
}

.live-notify-thumb {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.live-notify-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.35);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.live-notify-card:hover .live-notify-play-overlay,
.live-notify-card:focus .live-notify-play-overlay {
    opacity: 1;
}

.live-notify-play-icon {
    font-size: 4rem;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}

.live-notify-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
}

.live-notify-date {
    color: var(--muted);
}

#livePlayerPrompt .live-prompt-text {
    color: var(--text);
}

/* ============================================
   LIVE RECORDINGS — SIDEBAR CARD LIST
   ============================================ */
.live-cards-sidebar {
    overflow-y: auto;
    max-height: 500px;
    padding-right: 0.25rem;
}

.live-cards-sidebar .live-notify-thumb {
    height: 140px;
}

.live-cards-sidebar .live-notify-play-icon {
    font-size: 2.5rem;
}

.live-cards-sidebar .live-notify-title {
    font-size: 0.9rem;
}

.live-cards-sidebar .card-body {
    padding: 0.6rem 0.75rem;
}

.live-cards-sidebar .live-card-thumb-placeholder {
    height: 140px;
    font-size: 2rem;
}

/* ============================================
   FACEBOOK EMBED CONTAINER
   ============================================ */
#facebookEmbedWrap {
    width: 100%;
    line-height: 0;
    overflow: hidden;
}

#facebookVideoDiv {
    width: 100%;
    line-height: 0;
    overflow: hidden;
}

#facebookVideoDiv iframe {
    display: block;
    width: 100%;
    border: none;
}

/* ============================================
   FACEBOOK VIDEO CARD (prompt / fallback overlay)
   ============================================ */
.fb-video-card {
    border-radius: 0.4rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background-color: #000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.fb-card-prompt {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background-color: var(--player-bg);
    color: var(--muted);
    padding: 2rem;
    text-align: center;
}

.fb-card-prompt-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.fb-card-thumb-link {
    display: block;
    text-decoration: none;
}

.fb-card-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #111;
    overflow: hidden;
}

.fb-card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.fb-card-thumb-link:hover .fb-card-thumb,
.fb-card-thumb-link:focus .fb-card-thumb {
    transform: scale(1.03);
}

.fb-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.35);
    transition: background 0.2s ease;
}

.fb-card-thumb-link:hover .fb-card-overlay,
.fb-card-thumb-link:focus .fb-card-overlay {
    background: rgba(0,0,0,0.50);
}

.fb-card-play {
    width: 64px;
    height: 64px;
    background-color: #1877f2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    padding-left: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fb-card-thumb-link:hover .fb-card-play,
.fb-card-thumb-link:focus .fb-card-play {
    transform: scale(1.12);
    box-shadow: 0 6px 22px rgba(0,0,0,0.55);
}

.fb-card-info {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
}

.fb-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.fb-watch-btn {
    background-color: #1877f2;
    color: #fff;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.fb-watch-btn:hover,
.fb-watch-btn:focus {
    background-color: #1464d8;
    color: #fff;
    transform: translateY(-1px);
}

/* ============================================
   Navbar Social Icons
   ============================================ */
.navbar-social {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
}

.navbar-social a {
    color: #fff !important;
    font-size: 1.1rem;
    line-height: 1;
    transition: transform 0.25s ease;
    text-decoration: none;
}

.navbar-social a:hover,
.navbar-social a:focus {
    transform: scale(1.2);
    outline: none;
}

/* ============================================
   Give Button - Navbar
   ============================================ */
.btn-give {
    background-color: #996633;
    border: 2px solid #fff;
    color: #fff !important;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.3rem 0.85rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    text-decoration: none;
    margin-left: 0.5rem;
    white-space: nowrap;
}

.btn-give:hover,
.btn-give:focus {
    background-color: #7a4d26;
    border-color: #fff;
    transform: scale(1.08);
    /* Enhanced focus indicator for 508c compliance */
    outline: 3px solid rgba(255,255,255,0.8);
    outline-offset: 2px;
}

/* Dark mode adjustments for give button - maintain brand consistency and 508c compliance */
[data-theme="dark"] .btn-give {
    background-color: #996633;
    color: #fff !important;
    border: 2px solid #fff;
}

[data-theme="dark"] .btn-give:hover,
[data-theme="dark"] .btn-give:focus {
    background-color: #b8773d;
    color: #fff !important;
    border-color: #fff;
    /* Enhanced focus indicator for 508c compliance */
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* ============================================
   Footer Social Icon Size
   ============================================ */
.footer-social a {
    font-size: 1.4rem;
    margin-right: 0.75rem;
}
