/**
 * HBC Church Website - Main Stylesheet
 * Core styles, colors, typography, and base elements
 */

/* ===== CSS VARIABLES (COLORS & SETTINGS) ===== */
:root {
    /* Primary Colors */
    --color-primary: #00bcd4;          /* Cyan/Turquoise */
    --color-primary-dark: #0097a7;
    --color-primary-light: #b2ebf2;
    
    /* Secondary Colors */
    --color-secondary: #667eea;        /* Purple/Blue */
    --color-secondary-dark: #764ba2;
    
    /* Background Colors */
    --color-bg-main: #e3f2fd;          /* Light blue background */
    --color-bg-aside: #d1ecf1;         /* Lighter cyan for asides */
    --color-bg-white: #ffffff;
    --color-bg-overlay: rgba(0, 0, 0, 0.3);
    
    /* Text Colors */
    --color-text-primary: #1a1a1a;
    --color-text-secondary: #4a4a4a;
    --color-text-light: #757575;
    --color-text-white: #ffffff;
    
    /* Border & Shadow */
    --color-border: #d1d1d1;
    --color-shadow: rgba(0, 0, 0, 0.1);
    
    /* Status Colors */
    --color-success: #28a745;
    --color-warning: #ffc107;
    --color-error: #dc3545;
    --color-info: #17a2b8;
    
    /* Typography */
    --font-family-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-heading: 'Georgia', 'Times New Roman', serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-primary);
    color: var(--color-text-primary);
    line-height: 1.6;
    background: linear-gradient(135deg, var(--color-bg-main) 0%, #f5f5f5 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Background Image (Church building) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/backgrounds/church-building.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    opacity: 0.15;
    z-index: -1;
    pointer-events: none;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--spacing-sm);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.btn-login {
    background: var(--color-primary);
    color: var(--color-text-white);
}

.btn-login:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--color-shadow);
}

.btn-register {
    background: var(--color-secondary);
    color: var(--color-text-white);
}

.btn-register:hover {
    background: var(--color-secondary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--color-shadow);
}

.btn-upload {
    background: var(--color-success);
    color: var(--color-text-white);
}

.btn-upload:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-admin {
    background: var(--color-warning);
    color: var(--color-text-primary);
}

.btn-admin:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

.btn-logout {
    background: var(--color-error);
    color: var(--color-text-white);
}

.btn-logout:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* ===== SITE HEADER ===== */
.site-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    box-shadow: 0 4px 12px var(--color-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    max-width: 1400px;
    margin: 0 auto;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.church-logo img {
    height: 80px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.church-name h1 {
    color: var(--color-text-white);
    font-size: 2rem;
    margin-bottom: 0.25rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.church-name .tagline {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-style: italic;
    margin: 0;
}

.auth-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.welcome-message {
    color: var(--color-text-white);
    font-size: 1rem;
    margin-right: var(--spacing-sm);
}

.auth-links {
    display: flex;
    gap: var(--spacing-sm);
}

/* ===== NAVIGATION MENU ===== */
.main-navigation {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px var(--color-shadow);
}

.nav-menu {
    display: flex;
    list-style: none;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

.nav-menu > li {
    position: relative;
    flex: 1;
}

.nav-link {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--color-text-primary);
    font-weight: 500;
    text-align: center;
    transition: all var(--transition-fast);
    border-bottom: 3px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    background: var(--color-primary-light);
    border-bottom-color: var(--color-primary);
    text-decoration: none;
}

/* Dropdown Menus */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: white;
    box-shadow: 0 8px 16px var(--color-shadow);
    list-style: none;
    z-index: 9999;
}

.nav-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    border-bottom: 1px solid var(--color-border);
}

.dropdown-menu li:last-child {
    border-bottom: none;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--color-text-primary);
    transition: background var(--transition-fast);
}

.dropdown-menu a:hover {
    background: var(--color-bg-main);
    text-decoration: none;
    padding-left: 1.25rem;
}

/* Mobile Menu Toggle (hidden on desktop) */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--color-text-white);
    margin: 5px 0;
    transition: all var(--transition-fast);
}

/* ===== BIBLE QUOTE BAR ===== */
.bible-quote-bar {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--color-text-white);
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: center;
    box-shadow: 0 4px 8px var(--color-shadow);
}

.bible-quote-content {
    max-width: 1200px;
    margin: 0 auto;
}

.quote-text {
    font-size: 1.25rem;
    font-style: italic;
    line-height: 1.6;
    display: block;
    margin-bottom: var(--spacing-xs);
}

.quote-reference {
    font-size: 1rem;
    font-weight: 600;
    opacity: 0.9;
    display: block;
}

/* ===== MESSAGE BAR (Scrolling Info) ===== */
.message-bar {
    background: var(--color-bg-aside);
    padding: var(--spacing-sm) 0;
    overflow: hidden;
    border-bottom: 2px solid var(--color-primary);
}

.message-scroll {
    display: flex;
    white-space: nowrap;
    animation: scroll-messages 60s linear infinite;
}

.message-item {
    display: inline-block;
    padding: 0 3rem;
    font-size: 1rem;
    color: var(--color-text-secondary);
}

@keyframes scroll-messages {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* ===== CONTENT BLOCKS (Used in asides and articles) ===== */
.content-block {
    background: var(--color-bg-white);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    box-shadow: 0 2px 8px var(--color-shadow);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.content-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--color-shadow);
}

.content-block h3 {
    color: var(--color-primary);
    font-size: 1.25rem;
    margin-bottom: var(--spacing-xs);
}

.content-block p {
    margin-bottom: var(--spacing-xs);
    line-height: 1.6;
}

.content-block p:last-child {
    margin-bottom: 0;
}

/* ===== ARTICLES (Main Content) ===== */
.content-article {
    background: var(--color-bg-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: 0 4px 16px var(--color-shadow);
}

.content-article h2 {
    color: var(--color-primary);
    border-bottom: 3px solid var(--color-primary);
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.article-summary {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    font-style: italic;
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-md);
    border-left: 4px solid var(--color-primary-light);
}

.article-body {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: var(--spacing-md);
}

.article-meta {
    display: flex;
    gap: var(--spacing-md);
    font-size: 0.875rem;
    color: var(--color-text-light);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--color-border);
}

/* Social Links in Articles */
.social-links {
    display: flex;
    gap: var(--spacing-sm);
    margin: var(--spacing-md) 0;
}

.social-link {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    transition: transform var(--transition-fast);
}

.social-link:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

.social-link.facebook { background: #1877f2; }
.social-link.youtube { background: #ff0000; }
.social-link.tiktok { background: #000000; }

/* Mission Statement Styling */
.mission-statement {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(0, 188, 212, 0.05) 100%);
}

.mission-header {
    text-align: center;
    padding: var(--spacing-lg) 0;
    border-bottom: 4px solid var(--color-primary);
    margin-bottom: var(--spacing-lg);
}

.mission-header h1 {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5rem;
}

.mission-block {
    background: var(--color-bg-white);
    border-left: 6px solid var(--color-primary);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px var(--color-shadow);
}

.mission-block h2 {
    color: var(--color-primary);
    font-size: 1.75rem;
    margin-bottom: var(--spacing-sm);
    border-bottom: none;
    padding-bottom: 0;
}

.mission-block p {
    font-size: 1.125rem;
    line-height: 1.8;
}

.mission-block em {
    color: var(--color-text-light);
    font-style: italic;
}

/* ===== SCROLL TO TOP BUTTON ===== */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    color: var(--color-text-white);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--color-shadow);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 999;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: var(--color-primary-dark);
    transform: translateY(-4px);
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }
-e 

/* ========================================== */
/* DROPDOWN OVERFLOW FIX - ADDED 2026-05-07 */
/* ========================================== */

/* ============================================
   COMPLETE DROPDOWN FIX FOR USER MANAGEMENT
   
   Add this to the END of main.css
   Location: C:\xampp\htdocs\hbc\assets\css\main.css
   ============================================ */

/* Fix 1: Ensure dropdowns have high z-index */
/* NOTE (rev7): .dropdown-menu removed here — it also matched the SITE NAV submenus
   and forced them position:absolute, breaking the mobile drill-down. This block is
   now scoped to admin action menus only. */
.actions-dropdown,
button[class*="Actions"] + div,
.user-actions-dropdown {
    z-index: 99999 !important;
    position: absolute !important;
}

/* Fix 2: Remove overflow constraints on tables */
table,
table tbody,
table thead,
.table-container,
.table-wrapper,
.users-table,
.all-users-table {
    overflow: visible !important;
}

/* Fix 3: Ensure table rows allow overflow */
table tbody tr {
    position: relative;
    overflow: visible !important;
}

/* Fix 4: Ensure table cells allow overflow */
table tbody td,
table tbody th {
    overflow: visible !important;
}

/* Fix 5: Fix specific action button dropdowns */
/* NOTE (rev7): the broad [class*="dropdown-menu"] selector was removed — it matched
   the SITE NAV submenus (class="dropdown-menu") and forced them display:block +
   position:absolute, which is what exploded the mobile menu open. Admin action
   menus use .actions-dropdown-menu, so they are unaffected. */
.actions-dropdown-menu {
    position: absolute !important;
    z-index: 100000 !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    min-width: 200px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-top: 5px;
    display: block;
}

/* Fix 6: Ensure parent containers don't clip */
.content-article,
.content-block,
main,
section,
article {
    overflow: visible !important;
}

/* Fix 7: Fix table container in user management */
div[class*="table"],
div[class*="users"],
div[class*="management"] {
    overflow: visible !important;
}

/* Fix 8: Specific fix for Actions button */
button[class*="Actions"],
button[class*="actions"] {
    position: relative;
}

button[class*="Actions"]:focus + div,
button[class*="actions"]:focus + div {
    display: block !important;
    position: absolute !important;
    z-index: 100000 !important;
}

/* ============================================
   ALTERNATIVE: If above doesn't work, try this
   ============================================ */

/* Nuclear option: Force all dropdowns visible */
* [class*="dropdown"] {
    overflow: visible !important;
}

* [class*="dropdown"] * {
    overflow: visible !important;
}

/* Ensure no parent clips dropdowns */
body * {
    position: relative;
}

body *:has(.dropdown-menu) {
    overflow: visible !important;
}

/* ============================================
   TESTING:
   1. Clear browser cache (Ctrl+Shift+Delete)
   2. Hard refresh (Ctrl+F5)
   3. Check dropdown shows completely
   ============================================ */
