/**
 * Campaign Page Styles
 * Extracted from Pages/C/Campaign.cshtml
 */

/* ── Layout: sidebar pinned to physical LEFT + full-width main ─ */
.campaign-layout {
    display: flex;
    direction: ltr; /* force LTR flex ordering regardless of page dir="rtl" */
    align-items: flex-start;
    gap: 0;
    position: relative;
    width: 100%;
}

/* Restore RTL inside the children */
.campaign-sidebar,
.campaign-main {
    direction: rtl;
}

/* SIDEBAR — fixed on physical left on desktop */
.campaign-sidebar {
    display: none; /* hidden on mobile — bottom bar used instead */
}

@media (min-width: 992px) {
    .campaign-sidebar {
        display: block;
        position: fixed;
        top: 47px; /* navbar + sticky tabs bar + gap */
        left: max(0px, calc((100vw - 1400px) / 2)); /* aligned to layout left edge */
        width: 300px;
        overflow-y: hidden;
        padding: 0 1rem 2rem;
        z-index: 10;
    }

    /* Cards inside sidebar always fill width, text never overflows */
    .campaign-sidebar .card {
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }
    .campaign-sidebar .card-body {
        overflow: hidden;
        word-break: break-word;
    }

    /* Constrain the layout to a readable max-width on large screens */
    .campaign-layout {
        max-width: 1400px;
        margin-inline: auto;
        padding-left: 300px; /* reserve space for the fixed sidebar */
    }
}

/* Wider sidebar on xl screens */
@media (min-width: 1200px) {
    .campaign-sidebar {
        width: 340px;
    }

    .campaign-layout {
        padding-left: 340px;
    }
}

/* MAIN CONTENT — takes all remaining space */
.campaign-main {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    padding: 0 1.5rem 2rem 1rem;
}

@media (max-width: 991.98px) {
    .campaign-main {
        padding: 0 1rem 8rem; /* bottom padding for mobile bar */
        width: 100%;
    }
}

/* ── All donors / ambassadors section ──────────────────────── */
.all-tables-section {
    background: #f8fafc;
}

.all-tables-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (min-width: 992px) {
    .all-tables-container {
        padding-left: calc(300px + 1.5rem); /* align with campaign-main on desktop */
    }
}

@media (min-width: 1200px) {
    .all-tables-container {
        padding-left: calc(340px + 1.5rem);
    }
}

@media (max-width: 991.98px) {
    .all-tables-section {
        padding-bottom: 7rem; /* clear mobile sticky bar */
    }
}

/* (table styles removed — now using card grid layout) */

/* pager buttons */
.pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
}
.pager-btn:hover:not(:disabled) { background: #f1f5f9; border-color: #cbd5e1; }
.pager-btn.active, .pager-btn:disabled { background: var(--ir-primary, #2563eb); color: #fff; border-color: var(--ir-primary, #2563eb); cursor: default; }
.pager-ellipsis { padding: 0 4px; color: #94a3b8; font-size: 0.85rem; }

/* ── Donor / Ambassador card grid ─────────────────────────── */
.donor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 1rem;
}

@media (max-width: 767.98px) {
    .donor-grid { grid-template-columns: 1fr; }
}

.donor-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.donor-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
}

.donor-card__avatar {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.donor-card__avatar--anon {
    background: #f1f5f9;
    color: #94a3b8;
}

.donor-card__body {
    flex: 1;
    min-width: 0;
}

.donor-card__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.donor-card__name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.donor-card__name--anon {
    color: #94a3b8;
    font-style: italic;
}

.donor-card__amount {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--ir-primary, #2563eb);
    white-space: nowrap;
    flex-shrink: 0;
}

.donor-card__meta {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 2px;
}

.donor-card__meta .fundraiser-link {
    color: #64748b;
    font-weight: 500;
}

.donor-card__note {
    font-size: 0.82rem;
    color: #475569;
    font-style: italic;
    margin-top: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Ambassador-specific: medal badges for top 3 */
.donor-card__avatar--gold   { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.donor-card__avatar--silver { background: linear-gradient(135deg, #d1d5db, #9ca3af); color: #fff; }
.donor-card__avatar--bronze { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; }

.donor-card__donations {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 2px;
}

/* ── Share grid in sidebar ──────────────────────────────────── */
.share-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
    line-height: 1;
}

.share-btn:hover {
    color: #fff;
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.share-btn i, .share-btn svg { font-size: 1.25rem; }

.share-btn__icon { width: 1.25rem; height: 1.25rem; }

.share-btn--facebook  { background: #1877f2; }
.share-btn--tiktok    { background: #010101; }
.share-btn--threads   { background: #000000; }
.share-btn--linkedin  { background: #0077b5; }
.share-btn--whatsapp  { background: #25d366; }
.share-btn--copy      { background: #64748b; }

/* ── Mobile bottom bar ──────────────────────────────────────── */
.campaign-mobile-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.13);
}

.mobile-share-group {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.mobile-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.mobile-share-btn:hover { color: #fff; transform: scale(1.1); }

/* ── Referral Banner ────────────────────────────────────────── */
.referral-banner {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px solid var(--ir-primary, #2563eb);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.referral-banner i {
    color: var(--ir-primary, #2563eb);
    font-size: 1.25rem;
}

/* ── Hero overlay panel tweaks ────────────────────────────── */
@media (min-width: 992px) {
    .hero-info-overlay .row {
        justify-content: space-between;
    }
    .hero-info-overlay .col-lg-7 {
        max-width: calc(58.333% - 0.5rem);
    }
    .hero-info-overlay .col-lg-5 {
        max-width: calc(41.667% - 0.5rem);
    }
}

/* ── Campaign rich content ──────────────────────────────────── */
.campaign-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.campaign-content p { line-height: 1.8; margin-bottom: 1rem; max-width:100%!important}

.campaign-content h1, .campaign-content h2,
.campaign-content h3, .campaign-content h4,
.campaign-content h5, .campaign-content h6 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.campaign-content ul, .campaign-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.campaign-content blockquote {
    border-left: 4px solid var(--ir-primary, #2563eb);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--ir-gray-600, #64748b);
}

/* ── Campaign nav bar (title + pills) ──────────────────────── */
.campaign-nav-bar {
    padding: 0.75rem 0;
}

.campaign-nav-title {
    font-size: 1.35rem;
    color: var(--ir-dark, #0f172a);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

@media (min-width: 576px) {
    .campaign-nav-bar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 1rem;
        padding: 0.75rem 0;
    }
    .campaign-nav-bar .container {
        display: flex;
        align-items: center;
        gap: 1.25rem;
    }
    .campaign-nav-title {
        margin-bottom: 0;
        flex-shrink: 0;
        max-width: 40%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (min-width: 768px) {
    .campaign-nav-title {
        font-size: 1.5rem;
        max-width: 50%;
    }
}

/* ── Nav pills ──────────────────────────────────────────────── */
.ratio iframe { border-radius: 8px; }

.nav-pills .nav-link {
    border-radius: 50px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-pills .nav-link:not(.active) {
    background: #f1f5f9;
    color: var(--ir-dark, #0f172a);
}

.nav-pills .nav-link:not(.active):hover { background: #e2e8f0; }
.nav-pills .nav-link.active { background: var(--ir-primary, #2563eb); }

/* ── Countdown ──────────────────────────────────────────────── */
.countdown-display { font-family: 'Courier New', monospace; font-weight: 600; }

/* ── Team / Member avatars ──────────────────────────────────── */
.team-avatar {
    width: 60px; height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 1.5rem; font-weight: 600; flex-shrink: 0;
}

.team-initials { display: block; line-height: 1; }

.team-card {
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background: white;
}

.team-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-4px);
    border-color: var(--ir-primary, #2563eb);
}

.team-member-avatars { gap: -8px; }

.member-avatar, .member-avatar-small {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 0.75rem; font-weight: 600;
    border: 2px solid white;
    margin-left: -8px; flex-shrink: 0;
}

.member-avatar-small { width: 28px; height: 28px; font-size: 0.7rem; }
.member-avatar:first-child { margin-left: 0; }
.member-avatar.member-count { background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%); font-size: 0.7rem; }

/* ── Matcher cards ──────────────────────────────────────────── */
.matcher-card {
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid transparent;
}

.matcher-card:hover {
    background: white;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-4px);
    border-color: var(--ir-primary, #2563eb);
}

.matcher-decoration { transition: all 0.3s ease; }
.matcher-card:hover .matcher-decoration { opacity: 0.15; transform: scale(1.1); }

.matching-pool-summary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.bg-gradient-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.matcher-icon .rounded-circle { box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); }

/* ── List group ─────────────────────────────────────────────── */
.list-group-item { border-left: none; border-right: none; }
.list-group-item:first-child { border-top: none; }
.list-group-item:last-child { border-bottom: none; }

/* ── Modals ─────────────────────────────────────────────────── */
.modal-lg { max-width: 800px; }
.progress-bar.bg-gradient { background: linear-gradient(90deg, #667eea 0%, #764ba2 100%); }

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ── Campaign hero wrapper ──────────────────────────────────── */
.campaign-hero {
    display: block;
    position: relative;
    overflow: hidden;
}

/* ── Hero info overlay ─────────────────────────────────────── */
.hero-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.3) 60%, transparent 100%);
    padding: 2.5rem 0 5rem;
    z-index: 3;
    color: #fff;
}

/* Semi-transparent panels behind text for readability */
.hero-info-overlay .col-sm-7,
.hero-info-overlay .col-sm-5 {
    position: relative;
    padding: 1rem 1.5rem;
}

.hero-info-overlay .col-sm-7 > *,
.hero-info-overlay .col-sm-5 > div {
    position: relative;
    z-index: 1;
}

.hero-info-overlay .col-sm-7::before,
.hero-info-overlay .col-sm-5::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 14px;
    z-index: 0;
}

/* Raised amount — accent color */
.hero-info-overlay .hero-raised-amount {
    color: #4ade80;
}

.hero-info-secondary {
    color: rgba(255,255,255,0.7);
}

.hero-info-overlay .progress {
    background-color: rgba(255,255,255,0.2);
}

.hero-info-overlay .countdown-display {
    color: #fff;
}

/* Mobile: overlay becomes a normal block below the hero */
@media (max-width: 991.98px) {
    .hero-info-overlay {
        position: relative;
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        padding: 1.25rem 0.5rem 4.5rem;
    }

    /* No frosted panels needed on solid dark bg */
    .hero-info-overlay .col-sm-7::before,
    .hero-info-overlay .col-sm-5::before {
        display: none;
    }

    .hero-info-overlay .col-sm-7,
    .hero-info-overlay .col-sm-5 {
        padding: 0.5rem 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .hero-info-overlay {
        padding: 1rem 0.25rem 4.5rem;
    }
}

/* ── Hero slideshow ─────────────────────────────────────────── */
.hero-slideshow {
    position: relative;
    width: 100%;
    height: 80vh;
    overflow: hidden;
    background: #000;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
    background-size: 100% 100% !important;
    background-position: center !important;
}

.hero-slide--active { opacity: 1; }

.hero-slide__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.15);
}

.hero-placeholder-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5rem;
    color: rgba(255,255,255,0.3);
}

/* Arrow controls */
.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 6;
    background: rgba(0,0,0,0.4);
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease;
    pointer-events: none;
}

.campaign-hero:hover .hero-arrow {
    opacity: 1;
    pointer-events: auto;
}

.hero-arrow:hover {
    background: rgba(0,0,0,0.65);
}

.hero-arrow--prev { left: 14px; }
.hero-arrow--next { right: 14px; }

/* Dot indicators */
.hero-dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 7px;
    z-index: 5;
}

.hero-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.45);
    transition: background 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

.hero-dot--active {
    background: #fff;
    transform: scale(1.3);
}

@media (max-width: 575.98px) {
    .hero-slideshow { height: 240px; }
}
