/* ============================================================
   assets/css/site.css - shared parts of the public pages:
   the "Get started" button in the top bar and the site footer.
   Uses each page's own colour variables, so light/dark themes work.
   ============================================================ */

/* ---------- "Get started" button (top bar, signed-out visitors) ---------- */
.btn-get-started {
    display: inline-block;
    padding: 0.45rem 1.5rem;
    border-radius: 100px;
    border: 1.5px solid #1e1b4b;
    background: #1e1b4b;
    color: #ffffff !important;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn-get-started:hover {
    transform: translateY(-2px);
    filter: brightness(1.2);
}

body.dark .btn-get-started {
    border-color: #f59e0b;
    background: #f59e0b;
    color: #1e1b4b !important;
}

#desktopAuthButtons {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* ---------- Site footer ---------- */
.site-footer {
    text-align: left;
    padding: 3rem 2rem 1.5rem;
    font-size: 0.875rem;
    border-top: 1px solid rgba(76, 29, 149, 0.1);
}

.site-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.6fr repeat(3, 1fr);
    gap: 2.5rem;
}

.site-footer-logo {
    font-size: 1.35rem;
    font-weight: 800;
    color: inherit;
    text-decoration: none;
}

.site-footer-tagline {
    margin: 0.35rem 0 0.75rem;
    font-weight: 600;
    color: #d97706;
}

.site-footer-about {
    margin: 0 0 1rem;
    line-height: 1.6;
    opacity: 0.85;
    max-width: 34ch;
}

.site-footer-col h4 {
    margin: 0 0 0.9rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.7;
}

.site-footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.6rem;
}

.site-footer-col a,
.site-footer-links a {
    color: inherit;
    text-decoration: none;
    opacity: 0.9;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.site-footer-col a:hover,
.site-footer-links a:hover {
    color: #d97706;
    opacity: 1;
}

.site-footer-bottom {
    max-width: 1200px;
    margin: 2.5rem auto 0;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(127, 127, 160, 0.25);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
    opacity: 0.85;
}

.site-footer-links {
    display: flex;
    gap: 1.25rem;
}

@media (max-width: 1024px) {
    .site-footer-inner {
        grid-template-columns: repeat(3, 1fr);
    }

    .site-footer-brand {
        grid-column: 1 / -1;
    }
}

/* ---------- Empty / no-results message: always centred ----------
   It is often rendered inside a card grid; spanning every column keeps it
   in the middle instead of sitting in the first grid cell. */
.no-results {
    grid-column: 1 / -1;
    justify-self: center;
    width: 100%;
    max-width: 560px;
    margin: 2rem auto;
    padding: 2.5rem 2rem;
    text-align: center;
    border: 1px dashed rgba(127, 127, 160, 0.35);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.6);
}

body.dark .no-results {
    background: rgba(255, 255, 255, 0.04);
}

.no-results p {
    margin: 0;
}

/* ---------- Share window (charities, groups, events) ---------- */
.share-sheet {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 12, 41, 0.6);
}

.share-sheet[hidden] {
    display: none;
}

.share-sheet-panel {
    position: relative;
    width: 100%;
    max-width: 460px;
    padding: 1.75rem;
    border-radius: 1rem;
    background: #ffffff;
    color: #1e1b4b;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

body.dark .share-sheet-panel {
    background: #1e1b4b;
    color: #e0e7ff;
}

.share-sheet-close {
    position: absolute;
    top: 0.6rem;
    right: 0.9rem;
    border: none;
    background: none;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
}

.share-sheet-panel h3 {
    margin: 0 0 0.25rem;
    font-size: 1.2rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.share-sheet-panel h3 i {
    color: #f59e0b;
}

.share-sheet-name {
    margin: 0 0 1.25rem;
    font-size: 0.9rem;
    opacity: 0.75;
}

.share-sheet-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.share-opt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    padding: 0.9rem 0.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(127, 127, 160, 0.25);
    color: inherit;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: transform 0.15s ease, background 0.15s ease;
}

.share-opt:hover {
    transform: translateY(-2px);
    background: rgba(245, 158, 11, 0.08);
}

.share-opt i {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #ffffff;
}

.share-whatsapp i { background: #25d366; }
.share-facebook i { background: #1877f2; }
.share-x i { background: #000000; }
.share-telegram i { background: #229ed9; }
.share-email i { background: #6b7280; }
.share-sms i { background: #f59e0b; }

.share-sheet-link {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.share-sheet-link input {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(127, 127, 160, 0.35);
    border-radius: 0.5rem;
    background: transparent;
    color: inherit;
    font-size: 0.85rem;
}

.share-sheet-link button,
.share-sheet-native {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 0.5rem;
    background: #1e1b4b;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
}

body.dark .share-sheet-link button,
body.dark .share-sheet-native {
    background: #f59e0b;
    color: #1e1b4b;
}

.share-sheet-native {
    width: 100%;
    margin-top: 0.75rem;
    background: transparent;
    color: inherit;
    border: 1px solid rgba(127, 127, 160, 0.35);
}

/* Share button on the cover image of charity and group pages */
.hero-share-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 100px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}

.hero-share-btn:hover {
    background: rgba(0, 0, 0, 0.75);
}

@media (max-width: 640px) {
    .hero-share-btn {
        top: 1rem;
        right: 1rem;
        padding: 0.45rem 0.8rem;
    }

    .hero-share-btn span {
        display: none;
    }
}

/* ---------- Brand name: "Simu" blue and "Charity" orange, as in the logo ---------- */
.brand-name {
    white-space: nowrap;
}

.brand-simu {
    color: #1d214f;
}

.brand-charity {
    color: #ef9020;
}

body.dark .brand-simu {
    color: #9aa8ff;
}

/* ---------- Donation QR code (admins) and "become a member?" (donors) ---------- */
.page-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.page-header-actions .btn-offline-record {
    margin-top: 0;
}

.btn-org-qr {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.6rem 1.1rem;
    border: none;
    border-radius: 0.5rem;
    background: #f59e0b;
    color: #1e1b4b;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.page-header-actions .btn-org-qr {
    margin-top: 0;
}

.qr-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 12, 41, 0.6);
}

.qr-modal[hidden] {
    display: none !important;
}

.qr-panel {
    position: relative;
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding: 1.6rem;
    border-radius: 1rem;
    background: #ffffff;
    color: #1e1b4b;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    text-align: center;
}

body.dark .qr-panel {
    background: #1e1b4b;
    color: #f3f4f6;
}

.qr-panel h3 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 0 0.35rem;
    font-size: 1.2rem;
}

.qr-panel h3 i {
    color: #ef9020;
}

.qr-close {
    position: absolute;
    top: 0.6rem;
    right: 0.9rem;
    border: none;
    background: none;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
}

.qr-intro {
    margin: 0 0 1rem;
    font-size: 0.88rem;
    opacity: 0.8;
}

.qr-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1rem;
    border-radius: 0.9rem;
    background: #ffffff;
    border: 2px solid #1d214f;
    color: #1d214f;
}

.qr-image {
    width: min(240px, 70vw);
    aspect-ratio: 1;
}

.qr-image svg {
    display: block;
    width: 100%;
    height: 100%;
}

.qr-org {
    font-size: 1.05rem;
}

.qr-scan {
    color: #ef9020;
    font-weight: 600;
    font-size: 0.9rem;
}

.qr-missing {
    padding: 2rem 1rem;
    font-size: 0.9rem;
}

.qr-link {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0 0.75rem;
}

.qr-link input {
    flex: 1;
    min-width: 0;
    padding: 0.55rem 0.7rem;
    border: 1px solid rgba(76, 29, 149, 0.2);
    border-radius: 0.5rem;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.82rem;
}

.qr-link button,
.qr-actions button,
.qr-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid rgba(76, 29, 149, 0.2);
    border-radius: 0.5rem;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

body.dark .qr-link input,
body.dark .qr-link button,
body.dark .qr-actions button,
body.dark .qr-actions a {
    border-color: rgba(245, 158, 11, 0.3);
}

.qr-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.qr-actions button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.qr-actions button:hover:not(:disabled),
.qr-actions a:hover,
.qr-link button:hover {
    border-color: #ef9020;
    color: #ef9020;
}

.qr-warning {
    margin: 0.9rem 0 0;
    padding: 0.6rem 0.8rem;
    border-radius: 0.5rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 0.82rem;
    text-align: left;
}

.join-after-panel {
    max-width: 400px;
}

.join-after-icon {
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(239, 144, 32, 0.15);
    color: #ef9020;
    font-size: 1.5rem;
}

.join-after-panel p {
    margin: 0.4rem 0 0.9rem;
    font-size: 0.95rem;
}

.join-after-benefits {
    list-style: none;
    margin: 0 0 1.2rem;
    padding: 0;
    text-align: left;
    font-size: 0.88rem;
}

.join-after-benefits li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0;
}

.join-after-benefits i {
    width: 1.2rem;
    color: #ef9020;
}

.join-after-actions .join-after-yes {
    border: none;
    background: #ef9020;
    color: #1d214f;
}

.join-after-actions .join-after-yes:hover {
    color: #1d214f;
    filter: brightness(1.05);
}

@media (max-width: 420px) {
    .qr-actions {
        grid-template-columns: 1fr;
    }
}

/* Payment form: the QR picture appears once a payment method is chosen */
#qrCodeImage[src=""],
#qrCodeImage:not([src]) {
    display: none;
}

/* The footer is always dark (navy in light mode), so "Simu" is white there */
.site-footer .brand-name .brand-simu {
    color: #ffffff;
}

/* ==========================================================================
   Readability fixes for light and dark mode (found by a contrast check)
   ========================================================================== */

/* Cards that are links: titles used the browser's link blue (unreadable in dark mode) */
html a.charity-card,
html a.group-card,
html a.event-card {
    color: var(--text-light-primary);
}

/* Light mode: the orange #f59e0b is too pale as text on white, so text gets a deeper
   orange. Buttons and icons keep the bright orange. */
html body.light .stat-number,
html body.light .stat-item .stat-number,
html body.light .content-card > h2,
html body.light .policy-card > h2,
html body.light .terms-card > h2,
html body.light .faq-category > h2,
html body.light .current-org-info > h3 {
    color: #d97706 !important;
}

html body.light .nav-links > a[style*="color-accent"],
html body.light .nav-links > a.active {
    color: #b45309 !important;
}

html body.light .nav-links a:hover,
html body.light .language-badge span,
html body.light .tab-btn.active,
html body.light .report-tab.active,
html body.light .settings-tab.active,
html body.light .item-badge,
html body.light .type-badge.group,
html body.light .profile-role,
html body.light .badge-warning,
html body.light .error-links a,
html body.light .join-link a,
html body.light .register-link a,
html body.light .form-options a.forgot-password,
html body.light a.contact-email,
html body.light .support-link,
html body.light a.read-more,
html body.light .team-title,
html body.light .section-header > a,
html body.light .resend-link,
html body.light .card-header > a.btn-secondary:not(:hover),
html body.light .btn-donate-goods:not(:hover):not(.btn),
html body.light .btn-join-group:not(:hover) {
    color: #b45309 !important;
}

/* Light mode: green and red badges */
html body.light .badge-success,
html body.light .badge-verified,
html body.light .registration-status.status-open,
html body.light .action-buttons-org a.btn.btn-donate-goods:not(:hover) {
    color: #047857 !important;
}

html body.light .badge-info,
html body.light .receipt-preview.action-btn {
    color: #1d4ed8 !important;
}

html body.light .badge-danger,
html body.light .badge-unverified {
    color: #b91c1c !important;
}

/* Dark mode: same badges, lighter text */
html body.dark .badge-info,
html body.dark .receipt-preview.action-btn {
    color: #93c5fd !important;
}

html body.dark .badge-danger,
html body.dark .badge-unverified {
    color: #fca5a5 !important;
}

html body.dark .org-kind-badge.registered {
    background: rgba(16, 185, 129, 0.18);
    color: #6ee7b7 !important;
}

html body.dark .org-kind-badge.manual {
    color: #fcd34d !important;
}

/* "Upcoming" status: white on a deeper green */
html .event-status.upcoming,
html .event-status-badge.upcoming {
    background: #047857 !important;
}

/* Light mode: orange text set inline on the element (links, headings).
   Matches "color:" only, not "background-color:". */
html body.light [style^="color: var(--color-accent)"]:not(i),
html body.light [style*="; color: var(--color-accent)"]:not(i),
html body.light [style*=";color: var(--color-accent)"]:not(i) {
    color: #b45309 !important;
}

html body.light .org-stat-value {
    color: #d97706 !important;
}

html body.light .current-org-info > h3,
html body.light .role-badge,
html body.light a.back-link,
html body.light .back-button > a,
html body.light .org-tab.active,
html body.light .org-code,
html body.light a.event-name-link,
html body.light .btn-outline-sm:not(:hover),
html body.light .btn-outline-org:not(:hover) {
    color: #b45309 !important;
}

html body.light .status-badge-upcoming {
    color: #047857 !important;
}

/* White text on bright green, blue and red buttons: deeper shades */
html .action-buttons > a.btn-attendee:not(:hover),
html .btn-export:not(:hover),
html .org-actions > .btn-added,
html .org-status-badge.approved {
    background-color: #047857 !important;
}

html .action-buttons > a.btn-edit:not(:hover),
html .org-actions > .btn-view:not(:hover) {
    background-color: #2563eb !important;
}

html .action-buttons > button.btn-delete:not(:hover),
html .org-actions > .btn-remove:not(:hover) {
    background-color: #dc2626 !important;
}

html body.light .action-buttons > button.btn-remove:not(:hover),
html body.light td > button.btn-remove:not(:hover) {
    color: #dc2626 !important;
}
