/* ============================================
   ChurchLinkUp.com — Main Stylesheet
   CSS Custom Properties + Component Styles
   ============================================ */

/* ---- CSS CUSTOM PROPERTIES (Light Theme) ---- */
:root {
    --clu-primary: #6a3de8;
    --clu-primary-hover: #5630c0;
    --clu-primary-light: #ede7fb;
    --clu-primary-rgb: 106, 61, 232;
    --clu-secondary: #f59e0b;
    --clu-accent: #10b981;
    --clu-danger: #ef4444;

    --clu-bg: #f8f9fc;
    --clu-bg-card: #ffffff;
    --clu-bg-card-hover: #f3f0ff;
    --clu-bg-nav: rgba(255, 255, 255, 0.95);
    --clu-bg-footer: #f1f1f4;
    --clu-bg-input: #ffffff;

    --clu-text: #1a1a2e;
    --clu-text-secondary: #6b7280;
    --clu-text-muted: #9ca3af;
    --clu-text-link: var(--clu-primary);

    --clu-border: #e5e7eb;
    --clu-border-light: #f3f4f6;

    --clu-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --clu-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --clu-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
    --clu-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);

    --clu-radius-sm: 6px;
    --clu-radius: 10px;
    --clu-radius-lg: 16px;
    --clu-radius-xl: 24px;
    --clu-radius-full: 9999px;

    --clu-transition: 0.2s ease;
    --clu-transition-slow: 0.3s ease;

    --clu-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --clu-font-size-base: 0.9375rem;
    --clu-line-height: 1.6;
    --clu-navbar-height: 60px;
}


/* ---- BASE ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--clu-font);
    font-size: var(--clu-font-size-base);
    line-height: var(--clu-line-height);
    color: var(--clu-text);
    background: var(--clu-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

main.container { flex: 1; }

a { color: var(--clu-text-link); text-decoration: none; transition: color var(--clu-transition); }
a:hover { color: var(--clu-primary-hover); }

img { max-width: 100%; height: auto; }

::selection { background: var(--clu-primary-light); color: var(--clu-primary); }


/* ---- NAVBAR ---- */
.clu-navbar {
    background: var(--clu-bg-nav);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--clu-border-light);
    box-shadow: var(--clu-shadow-sm);
    min-height: var(--clu-navbar-height);
    z-index: 1030;
}

.clu-navbar .navbar-brand {
    font-weight: 700;
    color: var(--clu-primary);
    font-size: 1.15rem;
}

.clu-navbar .brand-text {
    background: linear-gradient(135deg, var(--clu-primary), #9333ea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.clu-navbar .nav-link {
    color: var(--clu-text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--clu-radius-sm);
    transition: all var(--clu-transition);
    position: relative;
}

.clu-navbar .nav-link:hover {
    color: var(--clu-primary);
    background: var(--clu-primary-light);
}

/* Active nav link — bold text + bottom indicator bar */
.clu-navbar .nav-link.active {
    color: var(--clu-primary);
    font-weight: 600;
    background: var(--clu-primary-light);
}

.clu-navbar .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: var(--clu-primary);
    border-radius: 3px 3px 0 0;
}

/* Active dropdown item — left accent bar + subtle bg */
.clu-navbar .dropdown-item.active {
    background: var(--clu-primary-light);
    color: var(--clu-primary);
    font-weight: 600;
    position: relative;
    padding-left: 1rem;
}

.clu-navbar .dropdown-item.active::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--clu-primary);
    border-radius: 3px;
}

.clu-navbar .dropdown-menu {
    border: 1px solid var(--clu-border);
    border-radius: var(--clu-radius);
    box-shadow: var(--clu-shadow-lg);
    padding: 0.25rem;
}

.clu-navbar .dropdown-item {
    border-radius: var(--clu-radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.clu-navbar .dropdown-item:hover {
    background: var(--clu-primary-light);
    color: var(--clu-primary);
}

.notification-badge { font-size: 0.65rem; min-width: 18px; padding: 2px 5px; }
.notification-dropdown { border-radius: var(--clu-radius) !important; }
.logo-dark { display: none; }


/* ---- BUTTONS ---- */
.btn {
    border-radius: var(--clu-radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    transition: all var(--clu-transition);
}

.btn-primary {
    background: var(--clu-primary);
    border-color: var(--clu-primary);
}

.btn-primary:hover, .btn-primary:focus {
    background: var(--clu-primary-hover);
    border-color: var(--clu-primary-hover);
    box-shadow: 0 4px 12px rgba(var(--clu-primary-rgb), 0.3);
    transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-outline-primary {
    color: var(--clu-primary);
    border-color: var(--clu-primary);
}

.btn-outline-primary:hover {
    background: var(--clu-primary);
    border-color: var(--clu-primary);
}

.btn-accent {
    background: var(--clu-accent);
    border-color: var(--clu-accent);
    color: #fff;
}

.btn-accent:hover {
    background: #059669;
    color: #fff;
}


/* ---- CARDS ---- */
.clu-card {
    background: var(--clu-bg-card);
    border: 1px solid var(--clu-border-light);
    border-radius: var(--clu-radius-lg);
    box-shadow: var(--clu-shadow);
    transition: all var(--clu-transition-slow);
    overflow: hidden;
}

.clu-card:hover {
    box-shadow: var(--clu-shadow-md);
    border-color: var(--clu-border);
}

.clu-card-clickable:hover {
    transform: translateY(-2px);
    box-shadow: var(--clu-shadow-lg);
    cursor: pointer;
}

.clu-card .card-body { padding: 1.25rem; }


/* ---- FORMS ---- */
.form-control, .form-select {
    border: 1px solid var(--clu-border);
    border-radius: var(--clu-radius-sm);
    padding: 0.6rem 0.85rem;
    font-size: 0.875rem;
    background: var(--clu-bg-input);
    transition: border-color var(--clu-transition), box-shadow var(--clu-transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--clu-primary);
    box-shadow: 0 0 0 3px rgba(var(--clu-primary-rgb), 0.15);
}

.form-label {
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--clu-text-secondary);
    margin-bottom: 0.35rem;
}

.form-text { font-size: 0.75rem; }

.input-group-text {
    background: var(--clu-bg);
    border-color: var(--clu-border);
    font-size: 0.875rem;
}


/* ---- MEMBER DIRECTORY GRID ---- */
.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.member-card {
    background: var(--clu-bg-card);
    border: 1px solid var(--clu-border-light);
    border-radius: var(--clu-radius);
    padding: 1.25rem;
    text-align: center;
    transition: all var(--clu-transition-slow);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.member-card .member-family-badge {
    margin-top: auto;
    padding-top: 6px;
}

.member-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--clu-shadow-md);
    border-color: rgba(var(--clu-primary-rgb), 0.3);
}

.member-card .member-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0.75rem;
    border: 3px solid var(--clu-border-light);
    transition: border-color var(--clu-transition);
}

.member-card:hover .member-photo { border-color: var(--clu-primary); }

.member-card .member-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--clu-text);
    margin-bottom: 0.25rem;
}

.member-card .member-role {
    font-size: 0.75rem;
    color: var(--clu-text-muted);
}

.member-card .audio-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--clu-primary-light);
    color: var(--clu-primary);
    border: none;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all var(--clu-transition);
}

.member-card .audio-btn:hover {
    background: var(--clu-primary);
    color: white;
}

.list-group-item .audio-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--clu-primary-light);
    color: var(--clu-primary);
    border: none;
    cursor: pointer;
    transition: all var(--clu-transition);
    vertical-align: middle;
}
.list-group-item .audio-btn:hover {
    background: var(--clu-primary);
    color: white;
}


/* ---- PROFILE ---- */
.profile-header { text-align: center; padding: 2rem 1rem; }

.profile-photo-lg {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--clu-primary);
    box-shadow: 0 4px 20px rgba(var(--clu-primary-rgb), 0.2);
}

.profile-name { font-size: 1.5rem; font-weight: 700; margin-top: 1rem; }
.profile-bio { color: var(--clu-text-secondary); max-width: 500px; margin: 0 auto; }

.contact-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--clu-border-light);
}

.contact-item:last-child { border-bottom: none; }
.contact-item i { width: 24px; color: var(--clu-primary); text-align: center; margin-right: 0.75rem; }


/* ---- MINISTRY BADGES ---- */
.ministry-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: var(--clu-radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    gap: 0.3rem;
}


/* ---- PRAYER BOARD ---- */
.prayer-card {
    background: var(--clu-bg-card);
    border: 1px solid var(--clu-border-light);
    border-radius: var(--clu-radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.prayer-card.answered { border-left: 4px solid var(--clu-accent); }

.pray-btn {
    background: none;
    border: 1px solid var(--clu-border);
    border-radius: var(--clu-radius-full);
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    color: var(--clu-text-secondary);
    cursor: pointer;
    transition: all var(--clu-transition);
}

.pray-btn:hover, .pray-btn.active {
    background: #fef3c7;
    border-color: var(--clu-secondary);
    color: #92400e;
}

.pray-btn .fa { margin-right: 0.3rem; }


/* ---- EVENTS ---- */
.event-card {
    background: var(--clu-bg-card);
    border: 1px solid var(--clu-border-light);
    border-radius: var(--clu-radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.event-date-box {
    min-width: 56px;
    text-align: center;
    background: var(--clu-primary-light);
    border-radius: var(--clu-radius-sm);
    padding: 0.5rem;
    flex-shrink: 0;
}

.event-date-box .month {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--clu-primary);
    letter-spacing: 0.5px;
}

.event-date-box .day {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--clu-primary);
    line-height: 1.1;
}


/* ---- SPOTLIGHT BANNER ---- */
.spotlight-banner {
    background: linear-gradient(135deg, var(--clu-primary-light), #fde68a33);
    border: 1px solid rgba(var(--clu-primary-rgb), 0.15);
    border-radius: var(--clu-radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.spotlight-banner h5 {
    color: var(--clu-primary);
    font-weight: 700;
}


/* ---- STATS / DASHBOARD ---- */
.stat-card {
    background: var(--clu-bg-card);
    border: 1px solid var(--clu-border-light);
    border-radius: var(--clu-radius);
    padding: 1.25rem;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--clu-primary);
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--clu-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}


/* ---- EMPTY STATES ---- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--clu-text-muted);
}

.empty-state .fa {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state h5 { color: var(--clu-text-secondary); font-weight: 600; }
.empty-state p { max-width: 400px; margin: 0 auto; }


/* ---- SEARCH BAR ---- */
.search-bar {
    position: relative;
    max-width: 400px;
}

.search-bar .form-control {
    padding-left: 2.5rem;
    border-radius: var(--clu-radius-full);
}

.search-bar .search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--clu-text-muted);
    pointer-events: none;
}


/* ---- AVATAR SIZES ---- */
.avatar-xs { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.avatar-md { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.avatar-xl { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; }


/* ---- FOOTER ---- */
.clu-footer {
    background: var(--clu-bg-footer);
    border-top: 1px solid var(--clu-border-light);
    color: var(--clu-text-secondary);
}

.clu-footer a:hover { color: var(--clu-primary); }

.font-size-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.font-size-btn.active {
    background: var(--clu-primary);
    border-color: var(--clu-primary);
    color: #fff;
}


/* ---- LOADING / SKELETON ---- */
.skeleton {
    background: linear-gradient(90deg, var(--clu-border-light) 25%, var(--clu-border) 50%, var(--clu-border-light) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--clu-radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-circle {
    border-radius: 50%;
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}


/* ---- UTILITIES ---- */
.text-primary { color: var(--clu-primary) !important; }
.bg-primary-light { background: var(--clu-primary-light) !important; }

.divider {
    height: 1px;
    background: var(--clu-border-light);
    margin: 1.5rem 0;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ---- RESPONSIVE ---- */
@media (max-width: 991.98px) {
    .clu-navbar .navbar-collapse {
        background: var(--clu-bg-card);
        border-radius: var(--clu-radius);
        padding: 1rem;
        margin-top: 0.5rem;
        box-shadow: var(--clu-shadow-lg);
        border: 1px solid var(--clu-border-light);
    }

    /* On mobile, use left bar instead of bottom bar for active nav links */
    .clu-navbar .nav-link.active::after {
        bottom: auto;
        left: 4px;
        top: 50%;
        transform: translateY(-50%);
        width: 3px;
        height: 60%;
    }

    .member-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .member-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .member-card { padding: 1rem; }
    .member-card .member-photo { width: 64px; height: 64px; }
    .profile-photo-lg { width: 100px; height: 100px; }
    .stat-card .stat-value { font-size: 1.5rem; }

    .event-card { flex-direction: column; }
}


/* ---- PRINT ---- */
@media print {
    .clu-navbar, .clu-footer, .btn, .font-size-btn, #themeToggle { display: none !important; }
    body { background: #fff; color: #000; }
    .clu-card { box-shadow: none; border: 1px solid #ccc; }
}
