/* assets/css/style.css */
:root {
    --primary: #1a5c3e;
    --primary-dark: #0f3d28;
    --primary-light: #2b8c5e;
    --primary-bg: #e8f5ee;
    --secondary: #8B1E2B;
    --accent: #D4A74A;
    --text-dark: #0b1a2b;
    --text-muted: #475569;
    --bg-light: #f8fafc;
    --white: #ffffff;
    --shadow: 0 8px 30px rgba(0,0,0,0.08);
    --radius: 24px;
    --transition: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Top Bar */
.top-bar {
    background: var(--primary-dark);
    color: #94a3b8;
    font-size: 0.85rem;
    padding: 8px 0;
    display: none;
}

.top-bar-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.top-bar-flex .separator {
    margin: 0 10px;
    opacity: 0.3;
}

.top-bar-flex .social-icon {
    color: #94a3b8;
    margin-left: 12px;
    transition: var(--transition);
}

.top-bar-flex .social-icon:hover {
    color: white;
}

.service-time {
    margin-right: 16px;
}

/* Navbar */
.navbar {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.04);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(226,232,240,0.6);
}

.nav-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.3rem;
    text-decoration: none;
    color: var(--text-dark);
}

.logo span {
    background: linear-gradient(145deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-divider {
    -webkit-text-fill-color: var(--text-muted);
    font-weight: 300;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-dark);
    transition: var(--transition);
    border-bottom: 2px solid transparent;
    padding-bottom: 4px;
}

.nav-links a:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.nav-cta {
    background: var(--primary);
    color: white !important;
    padding: 8px 20px;
    border-radius: 100px;
    border-bottom: none !important;
    font-weight: 600;
}

.nav-cta:hover {
    background: var(--primary-dark);
    transform: scale(0.98);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-user span {
    font-weight: 500;
    color: var(--primary);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
}

/* Hero */
.hero {
    padding: 60px 0;
    background: linear-gradient(135deg, var(--primary-bg) 0%, var(--white) 80%);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.hero-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 6px 20px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.hero h1 {
    font-size: 3.2rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.hero h1 .highlight {
    color: var(--primary);
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 520px;
    margin-bottom: 28px;
}

.stats-group {
    display: flex;
    gap: 48px;
}

.stats-group .stat {
    display: flex;
    flex-direction: column;
}

.stats-group .stat strong {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-dark);
}

.stats-group .stat span {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.hero-image {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    box-shadow: var(--shadow);
}

.hero-image img {
    max-width: 100%;
    max-height: 200px;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 32px;
    border: 1px solid #edf2f7;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 48px 0 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title i {
    color: var(--primary);
}

/* Department Grid */
.dept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin: 24px 0 48px;
}

.dept-card {
    background: var(--white);
    padding: 24px 16px;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid #edf2f7;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
}

.dept-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
    box-shadow: 0 12px 30px rgba(26,92,62,0.12);
}

.dept-card i {
    font-size: 2rem;
    color: var(--primary);
    display: block;
    margin-bottom: 10px;
}

.dept-card .dept-icon {
    font-size: 2.2rem;
    display: block;
    margin-bottom: 8px;
}

/* Member Grid */
.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin: 24px 0 40px;
}

.member-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px 16px;
    border: 1px solid #edf2f7;
    text-align: center;
    transition: var(--transition);
}

.member-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.member-card .avatar {
    background: var(--primary-bg);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 2rem;
    color: var(--primary);
}

.member-card .role-tag {
    font-size: 0.7rem;
    background: var(--primary-bg);
    padding: 2px 14px;
    border-radius: 40px;
    display: inline-block;
    color: var(--primary);
    font-weight: 600;
    margin-top: 4px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(26,92,62,0.1);
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border: none;
    border-radius: 60px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: scale(0.98);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* Membership Search */
.membership-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    margin: -30px auto 40px;
    max-width: 800px;
    box-shadow: var(--shadow);
}

.search-box {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.search-box input {
    flex: 1;
    padding: 14px 20px;
    border: 1.5px solid #e2e8f0;
    border-radius: 60px;
    font-size: 1rem;
    min-width: 200px;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(26,92,62,0.1);
}

/* Discussion / Bulletin */
.feed-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 24px 0 48px;
}

.feed-item {
    border-bottom: 1px solid #f1f5f9;
    padding: 16px 0;
}

.feed-item:last-child {
    border-bottom: none;
}

.feed-item .meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    gap: 16px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.badge {
    padding: 2px 12px;
    border-radius: 40px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* Admin Dashboard */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid #edf2f7;
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Footer */
.footer {
    background: var(--primary-dark);
    color: #cbd5e1;
    padding: 48px 0 24px;
    margin-top: 60px;
    border-radius: 40px 40px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
}

.footer h5 {
    color: white;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer a {
    color: #94a3b8;
    text-decoration: none;
    display: block;
    margin: 6px 0;
    transition: var(--transition);
}

.footer a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 14px;
    font-size: 1.4rem;
    margin-top: 16px;
}

.social-links a {
    color: #94a3b8;
}

.social-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #1e2f41;
    margin-top: 32px;
    padding-top: 24px;
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
}

/* Login Page */
.login-container {
    max-width: 440px;
    margin: 60px auto;
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
}

.login-container h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.login-container .subtitle {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.login-container .error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
}

/* Responsive */
@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .hero h1 {
        font-size: 2.5rem;
    }
    .feed-grid {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 16px 0;
        gap: 12px;
    }
    .nav-links.active {
        display: flex;
    }
    .nav-user {
        flex-wrap: wrap;
        justify-content: center;
    }
    .top-bar {
        display: none;
    }
    .stats-group {
        gap: 24px;
        flex-wrap: wrap;
    }
    .membership-card {
        padding: 24px;
    }
    .dept-grid {
        grid-template-columns: 1fr 1fr;
    }
    .member-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .dept-grid {
        grid-template-columns: 1fr;
    }
    .member-grid {
        grid-template-columns: 1fr;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .search-box {
        flex-direction: column;
    }
}

/* ============================================
   SERMON CARD STYLES
   ============================================ */

.sermon-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid #edf2f7;
    transition: var(--transition);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sermon-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}

.sermon-thumbnail {
    position: relative;
    background: #1a1a2e;
    width: 100%;
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
}

.sermon-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sermon-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-size: 3rem;
}

.sermon-duration {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
}

.sermon-department-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 2;
    max-width: calc(100% - 24px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sermon-details {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sermon-details h4 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    line-height: 1.4;
    max-height: 2.8em; /* 2 lines × line-height */
    overflow: hidden;
    text-overflow: ellipsis;
    /* This creates a pseudo-element for ellipsis on multi-line text */
    display: block;
    word-wrap: break-word;
    /* For Firefox and others that support it */
    display: -moz-box;
    -moz-box-orient: vertical;
    -moz-line-clamp: 2;
}

.sermon-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 12px;
    line-height: 1.5;
    max-height: 3em; /* 2 lines × line-height */
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    word-wrap: break-word;
    display: -moz-box;
    -moz-box-orient: vertical;
    -moz-line-clamp: 2;
}

.sermon-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 4px 0;
}

.sermon-meta i {
    width: 18px;
    color: var(--primary);
}

.sermon-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.sermons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin: 24px 0;
}

.sermons-grid-all {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin: 24px 0;
}

/* ============================================
   TESTIMONIALS STYLES
   ============================================ */

.testimonials-section {
    padding: 60px 0;
    background: var(--bg-light);
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.testimonial-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 32px 28px;
    border: 1px solid #edf2f7;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}

.testimonial-card .fa-quote-left {
    margin-bottom: 12px;
}

.testimonial-card p {
    color: var(--text-dark);
    font-style: italic;
    line-height: 1.8;
    margin: 0 0 20px;
    flex: 1;
    font-size: 1.05rem;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.testimonial-author strong {
    display: block;
    font-size: 1rem;
}

.testimonial-author span {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Lazy Loading Images */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.loaded {
    opacity: 1;
}

/* ============================================
   EVENTS STYLES
   ============================================ */

.events-section {
    padding: 60px 0;
    background: var(--bg-light);
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.event-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    gap: 20px;
    box-shadow: var(--shadow);
    border: 1px solid #edf2f7;
    transition: var(--transition);
}

.event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}

.event-date {
    text-align: center;
    background: var(--primary);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    min-width: 60px;
    flex-shrink: 0;
    align-self: flex-start;
}

.event-date .day {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
}

.event-date .month {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.event-details h4 {
    margin: 0 0 8px;
    font-size: 1.1rem;
}

.event-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 4px 0;
}

.event-info i {
    width: 16px;
    color: var(--primary);
}

.event-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 8px 0;
    line-height: 1.5;
}

.event-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.event-link:hover {
    gap: 8px;
}

/* Section Header */
.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-tag {
    display: inline-block;
    background: var(--primary-bg);
    color: var(--primary);
    padding: 4px 16px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.section-header h2 {
    font-size: 2.2rem;
    font-weight: 700;
}

.section-header h2 .highlight {
    color: var(--primary);
}

.section-header p {
    color: var(--text-muted);
    max-width: 500px;
    margin: 8px auto 0;
}

/* Responsive for new sections */
@media (max-width: 768px) {
    .events-grid {
        grid-template-columns: 1fr;
    }
    
    .event-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .event-date {
        align-self: center;
    }
}

@media (max-width: 480px) {
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .testimonial-card {
        padding: 20px 16px;
    }
}