/* ============================================================
   LES ACADEMIC FORUM — Main Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;900&family=Lato:wght@300;400;700&display=swap');

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

:root {
    --navy:          #0d2340;
    --navy-mid:      #1a3a5c;
    --navy-light:    #2e5a8a;
    --gold:          #c9a227;
    --gold-light:    #e6c35a;
    --gold-pale:     #f9f0d5;
    --cream:         #faf8f3;
    --white:         #ffffff;
    --text:          #1a1a2e;
    --text-muted:    #5a6478;
    --border:        #d4ccb8;
    --success:       #2d7a4f;
    --success-bg:    #e8f5ee;
    --danger:        #a62b2b;
    --danger-bg:     #fdf0f0;
    --warning:       #c97a1a;
    --card-shadow:       0 4px 24px rgba(13,35,64,.10);
    --card-shadow-hover: 0 8px 40px rgba(13,35,64,.18);
}

html { scroll-behavior: smooth; }
body { 
    font-family: 'Lato', sans-serif; 
    background: var(--cream); 
    color: var(--text); 
    min-height: 100vh; 
    line-height: 1.6; 
    display: flex; 
    flex-direction: column;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ─── TOAST ─────────────────────────────────────────────── */
.toast {
    position: fixed; bottom: 2rem; right: 2rem; z-index: 9999;
    padding: 12px 22px; border-radius: 10px; font-size: .9rem; font-weight: 700;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    animation: slideUp .3s ease forwards;
}
.toast-success { background: var(--success); color: #fff; }
.toast-error   { background: var(--danger);  color: #fff; }
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ─── NAVBAR ─────────────────────────────────────────────── */
.navbar {
    background: var(--navy);
    padding: 0 2rem;
    display: flex; align-items: center; justify-content: space-between;
    height: 68px; position: sticky; top: 0; z-index: 100;
    border-bottom: 3px solid var(--gold);
}
.navbar-brand { display: flex; align-items: center; gap: 12px; }
.brand-crest {
    width: 40px; height: 40px; background: var(--gold); border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    padding: 0;
    border: 3px solid #9baf9a;
    transition: transform 0.6s ease-in-out;
}
.brand-crest:hover { transform: rotate(360deg); }
.brand-name { font-family: 'Playfair Display', serif; color: var(--white); font-size: 1.15rem; font-weight: 700; line-height: 1.1; }
.brand-name span { display: block; font-size: .63rem; font-family: 'Lato', sans-serif; font-weight: 300; color: var(--gold-light); letter-spacing: 2px; text-transform: uppercase; }
.nav-links { display: flex; gap: 4px; }
.nav-btn { color: rgba(255,255,255,.72); padding: 8px 16px; border-radius: 6px; font-family: 'Lato', sans-serif; font-size: .88rem; font-weight: 400; letter-spacing: .3px; transition: all .2s; }
.nav-btn:hover, .nav-btn.active { background: rgba(201,162,39,.18); color: var(--gold-light); }
.nav-user { display: flex; align-items: center; gap: 10px; }

.nav-actions { display: flex; align-items: center; gap: 1rem; }
.nav-toggle {
    background: transparent; border: none; cursor: pointer; padding: 0;
    width: 28px; height: 22px;
    display: none; /* Hidden by default, shown in media query */
    flex-direction: column; justify-content: space-between;
    position: relative; z-index: 102;
}
.nav-toggle span {
    display: block; width: 100%; height: 3px; background-color: var(--gold);
    border-radius: 2px; transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out; transform-origin: center;
}
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(9.5px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-9.5px) rotate(-45deg); }
.avatar { width: 36px; height: 36px; background: var(--gold); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--navy); font-size: .78rem; flex-shrink: 0; }
.avatar-name { color: rgba(255,255,255,.82); font-size: .88rem; }
.logout-btn { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); color: rgba(255,255,255,.7); padding: 6px 14px; border-radius: 6px; font-size: .8rem; transition: all .2s; }
.logout-btn:hover { background: rgba(166,43,43,.3); border-color: var(--danger); color: #ffaaaa; }

/* Mobile-only elements in nav, hidden by default */
.nav-mobile-profile { display: none; }
.nav-mobile-logout { display: none; }

/* ─── LOGIN ──────────────────────────────────────────────── */
.login-body { background: var(--cream); }
.login-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.login-bg-pattern { position: absolute; inset: 0; background-image: radial-gradient(circle at 20% 20%, rgba(201,162,39,.1) 0%, transparent 50%), radial-gradient(circle at 80% 80%, rgba(201,162,39,.07) 0%, transparent 50%); pointer-events: none; }
.login-card { background: var(--white); border-radius: 16px; padding: 3rem 2.5rem; width: 420px; max-width: 95vw; box-shadow: 0 30px 80px rgba(0,0,0,.35); position: relative; }
.login-header { text-align: center; margin-bottom: 2rem; }
.login-crest { width: 64px; height: 64px; background: var(--navy); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; font-family: 'Playfair Display', serif; font-weight: 900; color: var(--gold); font-size: 28px; }
.login-title { font-family: 'Playfair Display', serif; font-size: 1.6rem; font-weight: 700; color: var(--navy); }
.login-sub { color: var(--text-muted); font-size: .9rem; margin-top: 4px; }
.login-demo { background: var(--gold-pale); border: 1px solid var(--gold); border-radius: 8px; padding: 12px; margin-bottom: 1.5rem; }
.login-demo p { font-size: .78rem; color: var(--text-muted); margin-bottom: 6px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.login-demo span { display: block; font-size: .8rem; color: var(--text); font-family: monospace; line-height: 1.8; }

/* ─── FORMS ──────────────────────────────────────────────── */
.form-group-icon {
    position: relative;
}
.password-toggle-icon {
    position: absolute;
    /* Position it vertically inside the input field area */
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    padding: 0 14px;
    cursor: pointer;
    color: var(--text-muted);
    user-select: none; /* Prevents text selection on double click */
    font-size: 1.2rem;
    transition: color .2s;
}
.password-toggle-icon:hover {
    color: var(--navy);
}
.form-group-icon .form-input {
    padding-right: 45px; /* Make space for the icon */
}
.form-group { margin-bottom: 1.2rem; }
.form-label { display: block; font-size: .82rem; font-weight: 700; color: var(--navy); margin-bottom: 6px; letter-spacing: .4px; text-transform: uppercase; }
.form-input {
    width: 100%; padding: 10px 14px; border: 2px solid var(--border); border-radius: 8px;
    font-family: 'Lato', sans-serif; font-size: .95rem; color: var(--text); background: var(--cream);
    transition: border-color .2s, background .2s; outline: none;
}
.form-input:focus { border-color: var(--gold); background: var(--white); }
.form-textarea {
    width: 100%; padding: 10px 14px; border: 2px solid var(--border); border-radius: 8px;
    font-family: 'Lato', sans-serif; font-size: .95rem; color: var(--text); background: var(--cream);
    transition: border-color .2s; outline: none; resize: vertical; min-height: 110px;
}
.form-textarea:focus { border-color: var(--gold); background: var(--white); }
.form-select {
    width: 100%; padding: 10px 14px; border: 2px solid var(--border); border-radius: 8px;
    font-family: 'Lato', sans-serif; font-size: .95rem; color: var(--text); background: var(--cream);
    outline: none; cursor: pointer;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn-primary {
    background: var(--navy); color: var(--white); border: none; padding: 12px 20px;
    border-radius: 8px; font-family: 'Lato', sans-serif; font-size: 1rem; font-weight: 700;
    cursor: pointer; transition: all .2s; letter-spacing: .3px; display: inline-block; text-align: center;
}
.btn-primary:hover { background: var(--navy-mid); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(13,35,64,.3); }
.btn-gold {
    background: var(--gold); color: var(--navy); border: 2px solid transparent; padding: 10px 22px;
    border-radius: 8px; font-family: 'Lato', sans-serif; font-size: .9rem; font-weight: 700;
    cursor: pointer; transition: all .2s; display: inline-block;
}
.btn-gold:hover { background: var(--gold-light); border-color: var(--gold); transform: translateY(-1px); }
.btn-outline {
    background: transparent; color: var(--navy); border: 2px solid var(--navy); padding: 9px 20px;
    border-radius: 8px; font-family: 'Lato', sans-serif; font-size: .9rem; font-weight: 700;
    cursor: pointer; transition: all .2s; display: inline-block;
}
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-outline.disabled, .btn-outline.disabled:hover {
    color: var(--text-muted);
    border-color: var(--border);
    cursor: not-allowed;
    background: transparent;
}
.btn-danger {
    background: var(--danger); color: #fff; border: none; padding: 8px 16px;
    border-radius: 6px; cursor: pointer; font-size: .85rem; font-weight: 700;
    font-family: 'Lato', sans-serif; transition: all .2s;
}
.btn-danger:hover { background: #8a2020; }
.btn-sm { padding: 5px 12px !important; font-size: .78rem !important; }

/* ─── HERO ───────────────────────────────────────────────── */
.hero {
    background-image: linear-gradient(rgba(13, 35, 64, 0.75), rgba(13, 35, 64, 0.75)), url('../../images/try1.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* This creates the parallax effect */
    padding: 5rem 2rem 4rem; text-align: center; position: relative; overflow: hidden;
}
.hero-content { position: relative; max-width: 700px; margin: 0 auto; }
.hero-badge {
    display: inline-block; background: rgba(201,162,39,.2); border: 1px solid var(--gold);
    color: var(--gold-light); padding: 6px 20px; border-radius: 99px; font-size: .76rem;
    font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 1.5rem;
}
.hero-title { font-family: 'Playfair Display', serif; font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 900; color: var(--white); line-height: 1.15; margin-bottom: 1rem; }
.hero-title em { color: var(--gold); font-style: normal; }
.hero-sub { color: rgba(255,255,255,.68); font-size: 1.1rem; font-weight: 300; margin-bottom: 2.2rem; line-height: 1.7; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;}
.btn-hero-primary {
    background: var(--gold); color: var(--navy); border: none; padding: 14px 32px;
    border-radius: 8px; font-weight: 700; font-size: 1rem; cursor: pointer; transition: all .2s;
    font-family: 'Lato', sans-serif; display: inline-block;
}
.btn-hero-primary:hover { background: var(--gold-light); transform: translateY(-2px); box-shadow: 0 6px 24px rgba(201,162,39,.4); }
.btn-hero-outline {
    background: transparent; color: rgba(255,255,255,.85); border: 2px solid rgba(255,255,255,.3);
    padding: 12px 28px; border-radius: 8px; font-weight: 400; font-size: 1rem; cursor: pointer;
    transition: all .2s; font-family: 'Lato', sans-serif; display: inline-block;
}
.btn-hero-outline:hover { border-color: rgba(255,255,255,.7); color: #fff; }

/* ─── STATS BAR ──────────────────────────────────────────── */
.stats-bar { background: var(--navy); border-bottom: 1px solid rgba(201,162,39,.3); }
.stats-inner { max-width: 1000px; margin: 0 auto; padding: 1.5rem 2rem; display: flex; justify-content: space-around; flex-wrap: wrap; gap: 1rem; }
.stat-item { text-align: center; }
.stat-num  { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 700; color: var(--gold); }
.stat-label { color: rgba(255,255,255,.55); font-size: .78rem; letter-spacing: 1px; text-transform: uppercase; }

/* ─── LAYOUT ─────────────────────────────────────────────── */
.section { max-width: 1100px; margin: 0 auto; padding: 2.5rem 2rem; }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.two-col { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.5rem; }

/* ─── SECTION CARDS ──────────────────────────────────────── */
.section-title { font-family: 'Playfair Display', serif; font-size: 1.7rem; font-weight: 700; color: var(--navy); margin-bottom: .4rem; }
.divider { width: 48px; height: 3px; background: var(--gold); margin: 8px 0 1.5rem; }
.card { background: var(--white); border-radius: 12px; padding: 1.5rem; box-shadow: var(--card-shadow); border: 1px solid rgba(212,204,184,.4); transition: box-shadow .2s; }
.card:hover { box-shadow: var(--card-shadow-hover); }
.section-card { background: var(--white); border-radius: 12px; box-shadow: var(--card-shadow); border: 1px solid rgba(212,204,184,.4); overflow: hidden; }
.section-card-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.section-card-title { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 600; color: var(--navy); }
.section-card-body { padding: 1.2rem 1.5rem; }
.view-all-link { display: inline-block; margin-top: 1rem; color: var(--navy-light); font-size: .85rem; font-weight: 700; }
.view-all-link:hover { color: var(--gold); }

/* ─── ANNOUNCEMENT CARDS ─────────────────────────────────── */
.announcement-card { border-left: 4px solid var(--gold); margin-bottom: 1rem; }
.announcement-card.pinned { border-left-color: var(--navy); }
.ann-top { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.ann-category { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); background: var(--gold-pale); padding: 3px 10px; border-radius: 99px; }
.ann-title { font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.ann-content { color: var(--text-muted); font-size: .88rem; line-height: 1.6; margin-bottom: 10px; }
.ann-meta { font-size: .78rem; color: var(--text-muted); }
.pin-badge { display: inline-flex; align-items: center; gap: 4px; background: rgba(13,35,64,.08); color: var(--navy); font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; }

/* ─── EVENTS ─────────────────────────────────────────────── */
.event-list { display: flex; flex-direction: column; gap: 12px; }
.event-item { display: flex; gap: 16px; align-items: flex-start; background: var(--white); border-radius: 10px; padding: 1rem 1.2rem; box-shadow: var(--card-shadow); border: 1px solid rgba(212,204,184,.4); }
.event-date-box { min-width: 50px; background: var(--navy); border-radius: 8px; padding: 8px; text-align: center; }
.event-month { font-size: .62rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); }
.event-day { font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 700; color: var(--white); line-height: 1; }
.event-details h4 { font-weight: 700; color: var(--navy); font-size: .95rem; }
.event-details p { color: var(--text-muted); font-size: .82rem; margin-top: 3px; }
.event-category-tag { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: 1px; background: var(--gold-pale); color: var(--warning); padding: 2px 8px; border-radius: 99px; margin-top: 4px; }

/* ─── PAGE HEADER ────────────────────────────────────────── */
.page-header { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%); padding: 2rem 2rem 1.5rem; border-bottom: 3px solid var(--gold); }
.page-header-inner { max-width: 1100px; margin: 0 auto; }
.page-header h1 { font-family: 'Playfair Display', serif; font-size: 1.8rem; font-weight: 700; color: var(--white); }
.page-header p { color: rgba(255,255,255,.58); font-size: .9rem; margin-top: 4px; }
.breadcrumb { font-size: .78rem; color: rgba(255,255,255,.45); margin-bottom: 8px; }
.breadcrumb span, .breadcrumb a:hover { color: var(--gold); }

/* ─── ADMIN ──────────────────────────────────────────────── */
.admin-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1.2rem; margin-bottom: 1.8rem; }
.admin-stat { background: var(--white); border-radius: 12px; padding: 1.3rem; box-shadow: var(--card-shadow); border-top: 4px solid var(--gold); }
.admin-stat h3 { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 700; color: var(--navy); }
.admin-stat p  { color: var(--text-muted); font-size: .82rem; margin-top: 3px; }
.tab-nav { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; overflow-x: auto; }
.tab-btn { background: none; border: none; padding: 10px 18px; cursor: pointer; font-family: 'Lato', sans-serif; font-size: .9rem; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .2s; white-space: nowrap; display: inline-block; }
.tab-btn:hover, .tab-btn.active { color: var(--navy); border-bottom-color: var(--gold); font-weight: 700; }
.table-wrap { background: var(--white); border-radius: 12px; box-shadow: var(--card-shadow); border: 1px solid rgba(212,204,184,.4); overflow: hidden; }
.table-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead tr { background: var(--navy); }
.data-table thead th { padding: 10px 14px; text-align: left; font-size: .75rem; font-weight: 700; color: rgba(255,255,255,.68); letter-spacing: 1px; text-transform: uppercase; white-space: nowrap; }
.data-table thead th:last-child { text-align: center; }
.data-table tbody td:last-child { text-align: center; }
.data-table tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
.data-table tbody tr:hover { background: var(--gold-pale); }
.data-table tbody td { padding: 10px 14px; font-size: .88rem; color: var(--text); }
.table-avatar { width: 28px; height: 28px; background: var(--navy); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--gold); font-size: .68rem; font-weight: 700; flex-shrink: 0; }
.role-badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .72rem; font-weight: 700; letter-spacing: .3px; }
.role-student { background: rgba(46,90,138,.12); color: var(--navy-light); }
.role-admin   { background: rgba(201,162,39,.18); color: #7a6000; }
.role-teacher { background: rgba(45,122,79,.12);  color: var(--success); }

.gallery-admin-thumb {
    width: 100px;
    height: 75px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border);
}
/* ─── FORUM ──────────────────────────────────────────────── */
.forum-layout { max-width: 1100px; margin: 0 auto; padding: 2rem; display: grid; grid-template-columns: 260px 1fr; gap: 2rem; }
.forum-sidebar { }
.cat-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 8px; cursor: pointer; transition: background-color .15s; }
.cat-item:hover, .cat-item.active { background: var(--gold-pale); }
.cat-icon { font-size: 1.1rem; margin-top: 1px; }
.cat-name { font-size: .88rem; font-weight: 700; color: var(--navy); }
.cat-desc { font-size: .74rem; color: var(--text-muted); }
.post-card-link { display: block; }
.post-card { background: var(--white); border-radius: 10px; padding: 1.2rem; box-shadow: var(--card-shadow); border: 1px solid rgba(212,204,184,.4); margin-bottom: 12px; display: flex; gap: 14px; align-items: flex-start; transition: all .2s; }
.post-card:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-2px); }
.post-avatar { width: 40px; height: 40px; background: var(--navy); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--gold); font-weight: 700; font-size: .82rem; flex-shrink: 0; }
.post-title   { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 600; color: var(--navy); margin-bottom: 5px; }
.post-excerpt { font-size: .85rem; color: var(--text-muted); line-height: 1.5; }
.post-meta    { display: flex; gap: 14px; margin-top: 8px; font-size: .76rem; color: var(--text-muted); flex-wrap: wrap; }
.forum-cat-tag { display: inline-block; font-size: .7rem; font-weight: 700; color: var(--gold); background: var(--gold-pale); padding: 2px 8px; border-radius: 99px; }
.post-detail { background: var(--white); border-radius: 12px; padding: 1.5rem; box-shadow: var(--card-shadow); border: 1px solid rgba(212,204,184,.4); margin-bottom: 1.5rem; }
.reply-card { background: var(--gold-pale); border-radius: 10px; padding: 1rem; border: 1px solid rgba(201,162,39,.2); margin-bottom: 10px; position: relative; }
.reply-card.is-child { margin-left: 2rem; border-left: 3px solid var(--gold); background: #fffcf5; }
.reply-card.is-child.depth-2 { margin-left: 4rem; }
.reply-card.is-child.depth-3 { margin-left: 6rem; }
.reply-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.reply-avatar { width: 32px; height: 32px; background: var(--navy); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--gold); font-weight: 700; font-size: .72rem; flex-shrink: 0; }
.reply-author { font-size: .85rem; font-weight: 700; color: var(--navy); }
.reply-date   { font-size: .74rem; color: var(--text-muted); }
.reply-content { font-size: .88rem; color: var(--text); line-height: 1.6; }
.reply-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}
.btn-reply-action {
    padding: 2px 8px;
    font-size: 0.7rem;
}
.btn-reply-action.btn-danger {
    padding: 2px 6px; /* Specific override for delete button */
}
.btn-reply-action.liked {
    background: var(--gold-pale);
    border-color: var(--gold);
}
.toggle-replies-btn {
    background: none;
    border: none;
    color: var(--navy-light);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    padding: 5px 0;
    margin-bottom: 10px;
}
.toggle-replies-btn:hover { text-decoration: underline; }
.view-more-replies-btn {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--navy-light);
    padding: 4px 8px;
    border-radius: 4px;
    transition: background .2s;
    margin-top: -5px; /* Pull it up slightly */
    margin-bottom: 10px;
}
.view-more-replies-btn:hover {
    background: var(--gold-pale);
    text-decoration: underline;
}
/* This button appears AFTER the reply card it controls */
.reply-card.depth-0 ~ .toggle-replies-btn { margin-left: 2rem; }
.reply-card.depth-1 ~ .toggle-replies-btn { margin-left: 4rem; }
.reply-card.depth-2 ~ .toggle-replies-btn,
.reply-card.depth-3 ~ .toggle-replies-btn { margin-left: 6rem; } /* Max indent */

.post-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
}
.forum-post-wrap { max-width: 1000px; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--navy-light); font-size: .88rem; font-weight: 700; margin-bottom: 1rem; }
.back-btn:hover { color: var(--navy); }

/* ─── MODAL ──────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(13,35,64,.58); z-index: 200;
    display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.modal { background: var(--white); border-radius: 16px; padding: 2rem; width: 520px; max-width: 95vw; box-shadow: 0 30px 80px rgba(0,0,0,.3); max-height: 90vh; overflow-y: auto; }
.modal-title { font-family: 'Playfair Display', serif; font-size: 1.3rem; font-weight: 700; color: var(--navy); margin-bottom: 1.5rem; }

/* ─── EMPTY STATE ────────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem; color: var(--text-muted); font-size: .95rem; background: var(--white); border-radius: 12px; box-shadow: var(--card-shadow); }

/* ─── NOTIFICATIONS ──────────────────────────────────────── */
.notification-wrapper { position: relative; }
.notification-bell {
    background: transparent;
    border: 1px solid rgba(255,255,255,.2);
    color: rgba(255,255,255,.85);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}
.notification-bell:hover {
    border-color: rgba(255,255,255,.7);
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger);
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: .65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--navy);
}
.notification-dropdown {
    display: none;
    position: absolute;
    top: 120%; /* Adjusted for better spacing from bell */
    right: 0;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
    text-align: left;
}
.notification-dropdown.show { display: block; }
.notification-header {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.notification-header h4 { font-size: .9rem; font-weight: 700; color: var(--navy); margin: 0; }
.notification-header a { font-size: .75rem; color: var(--navy-light); }
.notification-item { display: block; padding: 10px 15px; border-bottom: 1px solid var(--border); font-size: .85rem; color: var(--text); line-height: 1.4; }
.notification-item:hover { background: var(--gold-pale); }
.notification-item.unread { background: #f0f3f9; }
.notification-item:last-child { border-bottom: none; }
.notification-item small { display: block; font-size: .7rem; color: var(--text-muted); margin-top: 4px; }
.notification-footer { padding: 10px; text-align: center; font-size: .85rem; color: var(--text-muted); }

/* ─── PHOTO GALLERY ──────────────────────────────────────── */
.photo-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.gallery-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.photo-gallery {
    display: flex;
    overflow-x: auto;
    gap: 1.5rem;
    padding: 1rem 0.5rem;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE 10+ */
    flex: 1;
    min-width: 0;
}
.photo-gallery::-webkit-scrollbar { display: none; } /* Chrome/Safari */

.gallery-item {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all .3s ease;
    position: relative;
}

/* Sizing for items in the flexbox grid */
/* This rule is no longer needed with CSS Grid */

/* Scoped styles for the homepage slider items */
.photo-gallery .gallery-item {
    min-width: 280px;
    flex-shrink: 0;
}

.gallery-item:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: var(--card-shadow-hover);
}
.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

/* New Arrow Design */
.gallery-nav {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 44px;
    height: 44px;
    border-radius: 8px; /* Rounded square */
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    flex-shrink: 0;
}


.gallery-nav:hover {
    background: var(--gold);
    color: var(--navy);
    border-color: var(--gold);
    transform: scale(1.05);
}

.gallery-nav.prev { margin-right: 10px; }
.gallery-nav.next { margin-left: 10px; }

@media (max-width: 768px) {
    .gallery-nav { display: none; } /* Hide arrows on mobile, allow swipe */
    .gallery-wrapper { margin: 0 -1rem; } /* Full width on mobile */
    .photo-gallery { padding: 1rem; }
    .photo-gallery-grid {
        grid-template-columns: repeat(3, 1fr); /* Force 3 columns on mobile */
        gap: 0.5rem; /* Reduce gap to fit columns */
    }
}

/* ─── PAGINATION ─────────────────────────────────────────── */
.pagination-controls {
    margin-top: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ─── TESTIMONIALS ───────────────────────────────────────── */
.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.testimonial-card {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    border-top: 4px solid var(--gold);
    display: flex;
    flex-direction: column;
}

.testimonial-quote {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto; /* Pushes to the bottom */
}

.testimonial-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--border);
}

.testimonial-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.testimonial-name { font-weight: 700; color: var(--navy); }
.testimonial-role { font-size: 0.8rem; color: var(--text-muted); }

/* ─── IMAGE MODAL ────────────────────────────────────────── */
.modal.modal-image {
    background: transparent;
    padding: 0;
    width: auto;
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: none;
    text-align: center;
}
#image-modal-src {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
#image-modal-caption {
    color: var(--white);
    margin-top: 1rem;
    font-size: 1rem;
    font-weight: 400;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}
.close-modal-btn { position: absolute; top: -10px; right: 0px; font-size: 2.5rem; color: white; cursor: pointer; font-weight: 300; text-shadow: 1px 1px 3px rgba(0,0,0,0.7); transition: transform .2s; }
.close-modal-btn:hover { transform: scale(1.2); }

/* ─── FOOTER ─────────────────────────────────────────────── */
.site-footer { background: var(--navy); border-top: 3px solid var(--gold); margin-top: 4rem; }
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 2rem; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 1.5rem; text-align: center; }
.footer-brand { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.85); font-family: 'Playfair Display', serif; justify-content: center; flex-wrap: wrap; }
.footer-brand p { font-family: 'Lato', sans-serif; font-size: .8rem; color: rgba(255,255,255,.45); margin-top: 2px; }
.footer-copy { color: rgba(255,255,255,.35); font-size: .78rem; }
.footer-social { display: flex; gap: 1rem; }
.social-link {
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.2s;
    display: inline-block;
}
.social-link:hover {
    color: var(--gold);
    transform: translateY(-2px);
}
.social-link svg { width: 22px; height: 22px; }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 900px) {
    .home-grid, .two-col  { grid-template-columns: 1fr; }
    .admin-grid            { grid-template-columns: 1fr 1fr; }
    .forum-layout          { grid-template-columns: 1fr; }
    .forum-sidebar         { order: -1; }
}
@media (max-width: 768px) {
    .navbar { padding: 0.8rem 1rem; flex-wrap: wrap; height: auto; min-height: 68px; align-content: center; }
    .brand-name            { display: none; }
    .nav-toggle            { display: flex; margin-left: 0; }
    .nav-user              { display: none; } /* Hidden on mobile, info is in the slide-out menu */

    /* Slide-in Menu Styles */
    .nav-links {
        position: fixed; top: 0; right: 0; width: 280px; max-width: 80%; height: 100%;
        background: var(--navy); flex-direction: column; padding: 1.5rem;
        box-shadow: -5px 0 25px rgba(0,0,0,0.2);
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        z-index: 101; display: flex !important;
        gap: 0;
    }
    .nav-open .nav-links { transform: translateX(0); }
    
    .nav-btn { display: block; width: 100%; text-align: left; padding: 12px; }
    .nav-btn:hover { background: rgba(255,255,255,0.1); }

    .nav-mobile-profile {
        display: flex;
        align-items: center;
        gap: 12px;
        padding-bottom: 1.5rem;
        margin-bottom: 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    .nav-mobile-profile .avatar {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
        flex-shrink: 0;
    }
    .nav-mobile-name {
        color: var(--white);
        font-weight: 700;
        font-size: .95rem;
    }
    .nav-mobile-email {
        color: rgba(255,255,255,0.6);
        font-size: .8rem;
    }
    .nav-mobile-logout {
        display: block;
        margin-top: auto; /* Pushes it to the bottom */
        background: rgba(166,43,43,.3);
        color: #ffaaaa;
        text-align: center;
    }
    .nav-btn.nav-mobile-logout:hover {
        background: rgba(166,43,43,.5);
        color: #fff;
    }

    .admin-grid            { grid-template-columns: 1fr; }
    .form-row              { grid-template-columns: 1fr; }
    .section               { padding: 1.5rem 1rem; }
    .forum-layout          { padding: 1.5rem 1rem; }
    .footer-inner          { flex-direction: column; text-align: center; }
    .stats-inner           { gap: 1.5rem; }
    .stat-item             { flex: 1 1 40%; }

    .hero {
        /* Disable fixed background on mobile for better performance and to prevent zooming issues */
        background-attachment: scroll;
    }
    
    /* Forum Post Detail Mobile */
    .page-header h1, .post-detail h2 {
        overflow-wrap: break-word;
        word-break: break-word;
    }
    .post-content img, .reply-content img {
        max-width: 100%;
        height: auto;
    }
    .post-detail, .reply-card { padding: 1rem; }
    
    .post-actions { flex-wrap: wrap; }
    
    .reply-header { flex-wrap: wrap; gap: 8px; }
    
    .reply-actions {
        margin-left: 0 !important;
        width: 100%;
        justify-content: flex-start;
        margin-top: 0.5rem;
        flex-wrap: wrap;
    }
    
    .reply-card.is-child { margin-left: 1rem; }
    .reply-card.is-child.depth-2 { margin-left: 1.5rem; }
    .reply-card.is-child.depth-3 { margin-left: 2rem; }
    
    .reply-card.depth-0 ~ .toggle-replies-btn { margin-left: 1rem; }
    .reply-card.depth-1 ~ .toggle-replies-btn { margin-left: 1.5rem; }
    .reply-card.depth-2 ~ .toggle-replies-btn,
    .reply-card.depth-3 ~ .toggle-replies-btn { margin-left: 2rem; }
    
    .pagination-controls { flex-direction: column; gap: 1rem; }
    
    /* Forum List Mobile */
    .post-card { flex-direction: column; }
    .post-card .post-avatar { margin-bottom: 0.5rem; }
    .post-meta { gap: 8px; }

    /* General Mobile Fixes (moved from header.php) */
    .hero-title { font-size: 2rem !important; }
    .modal { width: 92% !important; margin: 5vh auto; max-height: 90vh; overflow-y: auto; }
    .admin-layout { flex-direction: column; }

    /* Mobile Notification Dropdown */
    .notification-dropdown {
        position: fixed;
        top: 70px;
        left: 50%;
        transform: translateX(-50%);
        width: 94%;
        max-width: 400px;
        right: auto;
    }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
