/* ============================================================
   Goga Jhar Veer Committee - Shared Styles
   Theme: Deep navy + brushed gold, mobile-first
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700&family=Hind:wght@400;500;600;700&display=swap');

:root {
    --bg: #0A1120;
    --bg-alt: #0D1830;
    --surface: #111F3D;
    --surface-2: #16294D;
    --border: #223258;
    --gold: #C9A24B;
    --gold-soft: #E4C77E;
    --text: #ECE9DE;
    --text-muted: #8B96B3;
    --success: #4CAF82;
    --success-bg: rgba(76, 175, 130, 0.14);
    --pending: #E0A458;
    --pending-bg: rgba(224, 164, 88, 0.14);
    --danger: #E0715F;
    --radius: 14px;
    --shadow: 0 8px 24px rgba(0,0,0,0.35);
    --font-display: 'Baloo 2', 'Hind', sans-serif;
    --font-body: 'Hind', 'Baloo 2', sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: radial-gradient(ellipse at top, var(--bg-alt) 0%, var(--bg) 60%);
    color: var(--text);
    font-family: var(--font-body);
    -webkit-tap-highlight-color: transparent;
}

body { min-height: 100vh; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--gold-soft);
    margin: 0 0 8px;
    line-height: 1.25;
    font-weight: 600;
}

a { color: var(--gold-soft); text-decoration: none; }

p { line-height: 1.6; color: var(--text-muted); }

::selection { background: var(--gold); color: #10131c; }

/* ---------- layout ---------- */
.page {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 16px 60px;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 16px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(201,162,75,0.08), transparent);
}

.topbar .emblem {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--gold-soft), var(--gold));
    display: flex; align-items: center; justify-content: center;
    color: #101a30; font-weight: 700; font-family: var(--font-display);
    flex-shrink: 0;
}

.topbar .title { font-family: var(--font-display); font-size: 18px; color: var(--gold-soft); }
.topbar .subtitle { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

/* ---------- card ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--gold);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.card h2 { font-size: 20px; }
.card h3 { font-size: 16px; margin-bottom: 4px; }

/* ---------- forms ---------- */
.form-group { margin-bottom: 18px; }

label {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

input[type=text], input[type=tel], input[type=number],
input[type=date], input[type=password], input[type=email],
select, textarea {
    width: 100%;
    padding: 13px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    transition: border-color .15s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--gold);
}

.radio-group { display: flex; flex-direction: column; gap: 10px; }
.radio-option {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
}
.radio-option input { width: auto; accent-color: var(--gold); }
.radio-option.selected { border-color: var(--gold); background: rgba(201,162,75,0.08); }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 18px;
    border-radius: 10px;
    border: none;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: transform .1s, opacity .15s;
    text-align: center;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: linear-gradient(135deg, var(--gold-soft), var(--gold)); color: #101a30; }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-success { background: var(--success); color: #08251a; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-sm { width: auto; padding: 8px 14px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- badges ---------- */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.badge-paid { background: var(--success-bg); color: var(--success); }
.badge-pending { background: var(--pending-bg); color: var(--pending); }

/* ---------- table (used inside admin, wrapped for mobile) ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }

/* ---------- stat grid (admin dashboard) ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}
.stat-card .num { font-family: var(--font-display); font-size: 26px; color: var(--gold-soft); }
.stat-card .lbl { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ---------- member row list ---------- */
.member-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 10px;
}
.member-row .name { font-weight: 600; }
.member-row .meta { font-size: 12px; color: var(--text-muted); }

/* ---------- alerts ---------- */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success); }
.alert-error { background: rgba(224,113,95,0.12); color: var(--danger); border: 1px solid var(--danger); }

/* ---------- misc ---------- */
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.muted { color: var(--text-muted); font-size: 13px; }
.center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }

footer.site-footer {
    text-align: center;
    padding: 24px 16px;
    color: var(--text-muted);
    font-size: 12px;
}

@media (min-width: 640px) {
    .page { padding-top: 40px; }
}

/* ---------- app-like bottom navigation ---------- */
.page-with-bottom-nav { padding-bottom: 90px; }

/* ---------- admin top nav (also reused on reports.php when viewed by an admin) ---------- */
.admin-nav {
    display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 40;
}
.admin-nav a {
    padding: 8px 14px; border-radius: 8px; font-size: 13px; white-space: nowrap;
    color: var(--text-muted); font-weight: 600;
}
.admin-nav a.active, .admin-nav a:hover { background: var(--surface-2); color: var(--gold-soft); }

.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    display: flex;
    background: rgba(17, 31, 61, 0.92);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    z-index: 50;
}
.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 2px;
    font-size: 11px;
    color: var(--text-muted);
    border-radius: 10px;
}
.bottom-nav a span.ico { font-size: 20px; line-height: 1; }
.bottom-nav a.active { color: var(--gold-soft); background: rgba(201,162,75,0.1); }

/* ---------- home hero ---------- */
.hero {
    position: relative;
    text-align: center;
    padding: 28px 16px 20px;
    overflow: hidden;
    border-radius: var(--radius);
    background: linear-gradient(160deg, var(--surface-2), var(--surface));
    border: 1px solid var(--border);
    margin-bottom: 18px;
}
.hero .motif { width: 84px; height: 84px; margin: 0 auto 10px; opacity: 0.95; }
.hero .motif.rotating { animation: heroRotate linear infinite; }
@keyframes heroRotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.hero h1 { font-size: 22px; margin-bottom: 4px; }
.hero p { color: var(--gold-soft); opacity: 0.85; font-size: 13px; margin: 0; }

/* ---------- quick search ---------- */
.search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}
.search-box input { flex: 1; }
.search-box button {
    width: auto;
    padding: 0 18px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--gold-soft);
    font-size: 18px;
}

/* ---------- icon grid (home dashboard) ---------- */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.icon-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: transform .12s, border-color .15s;
}
.icon-tile:active { transform: scale(0.96); }
.icon-tile .ico {
    width: 46px; height: 46px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    background: linear-gradient(135deg, var(--gold-soft), var(--gold));
    color: #101a30;
}
.icon-tile .lbl { font-size: 13px; font-weight: 600; color: var(--text); }
.icon-tile.admin-tile { border-style: dashed; opacity: 0.85; }
.icon-tile.admin-tile .ico { background: var(--surface-2); color: var(--gold-soft); }

/* ---------- print / PDF report styles ---------- */
.print-only { display: none; }

@media print {
    .bottom-nav, .topbar, .search-box, .btn, form, .no-print { display: none !important; }
    body { background: #fff !important; color: #111 !important; }
    .page { padding: 0 !important; max-width: 100%; }
    .print-only { display: block !important; }
    .card { border: 1px solid #ccc !important; box-shadow: none !important; background: #fff !important; border-left: 3px solid #C9A24B !important; }
    h1, h2, h3, h4 { color: #101a30 !important; }
    table { color: #111; }
    th, td { border-bottom: 1px solid #ddd !important; color: #111 !important; }
    .badge-paid { background: #dff5e8 !important; color: #1c7a45 !important; }
    .badge-pending { background: #fdf0dd !important; color: #a8641a !important; }
}

/* Fallback for mobile "Print/Share to PDF" flows that don't honour @media print -
   toggled via JS (see reports.php) right before window.print() is called */
body.printing .bottom-nav, body.printing .topbar, body.printing .search-box,
body.printing .btn, body.printing form, body.printing .no-print { display: none !important; }
body.printing { background: #fff !important; color: #111 !important; }
body.printing .page { padding: 0 !important; max-width: 100%; }
body.printing .print-only { display: block !important; }
body.printing .card { border: 1px solid #ccc !important; box-shadow: none !important; background: #fff !important; border-left: 3px solid #C9A24B !important; }
body.printing h1, body.printing h2, body.printing h3, body.printing h4 { color: #101a30 !important; }
body.printing th, body.printing td { border-bottom: 1px solid #ddd !important; color: #111 !important; }

/* ---------- pending highlight on home page ---------- */
@keyframes pulseRed {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}
.pending-alert-card {
    background: rgba(224,113,95,0.08);
    border: 1px solid var(--danger);
    border-left: 3px solid var(--danger);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}
.pending-alert-card h3 {
    color: var(--danger);
    margin-bottom: 12px;
    animation: attnBlink 1s ease-in-out infinite;
}
.pending-member-list { display: flex; flex-direction: column; gap: 8px; }
.pending-member-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(224,113,95,0.12);
    border: 1px solid rgba(224,113,95,0.4);
    border-radius: 10px;
    padding: 10px 12px;
    animation: pulseRed 1.2s ease-in-out infinite;
}
.pending-member-row .dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--danger); flex-shrink: 0;
    animation: dotBlink 0.9s ease-in-out infinite;
}
@keyframes dotBlink {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(224,113,95,0.7); }
    50% { opacity: 0.3; transform: scale(1.3); box-shadow: 0 0 0 4px rgba(224,113,95,0); }
}
.pending-member-row .pname { font-weight: 600; color: #ffcfc4; font-size: 14px; }
.pending-member-row .pamt { margin-left: auto; font-size: 12px; color: var(--danger); font-weight: 700; }

/* ---------- call / whatsapp action buttons ---------- */
@keyframes attnBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}
.btn-call {
    background: #1FAA59; color: #fff; border: none;
    animation: attnBlink 1.4s ease-in-out infinite;
}
.btn-whatsapp {
    background: #25D366; color: #08301b; border: none;
    animation: attnBlink 1.4s ease-in-out infinite;
}
.action-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.action-row .btn { flex: 1; min-width: 90px; }
.inline-emi-form { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.inline-emi-form .form-group { flex: 1; margin-bottom: 0; }

/* ---------- marquee ticker ---------- */
.marquee-wrap {
    overflow: hidden;
    white-space: nowrap;
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    border-radius: 8px;
}
.marquee-track {
    display: inline-block;
    padding-left: 100%;
    animation: marqueeScroll linear infinite;
}
@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}
