/* ========== BASE STYLES (Used on all pages) ========== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #dad3d3;
    color: #333;
}

/* Disable right-click and dragging on all images and videos */
img, video {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    -webkit-touch-callout: none;
}

/* Re-enable pointer events for logo to make it clickable */
.logo-container img {
    pointer-events: auto;
}

/* Default image fallback - handled by JavaScript */
/* This CSS provides a background fallback for broken images */
img[data-default-image] {
    background-image: url('images/logo/church-logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* ========== TOP BAR ========== */
.top-bar {
    background: white;
    color: #1e3c72;
    padding: 0.5rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1001;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.top-bar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
}

.top-bar-left {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.top-bar-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.faith-statement {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e3c72;
    text-align: center;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.top-bar-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.datetime-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.datetime-info .icon-svg {
    color: #6495ED;
    stroke: #6495ED;
    min-width: 16px;
}

.datetime-info .separator {
    margin: 0 0.5rem;
    opacity: 0.5;
}

.datetime-info .timezone {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* ========== HEADER ========== */
header {
    background: transparent;
    padding: 1.5rem 0;
    position: fixed;
    width: 100%;
    top: 40px;
    z-index: 1001;
    transition: all 0.3s ease;
}

header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: 0 2px 20px rgba(100, 149, 237, 0.2);
}

/* Header solid for non-homepage */
header.solid {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(100, 149, 237, 0.2);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.logo-container:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.logo-img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    transition: all 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: 500;
}

.nav-links a.active {
    background: #6495ED;
    color: white;
}

header.scrolled .nav-links a,
header.solid .nav-links a {
    color: #1e3c72;
}

header.scrolled .nav-links a.active,
header.solid .nav-links a.active {
    background: #6495ED;
    color: white;
}

.nav-links a:hover {
    background: #6495ED;
    color: white;
    transform: translateY(-2px);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    background: rgba(255, 255, 255, 0.98);
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(100, 149, 237, 0.3);
    z-index: 1;
    border-radius: 5px;
    margin-top: 0.5rem;
}

.dropdown-content a {
    color: #1e3c72 !important;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-radius: 5px;
}

.dropdown-content a:hover {
    background: #6495ED;
    color: white !important;
}

/* Desktop dropdown - hover functionality */
@media (min-width: 769px) {
    .dropdown:hover .dropdown-content {
        display: block;
    }
    
    /* Ensure dropdown doesn't interfere with hover on desktop */
    .dropdown.active .dropdown-content {
        display: block;
    }
}

.dropbtn {
    cursor: pointer;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    cursor: pointer;
    justify-content: center;
    align-items: center;
    width: 35px;
    height: 35px;
    position: relative;
    z-index: 1002;
    padding: 5px;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.mobile-menu:hover {
    background: rgba(100, 149, 237, 0.1);
}

.mobile-menu span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: all 0.2s ease;
    transform-origin: center;
    border-radius: 3px;
    display: block;
}

header.scrolled .mobile-menu span,
header.solid .mobile-menu span {
    background: #1e3c72;
}

/* Hamburger to X Animation - Simplified */
.mobile-menu.active {
    background: rgba(100, 149, 237, 0.15);
}

.mobile-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
    background: #6495ED;
}

.mobile-menu.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
    background: #6495ED;
}

/* Mobile Menu Overlay - Simplified */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

/* ========== COMMON SECTIONS ========== */
.section-padding {
    padding: 5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.page-header {
    background: linear-gradient(135deg, #1e3c72 0%, #6495ED 100%);
    color: white;
    padding: 8rem 2rem 4rem;
    text-align: center;
    margin-top: 40px;
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.page-header p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
}

section h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: #1e3c72;
}

/* Cards */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(100, 149, 237, 0.2);
    transition: all 0.3s;
    border-top: 5px solid #6495ED;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(100, 149, 237, 0.4);
}

.card h3 {
    color: #1e3c72;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.contact-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: #6495ED;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}

.contact-link:hover {
    color: #1e3c72;
    text-decoration: underline;
}

/* Email Button */
.btn-contact {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #1e3c72 0%, #6495ED 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(100, 149, 237, 0.3);
}

.btn-contact:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(100, 149, 237, 0.5);
    background: linear-gradient(135deg, #6495ED 0%, #1e3c72 100%);
}

/* ========== FOOTER ========== */
footer {
    background: linear-gradient(135deg, #1e3c72 0%, #6495ED 100%);
    color: white;
    padding: 3rem 2rem 1rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section p {
    line-height: 1.8;
    opacity: 0.9;
}

.footer-section a {
    display: block;
    color: white;
    text-decoration: none;
    margin: 0.5rem 0;
    opacity: 0.9;
    transition: 0.3s;
}

.footer-section a:hover {
    opacity: 1;
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.footer-bottom p {
    margin: 0.5rem 0;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .page-header h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    /* Top Bar Mobile */
    .top-bar {
        padding: 0.5rem 0;
        min-height: auto;
    }

    .top-bar-content {
        padding: 0 1rem;
        grid-template-columns: 1fr;
        gap: 0.5rem;
        align-items: center;
    }

    .top-bar-left,
    .top-bar-center,
    .top-bar-right {
        width: 100%;
        justify-content: center;
        align-items: center;
    }

    .top-bar-center {
        order: -1; /* Show faith statement first on mobile */
        padding: 0.25rem 0;
        border-bottom: 1px solid rgba(30, 60, 114, 0.1);
        margin-bottom: 0.25rem;
    }

    .faith-statement {
        font-size: 0.85rem;
        white-space: normal;
        line-height: 1.4;
        text-align: center;
        padding: 0.25rem 0.5rem;
        word-break: break-word;
    }

    .top-bar-left,
    .top-bar-right {
        padding: 0.15rem 0;
    }

    .datetime-info {
        font-size: 0.75rem;
        gap: 0.4rem;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
    }

    .datetime-info .icon-svg {
        width: 14px;
        height: 14px;
        min-width: 14px;
        flex-shrink: 0;
    }

    .datetime-info .separator {
        margin: 0 0.4rem;
        opacity: 0.5;
    }

    .datetime-info .timezone {
        font-size: 0.7rem;
        opacity: 0.85;
        white-space: nowrap;
    }

    .datetime-info span {
        white-space: nowrap;
        line-height: 1.4;
    }

    /* Header Mobile */
    header {
        top: 35px;
        padding: 1rem 0;
        z-index: 1001;
    }

    header.scrolled {
        padding: 0.75rem 0;
    }

    header.solid {
        padding: 0.75rem 0;
    }

    nav {
        padding: 0 1rem;
        position: relative;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Center logo on mobile */
    .logo-container {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1002;
    }

    .logo-img {
        width: 50px;
        height: 50px;
        max-height: 50px;
    }

    /* Position hamburger menu on the right */
    .mobile-menu {
        margin-left: auto;
        z-index: 1002;
        position: relative;
    }

    /* Mobile Menu Overlay */
    .mobile-menu-overlay {
        display: block;
    }

    .nav-links {
        position: fixed;
        right: -100%;
        top: 85px;
        bottom: 0;
        flex-direction: column;
        background: #ffffff;
        width: 100%;
        max-width: 320px;
        text-align: left;
        transition: right 0.25s ease;
        padding: 2rem 1.5rem;
        gap: 0.5rem;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
        border-radius: 0;
        z-index: 1000;
        overflow-y: auto;
        overflow-x: hidden;
        will-change: right, top;
    }

    .nav-links::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 4px;
        height: 100%;
        background: linear-gradient(135deg, #1e3c72 0%, #6495ED 100%);
    }

    .nav-links li {
        width: 100%;
        list-style: none;
        margin: 0;
    }

    .nav-links a {
        color: #1e3c72 !important;
        padding: 1rem 1.25rem;
        font-size: 1rem;
        width: 100%;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        border-radius: 8px;
        transition: background 0.15s ease, color 0.15s ease;
        font-weight: 500;
        position: relative;
        margin-bottom: 0.25rem;
    }

    .nav-links a::after {
        content: '→';
        margin-left: auto;
        opacity: 0;
        transition: opacity 0.15s ease;
        color: #6495ED;
        font-size: 1.2rem;
    }

    .nav-links a:hover::after,
    .nav-links a.active::after {
        opacity: 1;
    }

    .nav-links a::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 60%;
        background: #6495ED;
        border-radius: 0 5px 5px 0;
        transition: width 0.15s ease;
    }

    .nav-links a:hover,
    .nav-links a.active {
        background: rgba(100, 149, 237, 0.1);
        color: #6495ED !important;
    }

    .nav-links a:hover::before,
    .nav-links a.active::before {
        width: 4px;
    }

    .nav-links a.active {
        font-weight: 600;
        color: #1e3c72 !important;
    }

    .nav-links.active {
        right: 0;
    }

    .dropdown {
        width: 100%;
    }

    .dropbtn {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .dropbtn::after {
        content: '▾';
        font-size: 1.2rem;
        transition: transform 0.2s ease;
        color: #6495ED;
    }

    .dropdown.active .dropbtn::after {
        transform: rotate(180deg);
    }

    .dropdown-content {
        position: static;
        display: none;
        box-shadow: none;
        margin-top: 0.5rem;
        margin-left: 1.5rem;
        background: rgba(240, 248, 255, 0.95);
        border-radius: 8px;
        padding: 0.75rem 0;
        border-left: 3px solid #6495ED;
    }

    .dropdown.active .dropdown-content {
        display: block;
    }

    .dropdown-content a {
        padding: 0.75rem 1.5rem !important;
        font-size: 0.9rem !important;
        color: #1e3c72 !important;
        border-radius: 8px;
        margin: 0.25rem 0.5rem;
        transition: background 0.15s ease, color 0.15s ease;
        position: relative;
        padding-left: 2.5rem !important;
    }

    .dropdown-content a::before {
        content: '▸';
        position: absolute;
        left: 1.5rem;
        color: #6495ED;
    }

    .dropdown-content a:hover {
        background: rgba(100, 149, 237, 0.15) !important;
        color: #6495ED !important;
    }

    .mobile-menu {
        display: flex;
        position: relative;
    }

    .page-header {
        margin-top: 35px;
        padding: 6rem 1.5rem 3rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .page-header p {
        font-size: 1rem;
    }

    section h2 {
        font-size: 2rem;
    }

    /* Cards Mobile */
    .cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .card {
        padding: 1.5rem;
    }

    .card h3 {
        font-size: 1.3rem;
    }

    .card p {
        font-size: 0.9rem;
    }

    .card-icon {
        font-size: 2.5rem;
    }

    /* Section Padding Mobile */
    .section-padding {
        padding: 3rem 1rem;
    }

    /* Buttons Mobile */
    .btn {
        width: 100%;
        text-align: center;
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }

    .btn-contact {
        width: 100%;
        display: block;
    }

    /* Footer Mobile */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .footer-section {
        margin-bottom: 1.5rem;
    }

    .footer-section h4 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }

    .footer-section p,
    .footer-section a {
        font-size: 0.9rem;
    }

    /* Contact Links Mobile */
    .contact-link {
        display: block;
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }

    /* Content Sections Mobile */
    .content-section {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }

    .content-text h3 {
        font-size: 1.5rem;
    }

    .content-text p {
        font-size: 0.95rem;
    }

    .content-image {
        order: -1;
        max-width: 100%;
    }

    .content-image img {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    /* Top Bar Small Mobile */
    .top-bar {
        padding: 0.4rem 0;
        min-height: auto;
    }

    .top-bar-content {
        padding: 0 0.75rem;
        grid-template-columns: 1fr;
        gap: 0.4rem;
        align-items: center;
    }

    .top-bar-left,
    .top-bar-center,
    .top-bar-right {
        width: 100%;
        justify-content: center;
        align-items: center;
    }

    .top-bar-center {
        order: -1;
        padding: 0.2rem 0;
        border-bottom: 1px solid rgba(30, 60, 114, 0.1);
        margin-bottom: 0.2rem;
    }

    .faith-statement {
        font-size: 0.75rem;
        white-space: normal;
        line-height: 1.3;
        text-align: center;
        padding: 0.2rem 0.5rem;
        word-break: break-word;
    }

    .top-bar-left,
    .top-bar-right {
        padding: 0.1rem 0;
    }

    .datetime-info {
        font-size: 0.7rem;
        gap: 0.3rem;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
    }

    .datetime-info .icon-svg {
        width: 12px;
        height: 12px;
        min-width: 12px;
        flex-shrink: 0;
    }

    .datetime-info .separator {
        margin: 0 0.3rem;
        opacity: 0.5;
    }

    .datetime-info .timezone {
        font-size: 0.65rem;
        opacity: 0.85;
        white-space: nowrap;
    }

    .datetime-info span {
        white-space: nowrap;
        line-height: 1.3;
        font-size: 0.7rem;
    }

    /* Header Small Mobile */
    header {
        top: 32px;
        padding: 0.75rem 0;
        z-index: 1001;
    }

    header.scrolled {
        padding: 0.5rem 0;
    }

    header.solid {
        padding: 0.5rem 0;
    }

    nav {
        padding: 0 0.75rem;
        position: relative;
    }

    /* Center logo on small mobile */
    .logo-container {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1002;
    }

    .logo-img {
        width: 50px;
        height: 50px;
        max-height: 50px;
    }

    /* Position hamburger menu on the right */
    .mobile-menu {
        margin-left: auto;
        z-index: 1002;
    }

    .nav-links {
        top: 80px;
        padding: 1.5rem 1rem;
        max-width: 100%;
        border-radius: 0;
        transition: right 0.25s ease;
        will-change: right, top;
    }

    /* Adjust menu position when header is scrolled on small mobile */
    header.scrolled ~ * .nav-links,
    header.scrolled .nav-links {
        top: 72px;
    }

    header.solid ~ * .nav-links,
    header.solid .nav-links {
        top: 72px;
    }

    .nav-links a {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }

    .nav-links a::after {
        font-size: 1rem;
    }

    .dropdown-content a {
        padding: 0.65rem 1.25rem 0.65rem 2.25rem !important;
        font-size: 0.85rem !important;
    }

    .dropdown-content a::before {
        left: 1.25rem;
    }

    .page-header {
        margin-top: 32px;
        padding: 5rem 1rem 2.5rem;
    }

    .page-header h1 {
        font-size: 1.75rem;
    }

    .page-header p {
        font-size: 0.9rem;
    }

    /* Enhanced Mobile Styles */
    .section-padding {
        padding: 2rem 0.75rem;
    }

    .cards {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .card {
        padding: 1.25rem;
    }

    .card h3 {
        font-size: 1.2rem;
    }

    .card p {
        font-size: 0.85rem;
    }

    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    section h2 {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }
}