/* ============================================
   Church Management System - Main Stylesheet
   ============================================ */

/* ===== General ===== */
:root {
    --primary: #667eea;
    --primary-dark: #764ba2;
    --secondary: #2d3561;
    --gold: #d4a843;
    --light-bg: #f8f9fa;
}

body {
    font-family: 'Inter', sans-serif;
    color: #333;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
}

.section-title {
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 2px;
}

/* ===== Landing Page Navbar ===== */
#mainNav {
    background: transparent;
    padding: 16px 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
}

#mainNav.navbar-scrolled {
    background: linear-gradient(135deg, var(--secondary) 0%, #1a1f3d 100%) !important;
    padding: 8px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

#mainNav .navbar-brand {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: #fff !important;
}

.nav-brand-text {
    max-width: 260px;
    display: inline-block;
    vertical-align: middle;
    font-size: 1rem;
}

#mainNav .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 14px !important;
    transition: all 0.3s ease;
    border-radius: 6px;
    position: relative;
}

#mainNav .nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1);
}

#mainNav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 14px;
    right: 14px;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    border-radius: 1px;
}

#mainNav .nav-link:hover::after {
    transform: scaleX(1);
}

/* Mobile nav */
@media (max-width: 991.98px) {
    #mainNav {
        background: linear-gradient(135deg, var(--secondary) 0%, #1a1f3d 100%) !important;
        padding: 10px 0;
    }
    #mainNav .navbar-collapse {
        background: linear-gradient(135deg, var(--secondary) 0%, #1a1f3d 100%);
        margin-top: 12px;
        border-radius: 12px;
        padding: 16px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    }
    #mainNav .nav-link {
        padding: 12px 16px !important;
        border-radius: 8px;
    }
    #mainNav .nav-link:hover {
        background: rgba(255,255,255,0.1);
    }
    .nav-brand-text {
        max-width: 140px;
    }
}

/* ===== Hero Section ===== */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, #2d3561 100%);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.05)" d="M0,96L48,112C96,128,192,160,288,186.7C384,213,480,235,576,213.3C672,192,768,128,864,128C960,128,1056,192,1152,213.3C1248,235,1344,213,1392,202.7L1440,192L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"/></svg>') no-repeat bottom;
    background-size: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, transparent 0%, rgba(0, 0, 0, 0.2) 100%);
}

.hero-title {
    text-shadow: 2px 4px 10px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.hero-subtitle {
    text-shadow: 1px 2px 5px rgba(0, 0, 0, 0.2);
}

/* ===== About Section ===== */
.about-icon-wrapper {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-feature-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 15px;
}

.about-feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Gallery Section */
.gallery-item {
    cursor: pointer;
    overflow: hidden;
    aspect-ratio: 4/3;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.gallery-item:hover img {
    transform: scale(1.08);
}

/* ===== Schedule Section ===== */
.schedule-section {
    background: linear-gradient(135deg, var(--secondary) 0%, #1a1f3d 100%);
}

.schedule-card {
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.schedule-card:hover {
    transform: translateY(-5px);
}

.schedule-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* ===== Contact Section ===== */
.contact-card {
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-3px);
}

/* ===== Footer ===== */
.footer-section {
    background: linear-gradient(135deg, var(--secondary) 0%, #1a1f3d 100%);
}

.footer-section a:hover {
    opacity: 0.8;
}

/* ===== Admin Panel Styles ===== */
.stat-card {
    transition: transform 0.2s ease;
    border-radius: 12px;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
}

/* Cards */
.card {
    border-radius: 12px;
}

.card-header {
    border-radius: 12px 12px 0 0;
}

/* Tables */
.table thead th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody td {
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4290 100%);
}

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 10px 15px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 20px;
}

/* Pagination */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 3px;
    color: var(--primary);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    #mainNav .navbar-brand {
        font-size: 1rem;
    }
    
    .stat-card h2 {
        font-size: 1.5rem;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Alerts */
.alert {
    border-radius: 10px;
    border: none;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Login page specific */
.login-card {
    border: none;
}

/* ===== Admin Sidebar Layout ===== */
.admin-body {
    overflow-x: hidden;
    background: #f0f2f5;
}

.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, #1a1f3d 0%, #2d3561 100%);
    color: #fff;
    z-index: 1040;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 14px 20px;
    font-family: 'Playfair Display', serif;
    font-size: 0.92rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: flex-start;
    line-height: 1.3;
    min-height: 52px;
}

.sidebar-brand i {
    color: var(--primary);
}

.sidebar-brand-text {
    /* Allow wrapping up to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.sidebar-menu {
    padding: 10px 0;
}

.sidebar-section-title {
    padding: 14px 20px 8px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.75);
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.sidebar-section-title span i {
    margin-right: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #fff;
    text-decoration: none;
    font-size: 0.98rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.sidebar-link i {
    width: 28px;
    text-align: center;
    margin-right: 12px;
    font-size: 1.1rem;
    color: #d8ddf5;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.sidebar-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.15);
    border-left-color: rgba(255,255,255,0.5);
}

.sidebar-link:hover i {
    color: #fff;
}

.sidebar-link.active {
    color: #fff;
    background: rgba(102, 126, 234, 0.35);
    border-left-color: #8fa4f0;
    border-left-width: 4px;
    font-weight: 700;
}

.sidebar-link.active i {
    color: #b8c4f7;
}

/* Topbar */
.admin-topbar {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    height: 56px;
    background: #fff;
    border-bottom: 1px solid #e3e6f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1030;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.sidebar-toggle {
    padding: 6px 10px;
    font-size: 1.25rem;
    color: #2d3561 !important;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: none !important;
    text-decoration: none !important;
}

.sidebar-toggle:hover {
    color: var(--primary) !important;
    background: rgba(102, 126, 234, 0.1);
}

/* App Navbar & Landing Toggler - white icon on dark background */
.app-navbar .navbar-toggler,
#mainNav .navbar-toggler {
    border-color: rgba(255,255,255,0.5);
    padding: 6px 10px;
}

.app-navbar .navbar-toggler-icon,
#mainNav .navbar-toggler-icon {
    filter: brightness(0) invert(1);
}

.app-navbar .fa-bars,
#mainNav .fa-bars {
    color: #fff;
    font-size: 1.25rem;
}

/* Main Content */
.admin-main {
    margin-left: 260px;
    margin-top: 56px;
    padding: 24px;
    min-height: calc(100vh - 56px);
}

/* Footer */
.admin-footer {
    margin-left: 260px;
    border-top: 1px solid #e3e6f0;
    background: #fff;
}

/* Overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
}

.sidebar-overlay.show {
    display: block;
}

/* Mobile responsive */
@media (max-width: 991.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.show {
        transform: translateX(0);
    }
    .admin-topbar {
        left: 0;
    }
    .admin-main {
        margin-left: 0 !important;
    }
    .admin-footer {
        margin-left: 0 !important;
    }
}

/* Scrollbar for sidebar */
.admin-sidebar::-webkit-scrollbar {
    width: 4px;
}
.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}

/* Dropdown styles */
.dropdown-menu {
    border-radius: 10px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.3s ease;
}

/* Text purple utility */
.text-purple {
    color: var(--primary-dark);
}