:root,
[data-theme="dark"] {
    color-scheme: dark;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #ec4899;
    --success: #10b981;
    --danger: #ef4444;
    --page-bg: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --surface: rgba(30, 27, 75, .88);
    --surface-solid: #1e1b4b;
    --surface-hover: rgba(255,255,255,.08);
    --border: rgba(255,255,255,.12);
    --text: #f8fafc;
    --muted: #a7b0c1;
    --input-bg: rgba(15,23,42,.75);
    --navbar: rgba(15,23,42,.92);
    --shadow: 0 18px 50px rgba(0,0,0,.25);
}
[data-theme="light"] {
    color-scheme: light;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #db2777;
    --success: #047857;
    --danger: #dc2626;
    --page-bg: linear-gradient(135deg, #fff 0%, #f3f4f6 100%);
    --surface: rgba(255,255,255,.93);
    --surface-solid: #fff;
    --surface-hover: rgba(79,70,229,.07);
    --border: rgba(79,70,229,.16);
    --text: #111827;
    --muted: #64748b;
    --input-bg: #f9fafb;
    --navbar: rgba(255,255,255,.94);
    --shadow: 0 18px 50px rgba(15,23,42,.1);
}
* { box-sizing: border-box; }
*, *::before, *::after { box-sizing: border-box; }

/* Universal Responsive Media Constraints */
img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

/* Responsive Word Wrapping & Text Containment */
body, h1, h2, h3, h4, h5, h6, p, span, a, label, li, td, th, strong, em, b, i,
.feed-title, .feed-author, .feed-description-content, .campaign-description,
.comment-item, .blog-content, .card-body, .content-card, .stat-card,
.campaign-card, .about-card, .glass-card, .auth-card {
    overflow-wrap: anywhere;
    word-break: normal;
}

/* Ensure code and preformatted blocks wrap or scroll horizontally */
pre, code, kbd, samp {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}
pre {
    overflow-x: auto;
}

/* Flex child containment: prevent flex items from blowing out containers */
.d-flex > *,
.navbar .nav-link,
.nav-actions,
.feed-header,
.feed-header > *,
.feed-user-meta,
.feed-social-bar,
.feed-social-bar > *,
.admin-nav > *,
.footer-links > * {
    min-width: 0;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--page-bg);
    background-attachment: fixed;
    font-family: "Outfit", "Segoe UI", Arial, sans-serif;
}
a { color: var(--primary); }
.app-navbar { background: var(--navbar); border-bottom: 1px solid var(--border); backdrop-filter: blur(16px); }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); font-size: 1.2rem; font-weight: 800; text-decoration: none; }
.brand:hover { color: var(--text); }
.brand-mark { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 12px; color: white; background: linear-gradient(135deg,var(--primary),var(--secondary)); }
.brand-accent { color: var(--primary); }
.navbar .nav-link { color: var(--text); font-weight: 500; }
.navbar .nav-link:hover { color: var(--primary); }
.nav-actions { display: flex; align-items: center; gap: .55rem; }
.nav-user { color: var(--muted); font-size: .9rem; }
.theme-toggle { width: 40px; height: 40px; color: var(--text); border: 1px solid var(--border); border-radius: 50%; }
.theme-toggle:hover { color: var(--primary); border-color: var(--primary); }
.app-main { min-height: calc(100vh - 190px); padding-bottom: 2rem; }
.site-footer { padding: 2rem 0; border-top: 1px solid var(--border); color: var(--muted); background: var(--surface); }
.footer-brand { font-size: 1rem; }
.footer-links { display: flex; gap: 1rem; }
.footer-links a { color: var(--muted); text-decoration: none; }
.hero { position: relative; overflow: hidden; padding: 5.5rem 0; }
.hero h1 { max-width: 760px; font-size: clamp(2.5rem, 6vw, 4.7rem); font-weight: 800; line-height: 1.03; letter-spacing: -.05em; }
.hero-copy { max-width: 680px; color: var(--muted); font-size: 1.15rem; }
.gradient-text { color: var(--primary); }
.glass-card, .content-card, .auth-card, .stat-card {
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}
.content-card { padding: 1.5rem; }
.auth-card { width: min(100%, 560px); margin: 4rem auto; padding: 2rem; }
.form-control, .form-select, textarea.form-control {
    color: var(--text);
    background: var(--input-bg);
    border-color: var(--border);
}
.form-control:focus, .form-select:focus {
    color: var(--text);
    background: var(--input-bg);
    border-color: var(--primary);
    box-shadow: 0 0 0 .2rem rgba(99,102,241,.2);
}
.form-control::placeholder { color: var(--muted); opacity: .8; }
.form-label { color: var(--text); font-weight: 600; }
.form-text, .text-muted, .muted { color: var(--muted) !important; }
.btn-primary { --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary-hover); --bs-btn-hover-border-color: var(--primary-hover); }
.btn-gradient { color: white; font-weight: 700; border: 0; border-radius: 12px; background: linear-gradient(135deg,var(--primary),var(--secondary)); }
.btn-gradient:hover { color: white; filter: brightness(1.08); transform: translateY(-1px); }
.section-heading { margin: 3rem 0 1.5rem; font-weight: 800; }
.campaign-card { overflow: hidden; }
.campaign-card .card-body { padding: 1.35rem; }
.campaign-card p { color: var(--muted); }
.campaign-meta { color: var(--muted); font-size: .9rem; }
.campaign-cover { width: 100%; max-height: 290px; object-fit: cover; border-radius: 14px; }
.badge-soft { color: var(--primary); background: rgba(99,102,241,.15); }
.table { --bs-table-color: var(--text); --bs-table-bg: transparent; --bs-table-border-color: var(--border); }
.table thead th { color: var(--muted); font-size: .78rem; text-transform: uppercase; }
.admin-nav { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.admin-nav a { padding: .5rem .85rem; color: var(--text); border: 1px solid var(--border); border-radius: 999px; text-decoration: none; }
.admin-nav a:hover { color: white; background: var(--primary); }
.comment-item { padding: .75rem 0; border-bottom: 1px solid var(--border); }
.mobile-nav { position: fixed; z-index: 1040; right: 0; bottom: 0; left: 0; display: flex; justify-content: space-around; min-height: 62px; padding: .35rem .2rem max(.35rem, env(safe-area-inset-bottom)); background: var(--navbar); border-top: 1px solid var(--border); backdrop-filter: blur(16px); }
.mobile-nav a { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; color: var(--muted); text-decoration: none; font-size: .66rem; }
.mobile-nav i { font-size: 1.2rem; }
.mobile-nav .mobile-nav-main { color: var(--primary); }
.visually-muted { color: var(--muted); }
.empty-state { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.no-wrap { white-space: nowrap; }
.campaign-description img { max-width: 100%; height: auto; }
.campaign-description iframe { display: block; width: min(100%, 560px); aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 12px; }
.campaign-discovery { padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }

/* Community Campaigns Collapsible Search Interface */
.btn-search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 1.05rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.btn-search-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}
.btn-search-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.btn-search-toggle[aria-expanded="true"],
.btn-search-toggle:not(.collapsed)[data-bs-toggle="collapse"] {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.btn-search-toggle .search-active-indicator {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 9px;
    height: 9px;
    background: var(--secondary);
    border-radius: 50%;
    border: 2px solid var(--surface-solid);
    box-shadow: 0 0 6px rgba(236, 72, 153, 0.6);
}
#campaignSearchCollapse.collapsing {
    transition: height 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.campaign-progress .progress { height: 9px; background: var(--border); border-radius: 999px; overflow: hidden; }
.campaign-progress .progress-bar { background: linear-gradient(90deg, var(--primary), var(--secondary)); }
@media (max-width: 767.98px) {
    body { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
    body.admin-body { padding-bottom: 0 !important; }
    .hero { padding: 3rem 0; }
    .auth-card { margin: 1.5rem auto; padding: 1.25rem; border-radius: 16px; }
    .content-card { padding: 1.15rem; border-radius: 16px; }
    .nav-actions { padding: .75rem 0; flex-wrap: wrap; }
    .table-responsive { border-radius: 14px; }
}

/* About Us Visual Storytelling Styles */
.about-hero { padding: 3.5rem 0 2.5rem; }
.about-hero-title { font-size: clamp(2rem, 4.2vw, 3.2rem); font-weight: 800; line-height: 1.15; letter-spacing: -.03em; }
.about-hero-img-wrap {
    position: relative;
    border-radius: 24px;
    padding: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}
.about-hero-img-wrap:hover { transform: translateY(-3px); }
.about-hero-img { width: 100%; height: auto; border-radius: 18px; display: block; }

.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.4rem 0.95rem;
    border-radius: 999px;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid var(--border);
}

.mission-card {
    height: 100%;
    padding: 2rem 1.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, border-color 0.25s ease;
}
.mission-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}
.mission-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: inline-grid;
    place-items: center;
    font-size: 1.5rem;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    margin-bottom: 1.25rem;
}

.step-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, border-color 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.step-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}
.step-media {
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.35);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: center;
    align-items: center;
}
[data-theme="light"] .step-media {
    background: rgba(243, 244, 246, 0.7);
}
.step-illustration {
    width: 100%;
    max-height: 220px;
    height: auto;
    border-radius: 12px;
    display: block;
}
.step-body { padding: 1.6rem; flex-grow: 1; }
.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.85rem;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    margin-right: 0.6rem;
}

.platform-feature-card {
    display: block;
    height: 100%;
    padding: 1.75rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.platform-feature-card:hover {
    color: var(--text);
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 16px 40px rgba(99, 102, 241, 0.16);
}
.platform-feature-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: inline-grid;
    place-items: center;
    font-size: 1.3rem;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.14);
    margin-bottom: 1rem;
    transition: background 0.2s, color 0.2s;
}
.platform-feature-card:hover .platform-feature-icon {
    color: white;
    background: var(--primary);
}

.community-impact-wrap {
    padding: 2.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 26px;
    box-shadow: var(--shadow);
}
.community-impact-img {
    width: 100%;
    height: auto;
    border-radius: 18px;
    display: block;
}

.transparency-box {
    padding: 2.2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
}
.transparency-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}
.transparency-item:last-child { margin-bottom: 0; }
.transparency-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-grid;
    place-items: center;
    font-size: 1.15rem;
    color: #10b981;
    background: rgba(16, 185, 129, 0.14);
}

.cta-banner {
    padding: 3.5rem 2rem;
    border-radius: 26px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.14) 0%, rgba(236, 72, 153, 0.14) 100%);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    text-align: center;
}

/* Administrator Bar on Public Pages */
.admin-notice-bar {
    background: #0f172a;
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.15) !important;
    font-size: 0.88rem;
    z-index: 1040;
}
[data-theme="light"] .admin-notice-bar {
    background: #1e293b;
    color: #f8fafc;
}

/* Administrator Top Bar & Dedicated Layout */
.admin-topbar {
    background: var(--navbar);
    border-color: var(--border) !important;
    backdrop-filter: blur(16px);
}
.admin-sidebar {
    background: var(--surface);
    border-color: var(--border) !important;
}
.admin-sidebar .nav-link {
    color: var(--text);
    padding: 0.65rem 1rem;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    transition: all 0.15s ease-in-out;
}
.admin-sidebar .nav-link:hover {
    background: var(--surface-hover);
    color: var(--primary);
}
.admin-sidebar .nav-link.active {
    background: var(--primary);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}
.admin-main-content {
    min-height: calc(100vh - 120px);
}

/* Blog Components */
.blog-hero {
    position: relative;
    padding-top: 1.5rem;
    padding-bottom: 2rem;
}
.btn-add-blog {
    transition: all 0.2s ease-in-out;
    font-weight: 500;
}
.btn-add-blog:hover {
    transform: translateY(-1px);
}
.blog-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 20px;
}
.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}
.blog-card-media img {
    transition: transform 0.3s ease;
}
.blog-card:hover .blog-card-media img {
    transform: scale(1.03);
}
.blog-title-link:hover {
    color: var(--primary) !important;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-content {
    border-radius: 24px;
}
.blog-content h2, .blog-content h3 {
    margin-top: 1.75rem;
    margin-bottom: 0.85rem;
    font-weight: 700;
}
.blog-content p {
    margin-bottom: 1.25rem;
}
.blog-content blockquote {
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid var(--primary);
    background: var(--surface-hover);
    border-radius: 0 12px 12px 0;
}
.pagination-rounded .page-link {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
    padding: 0.5rem 0.85rem;
}
.pagination-rounded .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

/* ==========================================================================
   Facebook-Style Social Feed & Media Gallery Styles
   ========================================================================== */

.feed-card {
    border-radius: 18px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border);
    background: var(--surface);
}

.feed-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.feed-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.15rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    user-select: none;
}

.feed-author {
    color: var(--text);
    font-size: 0.98rem;
}

.feed-timestamp {
    font-size: 0.8rem;
    color: var(--muted);
}

.feed-title {
    color: var(--text);
    font-weight: 700;
    line-height: 1.35;
}

.feed-title a:hover {
    color: var(--primary) !important;
}

.feed-description-content {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.55;
    max-height: 4.8em;
    overflow: hidden;
    position: relative;
    transition: max-height 0.3s ease;
}

.feed-description-content.expanded {
    max-height: none;
}

.feed-read-more-btn {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: 4px;
    cursor: pointer;
}

.feed-read-more-btn:hover {
    text-decoration: underline !important;
}

.feed-fundraising-card {
    background: var(--surface-hover);
    border: 1px solid var(--border);
}

.feed-progress .progress-bar {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 999px;
    transition: width 0.6s ease;
}

.feed-btn {
    border: 0;
    background: transparent;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--muted);
    transition: background 0.15s ease, color 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.feed-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
}

/* Media Gallery Layouts */
.campaign-media-section {
    border-radius: 14px;
    overflow: hidden;
}

.campaign-media-gallery {
    border-radius: 14px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.05);
}

.campaign-media-gallery .gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.2);
}

.campaign-media-gallery .gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.campaign-media-gallery .gallery-item:hover .gallery-img {
    transform: scale(1.025);
}

/* 1 Image */
.gallery-1 {
    width: 100%;
    max-height: 500px;
}

.gallery-1 .gallery-single-img {
    max-height: 500px;
    width: 100%;
    object-fit: cover;
}

/* 2 Images */
.gallery-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.gallery-2 .gallery-item {
    height: 280px;
}

/* 3 Images */
.gallery-3 {
    display: grid;
    grid-template-columns: 2fr 1.2fr;
    gap: 4px;
    height: 350px;
}

.gallery-3 .gallery-hero {
    height: 100%;
}

.gallery-3 .gallery-column {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 4px;
    height: 100%;
}

.gallery-3 .gallery-column .gallery-item {
    height: 173px;
}

/* 4 Images */
.gallery-4 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 4px;
    height: 350px;
}

.gallery-4 .gallery-item {
    height: 173px;
}

/* 5+ Images Overlay */
.gallery-item-more {
    position: relative;
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    transition: background 0.2s ease;
}

.gallery-item-more:hover .gallery-overlay {
    background: rgba(15, 23, 42, 0.5);
}

.gallery-overlay-count {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 800;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

/* HTML5 & Iframe Video Player */
.campaign-video-wrap {
    border-radius: 14px;
    overflow: hidden;
    background: #000000;
    width: 100%;
    max-width: 100%;
}

.campaign-feed-video {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: contain;
    background: #000000;
    display: block;
    margin: 0 auto;
}

.campaign-media-section,
.campaign-media-gallery,
.gallery-item,
.gallery-column,
.gallery-hero {
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

/* Fullscreen Lightbox Modal */
.lightbox-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.94);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.lightbox-modal.active {
    display: flex;
    opacity: 1;
}

.lightbox-container {
    position: relative;
    max-width: 92vw;
    max-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 84vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    user-select: none;
}

.lightbox-close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    border: 0;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    z-index: 100002;
}

.lightbox-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.08);
}

.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    border: 0;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    z-index: 100001;
}

.lightbox-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.08);
}

.lightbox-prev-btn {
    left: 20px;
}

.lightbox-next-btn {
    right: 20px;
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    user-select: none;
    z-index: 100001;
}

/* Floating Share Toast Notification */
.share-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #10b981;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    z-index: 999999;
}

.share-toast.show {
    transform: translateY(0);
    opacity: 1;
}

@media (max-width: 576px) {
    .gallery-2 .gallery-item {
        height: 180px;
    }
    .gallery-3, .gallery-4 {
        height: 260px;
    }
    .gallery-3 .gallery-column .gallery-item,
    .gallery-4 .gallery-item {
        height: 128px;
    }
    .lightbox-nav-btn {
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
    }
    .lightbox-prev-btn { left: 8px; }
    .lightbox-next-btn { right: 8px; }
    .lightbox-close-btn { top: 12px; right: 12px; width: 38px; height: 38px; font-size: 1.2rem; }
}

@media (max-width: 480px) {
    .content-card, .feed-card .card-body {
        padding: 0.85rem;
    }
    .feed-social-bar {
        gap: 0.35rem;
        flex-wrap: wrap;
    }
    .feed-btn {
        padding: 0.45rem 0.6rem;
        font-size: 0.82rem;
    }
    .feed-social-bar .btn-gradient {
        width: 100%;
        text-align: center;
        margin-top: 0.35rem;
    }
}

@media (max-width: 360px) {
    .content-card, .feed-card .card-body {
        padding: 0.75rem 0.5rem;
    }
    .feed-social-info {
        font-size: 0.8rem;
    }
    .feed-btn {
        padding: 0.4rem 0.5rem;
        font-size: 0.78rem;
    }
}

/* User Profile & Avatar Styles */
.user-avatar-badge-sm {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-grid;
    place-items: center;
    line-height: 1;
}

/* Global Card and Input Addon Theme Rules */
.card {
    background-color: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 16px;
}
.input-group-text {
    background-color: var(--surface-hover);
    border-color: var(--border);
    color: var(--muted);
    font-size: 0.95rem;
}
.input-group:focus-within .input-group-text {
    border-color: var(--primary);
    color: var(--primary);
}
.text-body {
    color: var(--text) !important;
}
hr {
    border-color: var(--border);
    opacity: 0.6;
}

/* Universal Theme Overrides for Bootstrap Subtle Helpers */
[data-theme="dark"] .bg-body-tertiary {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: var(--text) !important;
}
[data-theme="light"] .bg-body-tertiary {
    background-color: #f8fafc !important;
    color: var(--text) !important;
}

[data-theme="dark"] .bg-primary-subtle {
    background-color: rgba(99, 102, 241, 0.2) !important;
    color: #a5b4fc !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
}
[data-theme="light"] .bg-primary-subtle {
    background-color: rgba(79, 70, 229, 0.1) !important;
    color: #4338ca !important;
    border-color: rgba(79, 70, 229, 0.2) !important;
}

[data-theme="dark"] .bg-success-subtle {
    background-color: rgba(16, 185, 129, 0.18) !important;
    color: #6ee7b7 !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}
[data-theme="light"] .bg-success-subtle {
    background-color: rgba(16, 185, 129, 0.12) !important;
    color: #065f46 !important;
    border-color: rgba(16, 185, 129, 0.25) !important;
}

[data-theme="dark"] .bg-danger-subtle {
    background-color: rgba(239, 68, 68, 0.18) !important;
    color: #fca5a5 !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}
[data-theme="light"] .bg-danger-subtle {
    background-color: rgba(239, 68, 68, 0.1) !important;
    color: #991b1b !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
}

[data-theme="dark"] .bg-warning-subtle {
    background-color: rgba(245, 158, 11, 0.18) !important;
    color: #fde68a !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}
[data-theme="light"] .bg-warning-subtle {
    background-color: rgba(245, 158, 11, 0.12) !important;
    color: #92400e !important;
    border-color: rgba(245, 158, 11, 0.25) !important;
}

[data-theme="dark"] .bg-secondary-subtle {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}
[data-theme="light"] .bg-secondary-subtle {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    border-color: #e2e8f0 !important;
}

[data-theme="dark"] .bg-info-subtle {
    background-color: rgba(6, 182, 212, 0.18) !important;
    color: #67e8f9 !important;
    border-color: rgba(6, 182, 212, 0.3) !important;
}
[data-theme="light"] .bg-info-subtle {
    background-color: rgba(6, 182, 212, 0.12) !important;
    color: #0e7490 !important;
    border-color: rgba(6, 182, 212, 0.25) !important;
}

[data-theme="dark"] .text-warning-emphasis {
    color: #fde68a !important;
}
[data-theme="dark"] .text-danger-emphasis {
    color: #fca5a5 !important;
}
[data-theme="dark"] .text-secondary-emphasis {
    color: #e2e8f0 !important;
}

/* User Profile & Avatar Styles */
.profile-header-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}
.profile-avatar-lg {
    width: 88px;
    height: 88px;
    border-radius: 26px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    font-size: 2.2rem;
    font-weight: 800;
    display: inline-grid;
    place-items: center;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.35);
    border: 3px solid var(--surface-solid);
}

.profile-nav-tabs-wrapper {
    overflow-x: auto;
    padding-bottom: 0.25rem;
}
.profile-nav-pills {
    padding: 0.35rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    display: inline-flex;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
}
.profile-nav-pills .nav-link {
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.55rem 1.25rem;
    font-weight: 600;
    font-size: 0.92rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.profile-nav-pills .nav-link:hover {
    color: var(--text);
    background: var(--surface-hover);
}
.profile-nav-pills .nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff !important;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.profile-nav-pills .nav-link-admin {
    color: #b45309 !important;
    border: 1px solid rgba(217, 119, 6, 0.35);
}
[data-theme="dark"] .profile-nav-pills .nav-link-admin {
    color: #fbbf24 !important;
    border-color: rgba(245, 158, 11, 0.35);
}
.profile-nav-pills .nav-link-admin:hover {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706 !important;
}
[data-theme="dark"] .profile-nav-pills .nav-link-admin:hover {
    color: #fde68a !important;
}
.profile-nav-pills .nav-link-admin.active {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: #ffffff !important;
    font-weight: 700;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.admin-portal-card {
    background: var(--surface);
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}
[data-theme="dark"] .admin-portal-card {
    border-color: rgba(245, 158, 11, 0.3) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.profile-theme-card {
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: var(--surface);
    border-radius: 14px;
    transition: all 0.2s ease;
}
.profile-theme-card:hover {
    border-color: var(--primary);
    background: var(--surface-hover);
    transform: translateY(-1px);
}
.profile-theme-card.is-active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.15);
}
[data-theme="dark"] .profile-theme-card.is-active {
    background: rgba(99, 102, 241, 0.15);
}

.admin-stat-card {
    border-radius: 14px;
    border: 1px solid var(--border) !important;
    background: var(--surface) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.admin-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}
.admin-module-card {
    border-radius: 14px;
    border: 1px solid var(--border) !important;
    background: var(--surface) !important;
    color: var(--text) !important;
    text-decoration: none !important;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.admin-module-card:hover {
    border-color: var(--primary) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.15);
}
.admin-module-card .text-muted,
.admin-module-card .muted {
    color: var(--muted) !important;
}

.recovery-code-badge {
    background: var(--surface-hover);
    color: var(--text);
    border: 1px solid var(--border);
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.hover-border-primary {
    transition: border-color 0.2s, transform 0.2s;
}
.hover-border-primary:hover {
    border-color: var(--primary) !important;
    transform: translateY(-2px);
}

/* ==========================================================================
   COMPREHENSIVE RESPONSIVE DESIGN SYSTEM (Mobile, Tablet, Desktop)
   ========================================================================== */

/* --- Mobile Navigation Dropdown (< 992px) --- */
@media (max-width: 991.98px) {
    .app-navbar .navbar-collapse {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 18px;
        padding: 1.15rem;
        margin-top: 0.85rem;
        box-shadow: 0 14px 35px rgba(0, 0, 0, 0.25);
    }
    .app-navbar .navbar-nav .nav-link {
        padding: 0.65rem 0.95rem;
        border-radius: 10px;
        font-weight: 600;
        min-height: 44px;
        display: flex;
        align-items: center;
        transition: background 0.15s ease, color 0.15s ease;
    }
    .app-navbar .navbar-nav .nav-link:hover,
    .app-navbar .navbar-nav .nav-link:focus {
        background: var(--surface-hover);
        color: var(--primary);
    }
    .app-navbar .nav-actions {
        border-top: 1px solid var(--border);
        padding-top: 0.85rem;
        margin-top: 0.65rem;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .navbar-toggler {
        min-width: 44px;
        min-height: 44px;
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 0.45rem 0.65rem;
        transition: all 0.2s ease;
    }
    .navbar-toggler:focus {
        box-shadow: 0 0 0 2px var(--primary);
        outline: none;
    }
}

/* --- Mobile Bottom App Bar Enhancements (< 768px) --- */
@media (max-width: 767.98px) {
    .mobile-nav {
        min-height: 62px;
        padding: 0.35rem 0.25rem max(0.35rem, env(safe-area-inset-bottom));
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    }
    .mobile-nav a {
        min-height: 48px;
        border-radius: 10px;
        transition: color 0.2s ease, transform 0.15s ease;
    }
    .mobile-nav a:active {
        transform: scale(0.94);
    }
    .mobile-nav a.active {
        color: var(--primary) !important;
        font-weight: 700;
    }
    .mobile-nav a.active i {
        transform: scale(1.18);
        transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
}

/* --- Touch Ergonomics & Form Accessibility (< 768px) --- */
@media (max-width: 767.98px) {
    /* Prevent iOS Safari automatic zoom on focus while maintaining touch target */
    .form-control,
    .form-select,
    textarea.form-control {
        font-size: 16px !important;
        min-height: 44px;
        border-radius: 12px;
    }
    textarea.form-control {
        min-height: 96px;
    }
    .form-control-sm,
    .form-select-sm {
        min-height: 38px;
        font-size: 14px !important;
    }
    .form-label {
        margin-bottom: 0.4rem;
        font-size: 0.92rem;
    }
    .btn {
        min-height: 44px;
        border-radius: 12px;
        font-size: 0.95rem;
    }
    .btn-sm {
        min-height: 38px;
        padding: 0.35rem 0.75rem;
        font-size: 0.85rem;
        border-radius: 10px;
    }
    .btn-lg {
        min-height: 48px;
        padding: 0.65rem 1.25rem;
    }
}

/* --- Rich Text Editor Mobile Ribbon Toolbar --- */
.rich-editor-wrap .btn-toolbar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    gap: 4px;
    scrollbar-width: thin;
}
.rich-editor-wrap .btn-toolbar::-webkit-scrollbar {
    height: 4px;
}
.rich-editor-wrap .btn-toolbar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 999px;
}
.rich-editor-wrap .btn-toolbar .btn {
    flex-shrink: 0;
    white-space: nowrap;
    min-height: 38px;
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
}

/* --- Responsive Media & Preformatted Blocks --- */
.campaign-description iframe,
.campaign-description video {
    width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: 16 / 9;
    height: auto !important;
    border-radius: 14px;
}
pre {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* --- Responsive Data Tables --- */
.table-responsive {
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}
.table-responsive::-webkit-scrollbar {
    height: 6px;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 999px;
}
@media (max-width: 767.98px) {
    .table > :not(caption) > * > * {
        padding: 0.65rem 0.55rem;
        font-size: 0.85rem;
    }
    .table th {
        font-size: 0.78rem;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }
    .table td .btn-sm {
        min-height: 34px;
        padding: 0.25rem 0.6rem;
        font-size: 0.8rem;
    }
}

/* --- Admin Offcanvas Mobile Navigation --- */
.offcanvas {
    background: var(--surface-solid);
    color: var(--text);
}
.offcanvas-header {
    border-color: var(--border) !important;
}
.offcanvas .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    color: var(--text);
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease;
}
.offcanvas .nav-link:hover,
.offcanvas .nav-link:focus {
    background: var(--surface-hover);
    color: var(--primary);
}
.offcanvas .nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
}

/* --- Mobile Viewports (<= 575.98px) --- */
@media (max-width: 575.98px) {
    .feed-card .card-body {
        padding: 1.15rem 0.95rem;
    }
    .feed-avatar {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }
    .feed-social-bar {
        gap: 0.4rem;
        flex-wrap: wrap;
    }
    .feed-social-bar .btn-gradient {
        width: 100%;
        text-align: center;
        order: 5;
        margin-top: 0.45rem;
        min-height: 44px;
    }
    .feed-btn {
        min-height: 40px;
        padding: 0.45rem 0.7rem;
        font-size: 0.84rem;
    }
    .campaign-discovery {
        padding: 0.85rem;
        border-radius: 14px;
    }
    .profile-avatar-lg {
        width: 72px;
        height: 72px;
        font-size: 1.8rem;
        border-radius: 22px;
    }
    .hero h1 {
        font-size: clamp(2rem, 7.5vw, 2.6rem);
    }
    .hero-copy {
        font-size: 1rem;
    }
}

/* --- Compact Mobile (<= 375px) --- */
@media (max-width: 375px) {
    .brand {
        font-size: 1.05rem;
        gap: 0.45rem;
    }
    .brand-mark {
        width: 34px;
        height: 34px;
    }
    .btn-search-toggle {
        width: 34px;
        height: 34px;
    }
    .content-card,
    .auth-card {
        padding: 1rem 0.75rem;
    }
    .feed-btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.78rem;
    }
    .feed-social-info {
        font-size: 0.78rem;
    }
}

/* --- Tablet Adaptations (768px – 1024px) --- */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        max-width: 960px;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
    .hero {
        padding: 4rem 0;
    }
    .hero h1 {
        font-size: 3.2rem;
    }
    .content-card {
        padding: 1.5rem;
    }
    .admin-main-content {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

