/**
 * AYPC Daylight / Dark theme
 * Toggle sets data-theme="dark|light" on <html>.
 */

:root {
    color-scheme: light;
}

/* Toggle control */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 2.4rem;
    min-height: 2.4rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 77, 42, 0.18);
    background: #f3f7f4;
    color: #0f4d2a;
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle:hover {
    background: #e8f5ec;
    border-color: rgba(15, 77, 42, 0.35);
}

.theme-toggle:focus-visible {
    outline: 2px solid #1b7a3a;
    outline-offset: 2px;
}

.theme-toggle-icon {
    display: none;
    line-height: 0;
}

.theme-toggle-text {
    display: none;
}

html:not([data-theme="dark"]) .theme-toggle-icon--moon,
html:not([data-theme="dark"]) .theme-toggle-text--light {
    display: inline-flex;
}

html[data-theme="dark"] .theme-toggle-icon--sun,
html[data-theme="dark"] .theme-toggle-text--dark {
    display: inline-flex;
}

.site-header .theme-toggle,
.admin-topbar .theme-toggle {
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .theme-toggle-text {
        display: none !important;
    }
}

/* ========== Dark theme ========== */
html[data-theme="dark"] {
    color-scheme: dark;
    --green-100: #163528;
    --gray-100: #1c2420;
    --gray-300: #3d4a43;
    --gray-500: #9ca3af;
    --gray-700: #d1d5db;
    --gray-900: #e8ece9;
    --black: #f3f4f6;
    --white: #121816;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] body {
    background: #0d1210;
    color: #e5e7eb;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4 {
    color: #f3f4f6;
}

html[data-theme="dark"] a {
    color: #6ee7a0;
}

html[data-theme="dark"] a:hover {
    color: #a7f3c0;
}

/* Public header */
html[data-theme="dark"] .site-header {
    background: rgba(13, 22, 18, 0.96);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .brand-name {
    color: #f3f4f6;
}

html[data-theme="dark"] .site-nav a:not(.btn),
html[data-theme="dark"] .nav-primary > li > a {
    color: #d1d5db;
}

html[data-theme="dark"] .site-nav a:not(.btn):hover,
html[data-theme="dark"] .site-nav a:not(.btn).active,
html[data-theme="dark"] .nav-primary > li > a:hover,
html[data-theme="dark"] .nav-primary > li > a.active,
html[data-theme="dark"] .nav-primary > li.active > a {
    color: #86efac;
    background: rgba(110, 231, 160, 0.12);
}

html[data-theme="dark"] .nav-dropdown {
    background: #15201b;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-md);
}

html[data-theme="dark"] .nav-dropdown a {
    color: #d1d5db;
}

html[data-theme="dark"] .nav-dropdown a:hover,
html[data-theme="dark"] .nav-dropdown a.active {
    background: rgba(110, 231, 160, 0.12);
    color: #86efac;
}

html[data-theme="dark"] .nav-toggle span {
    background: #e5e7eb;
}

html[data-theme="dark"] .site-nav.open {
    background: #15201b;
}

html[data-theme="dark"] .btn-outline-dark {
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.35);
}

html[data-theme="dark"] .btn-outline-dark:hover {
    background: #e5e7eb;
    color: #0d1210;
}

html[data-theme="dark"] .theme-toggle {
    background: #1a2822;
    border-color: rgba(110, 231, 160, 0.28);
    color: #a7f3c0;
}

html[data-theme="dark"] .theme-toggle:hover {
    background: #22352c;
    border-color: rgba(110, 231, 160, 0.5);
}

/* Public page surfaces */
html[data-theme="dark"] .page-hero,
html[data-theme="dark"] .section,
html[data-theme="dark"] .content-section {
    background: transparent;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .membership-box,
html[data-theme="dark"] .membership-mini-card,
html[data-theme="dark"] .membership-value-card,
html[data-theme="dark"] .membership-mission-card,
html[data-theme="dark"] .induction-pack-card,
html[data-theme="dark"] .induction-payment-card,
html[data-theme="dark"] .info-card,
html[data-theme="dark"] .feature-card {
    background: #15201b;
    border-color: rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
}

/* Keep induction pack titles black in dark mode */
html[data-theme="dark"] .induction-pack-header h3 {
    color: #111 !important;
}

html[data-theme="dark"] .site-footer {
    background: #0a100d;
    color: #d1d5db;
}

html[data-theme="dark"] .site-footer a {
    color: #a7f3c0;
}

html[data-theme="dark"] .footer-bottom {
    border-top-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .form-group label,
html[data-theme="dark"] label {
    color: #d1d5db;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background: #121a16;
    color: #f3f4f6;
    border-color: #3d4a43;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #8b9690;
}

html[data-theme="dark"] .alert-success {
    background: #143524;
    color: #bbf7d0;
    border-color: rgba(110, 231, 160, 0.25);
}

html[data-theme="dark"] .alert-error {
    background: #3f1515;
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.3);
}

/* Admin / member portal */
html[data-theme="dark"] .admin-body {
    background: #0d1210;
    color: #e5e7eb;
}

html[data-theme="dark"] .admin-content-wrap {
    background: #0d1210;
}

html[data-theme="dark"] .admin-topbar {
    background: #15201b;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .admin-topbar-greeting {
    color: #f3f4f6;
}

html[data-theme="dark"] .admin-topbar-role,
html[data-theme="dark"] .admin-datetime {
    color: #9ca3af;
}

html[data-theme="dark"] .admin-menu-toggle {
    border-color: #3d4a43;
    color: #e5e7eb;
    background: #1a2822;
}

html[data-theme="dark"] .admin-page-banner {
    background: linear-gradient(135deg, #0f2d1c, #163528);
}

html[data-theme="dark"] .admin-main {
    background: transparent;
}

html[data-theme="dark"] .admin-panel,
html[data-theme="dark"] .admin-stat-card,
html[data-theme="dark"] .widget-card {
    background: #15201b;
    border-color: rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
    box-shadow: none;
}

html[data-theme="dark"] .admin-panel-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .admin-panel-header h2,
html[data-theme="dark"] .admin-panel-subtitle {
    color: #e5e7eb;
}

html[data-theme="dark"] .admin-panel-subtitle {
    opacity: 0.75;
}

html[data-theme="dark"] .admin-table th {
    background: #1a2822;
    color: #a7f3c0;
    border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .admin-table td {
    border-color: rgba(255, 255, 255, 0.06);
    color: #e5e7eb;
}

html[data-theme="dark"] .admin-table tr:hover td {
    background: rgba(110, 231, 160, 0.05);
}

html[data-theme="dark"] .admin-table-scroll .admin-table thead th {
    background: #1a2822;
}

html[data-theme="dark"] .admin-filter-tab {
    background: #1a2822;
    border-color: rgba(255, 255, 255, 0.1);
    color: #d1d5db;
}

html[data-theme="dark"] .admin-filter-tab.active,
html[data-theme="dark"] .admin-filter-tab:hover {
    background: #1b7a3a;
    border-color: #1b7a3a;
    color: #fff;
}

html[data-theme="dark"] .admin-empty-state {
    color: #9ca3af;
}

html[data-theme="dark"] .admin-footer {
    background: #0a100d;
    border-top-color: rgba(255, 255, 255, 0.08);
    color: #9ca3af;
}

html[data-theme="dark"] .admin-login-body {
    background: #0d1210;
}

html[data-theme="dark"] .admin-login-card {
    background: #15201b;
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .admin-muted,
html[data-theme="dark"] .form-help,
html[data-theme="dark"] small.form-help {
    color: #9ca3af;
}

html[data-theme="dark"] .portal-lang-select {
    background: #1a2822;
    color: #e5e7eb;
    border-color: #3d4a43;
}

/* Member induction / misc panels */
html[data-theme="dark"] .induction-member-card,
html[data-theme="dark"] .induction-bank-box,
html[data-theme="dark"] .induction-online-box,
html[data-theme="dark"] .payment-summary-box,
html[data-theme="dark"] .induction-bank-grid div {
    background: #1a2822;
    border-color: rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
}

html[data-theme="dark"] .induction-member-card h3,
html[data-theme="dark"] .induction-bank-box h3,
html[data-theme="dark"] .induction-online-box h3,
html[data-theme="dark"] .induction-member-price strong {
    color: #a7f3c0;
}

html[data-theme="dark"] .induction-method-tab {
    background: #1a2822;
    border-color: rgba(255, 255, 255, 0.12);
    color: #d1d5db;
}

html[data-theme="dark"] .induction-method-tab.is-active {
    background: #0f4d2a;
    border-color: #0f4d2a;
    color: #fff;
}

html[data-theme="dark"] .induction-method-hint {
    background: #143524;
    color: #bbf7d0;
    border-color: rgba(110, 231, 160, 0.2);
}
