/* Tayyab Snacks — Halal Snack & Packaged Food Contribution Design System (Material Design 3 structure) */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700;800&display=swap');
:root {
    --green-deep:   #0a3d1f;
    --green-mid:    #1a5c33;
    --green-light:  #2d7a4a;
    --amber:        #d4770a;
    --amber-light:  #f59e0b;
    --gold:         #d4af5a;
    --gold-dark:    #b8973b;
    --cream:        #fdf8f3;
    --white:        #ffffff;
    --text:         #1a1a1a;
    --text-mid:     #555;
    --text-light:   #888;
    --border:       #e5ddd4;
    /* M3 elevation scale: level 1 (resting cards) and level 3 (hover/dialogs) */
    --shadow:       0 1px 2px rgba(0,0,0,.30), 0 1px 3px 1px rgba(0,0,0,.15);
    --shadow-lg:    0 1px 3px rgba(0,0,0,.30), 0 4px 8px 3px rgba(0,0,0,.15);
    /* M3 shape scale */
    --radius-sm:    8px;
    --radius:       14px;
    --radius-lg:    16px;
    --radius-full:  999px;
    --transition:   .2s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Roboto', 'Segoe UI', system-ui, sans-serif; background: var(--cream); color: var(--text); line-height: 1.6; }
a { color: var(--green-mid); text-decoration: none; }
a:hover { color: var(--gold-dark); }
img { max-width: 100%; height: auto; display: block; }

/* ── Navbar ── */
.navbar { background: var(--green-deep); padding: 0 1.5rem; display: flex; align-items: center; justify-content: space-between; height: 64px; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 12px rgba(0,0,0,.25); }
.nav-brand { font-size: 1.4rem; font-weight: 800; color: var(--gold); }
.nav-brand span { color: rgba(255,255,255,.7); font-weight: 400; }
.nav-links { display: flex; align-items: center; gap: 1.3rem; }
.nav-links a { color: rgba(255,255,255,.8); font-size: .9rem; font-weight: 500; padding: .4rem .8rem; border-radius: 6px; transition: var(--transition); }
.nav-links a:hover { background: rgba(255,255,255,.1); color: var(--gold); }
.nav-btn { background: var(--gold) !important; color: var(--green-deep) !important; font-weight: 700 !important; border-radius: 20px !important; }
.nav-user {
    display: inline-flex; align-items: center; gap: .3rem;
    color: var(--gold); font-size: .85rem; font-weight: 600;
    padding: .35rem .7rem; background: rgba(255,255,255,.08); border-radius: var(--radius-full);
    white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis;
}

/* ── Hero ── */
.hero {
    background: linear-gradient(135deg, var(--green-deep) 0%, #1a5c33 50%, #0f3d22 100%);
    color: var(--white); padding: 5rem 1.5rem; text-align: center; position: relative; overflow: hidden;
}
.hero::after { content: '🌿'; position: absolute; right: -20px; top: 20px; font-size: 8rem; opacity: .05; }
.hero-content { position: relative; max-width: 680px; margin: 0 auto; }
.hero-badge { display: inline-flex; align-items: center; gap: .4rem; background: rgba(212,175,90,.15); color: var(--gold-light, #f0d78a); border: 1px solid rgba(212,175,90,.3); border-radius: 20px; padding: .3rem 1rem; font-size: .8rem; font-weight: 600; margin-bottom: 1.2rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.15; margin-bottom: 1rem; }
.hero h1 span { color: var(--gold); }
.hero p  { font-size: 1.05rem; opacity: .85; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Mission/Vision band (shown to logged-out visitors only) ──
   Helps a returning visitor whose session expired understand what this
   platform is and that they need to log back in, instead of landing on an
   ambiguous page with no context. */
.mission-band { background: var(--white); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 3rem 1.5rem; }
.mission-grid { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }
.mission-grid h3 { font-size: 1.1rem; color: var(--green-deep); margin-bottom: .5rem; font-weight: 700; }
.mission-grid p { color: var(--text-mid); font-size: .95rem; }
.mission-cta { text-align: center; margin-top: 2.2rem; padding-top: 2rem; border-top: 1px solid var(--border); max-width: 1180px; margin-left: auto; margin-right: auto; }
.mission-cta p { color: var(--text-mid); margin-bottom: 1rem; font-size: .95rem; font-weight: 600; }
.hero-stats { display: flex; gap: 2.5rem; justify-content: center; margin-top: 3rem; flex-wrap: wrap; }
.hero-stat .num { font-size: 2rem; font-weight: 800; color: var(--gold); display: block; }
.hero-stat .lbl { font-size: .78rem; opacity: .7; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .7rem 1.6rem; border-radius: 25px; font-size: .95rem; font-weight: 600; cursor: pointer; border: none; transition: var(--transition); text-decoration: none; }
.btn-primary  { background: var(--gold); color: var(--green-deep); }
.btn-primary:hover { background: var(--gold-dark); color: var(--green-deep); transform: translateY(-1px); }
.btn-secondary { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,.55); }
.btn-secondary:hover { background: rgba(255,255,255,.1); color: var(--white); }
.btn-green { background: var(--green-mid); color: var(--white); }
.btn-green:hover { background: var(--green-light); color: var(--white); transform: translateY(-1px); }
.btn-amber { background: var(--amber); color: var(--white); }
.btn-amber:hover { background: #c0680a; color: var(--white); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--green-mid); border: 2px solid var(--green-mid); }
.btn-outline:hover { background: var(--green-mid); color: var(--white); }
.btn-sm { padding: .4rem 1rem; font-size: .85rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Icon Buttons (Material Design 3 icon-button + tooltip pattern) ──
   M3 spec: 24dp icon in a 48dp touch target, with a plain tooltip showing
   the action's label on hover/focus — used for compact row actions instead
   of multi-word buttons that wrap and break card layouts on mobile. */
.action-row { display: flex; gap: .4rem; flex-wrap: nowrap; align-items: center; justify-content: flex-end; }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; min-width: 40px; padding: 0;
    border-radius: 50%; border: 1.5px solid var(--border);
    background: var(--white); color: var(--text-mid);
    font-size: 1.05rem; line-height: 1; cursor: pointer;
    transition: var(--transition); position: relative; flex-shrink: 0;
}
.icon-btn:hover, .icon-btn:focus-visible { background: var(--cream); border-color: var(--green-mid); color: var(--green-mid); outline: none; }
.icon-btn.icon-btn-danger:hover { background: #fdecea; border-color: #c00; color: #c00; }
.icon-btn .count-badge {
    position: absolute; top: -5px; right: -5px;
    background: var(--gold); color: var(--green-deep);
    font-size: .62rem; font-weight: 700; border-radius: 999px;
    padding: 0 4px; min-width: 16px; height: 16px;
    display: flex; align-items: center; justify-content: center; line-height: 1;
}
.icon-btn[data-tip]::after {
    content: attr(data-tip);
    position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
    background: #1a1a1a; color: #fff; font-size: .72rem; font-weight: 500;
    padding: .35rem .6rem; border-radius: 6px; white-space: nowrap;
    opacity: 0; pointer-events: none; transition: opacity .15s ease; z-index: 50;
}
.icon-btn[data-tip]:hover::after, .icon-btn[data-tip]:focus-visible::after { opacity: 1; }

/* ── Container / Layout ── */
.container { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }
/* Only vertical padding — must NOT touch left/right, or it zeroes out
   .container's horizontal padding when both classes are combined. */
.section { padding-top: 4rem; padding-bottom: 4rem; }
.section-title { font-size: 1.8rem; font-weight: 700; color: var(--green-deep); margin-bottom: .4rem; }
.section-title span { color: var(--gold-dark); }
.section-sub { color: var(--text-mid); margin-bottom: 2.5rem; }

/* ── Campaign Cards ── */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 1.5rem; }

.campaign-card {
    background: var(--white); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow);
    border: 1.5px solid var(--border); transition: var(--transition);
    display: flex; flex-direction: column;
}
.campaign-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--gold); }

.campaign-img {
    height: 180px; background: linear-gradient(135deg, var(--green-deep), var(--green-light));
    display: flex; align-items: center; justify-content: center;
    font-size: 4rem; position: relative;
}
.campaign-img img { width: 100%; height: 100%; object-fit: cover; }
.campaign-cat-badge { position: absolute; top: .8rem; left: .8rem; background: rgba(0,0,0,.6); color: var(--white); font-size: .72rem; font-weight: 600; padding: .25rem .6rem; border-radius: 12px; }

.campaign-body { padding: 1.2rem; flex: 1; }
.campaign-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: .5rem; line-height: 1.35; }
.campaign-desc  { font-size: .85rem; color: var(--text-mid); margin-bottom: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Filter Chips (Material Design 3 filter-chip pattern) ──
   A scrollable single-row strip, not a wrapping wall of chips — keeps any
   number of categories from overwhelming the page vertically, especially
   on mobile. Chips use M3's "small" 8px shape (not a pill) so they read as
   filters, distinct from pill-shaped call-to-action buttons. */
.chip-row {
    display: flex; gap: .6rem; flex-wrap: nowrap;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    padding-bottom: .35rem; margin-bottom: 1.6rem;
    mask-image: linear-gradient(to right, black 0%, black 94%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 0%, black 94%, transparent 100%);
}
.chip-row::-webkit-scrollbar { display: none; }
.cat-chip {
    display: inline-flex; align-items: center; gap: .4rem; flex-shrink: 0;
    padding: .55rem 1.1rem;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text);
    white-space: nowrap;
}
.cat-chip:hover { border-color: var(--green-mid); }
.cat-chip.active {
    background: var(--green-deep);
    color: var(--gold);
    border-color: var(--green-deep);
}
.chip-view-all {
    display: inline-flex; align-items: center; gap: .3rem; flex-shrink: 0;
    font-size: .85rem; font-weight: 600; color: var(--green-mid);
    padding: .55rem .2rem; white-space: nowrap; text-decoration: none;
}
.chip-view-all:hover { color: var(--amber); }

/* ── Progress Bar ── */
.prog-wrap { margin-bottom: .7rem; }
.prog-bar { background: #e0f0e6; border-radius: 8px; height: 9px; overflow: hidden; }
.prog-fill { height: 100%; background: linear-gradient(90deg, var(--green-mid), var(--gold)); border-radius: 8px; transition: width .4s ease; }
.prog-labels { display: flex; justify-content: space-between; font-size: .78rem; margin-top: .35rem; }
.prog-raised { font-weight: 700; color: var(--green-deep); }
.prog-goal   { color: var(--text-light); }
.prog-pct    { color: var(--green-mid); font-weight: 700; }

.campaign-footer { padding: .9rem 1.2rem; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.campaign-meta  { font-size: .78rem; color: var(--text-light); display: flex; flex-direction: column; gap: .2rem; }

/* ── Contribution Form ── */
.contribute-section { background: var(--white); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); border: 1.5px solid var(--border); margin-top: 2rem; }
.contribute-section h3 { font-size: 1.2rem; font-weight: 700; color: var(--green-deep); margin-bottom: 1.2rem; display: flex; align-items: center; gap: .5rem; }

.amount-presets { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.preset-btn { padding: .45rem 1.1rem; border: 2px solid var(--border); border-radius: 20px; font-size: .88rem; font-weight: 600; cursor: pointer; background: var(--cream); color: var(--text); transition: var(--transition); }
.preset-btn:hover, .preset-btn.active { border-color: var(--green-mid); background: var(--green-mid); color: var(--white); }

/* ── Auth ── */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--green-deep) 0%, #0f3d22 100%); padding: 2rem; }
.auth-box { background: var(--white); border-radius: var(--radius); padding: 2.5rem; width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); }
.auth-logo { text-align: center; margin-bottom: 1.5rem; }
.auth-logo h2 { color: var(--green-deep); font-size: 1.5rem; font-weight: 800; }
.auth-logo p  { color: var(--text-light); font-size: .85rem; }

/* ── Forms ── */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-size: .85rem; font-weight: 600; color: var(--text-mid); margin-bottom: .4rem; }
.form-control { width: 100%; padding: .7rem 1rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: .95rem; color: var(--text); background: var(--cream); outline: none; transition: var(--transition); }
.form-control:focus { border-color: var(--green-mid); background: var(--white); box-shadow: 0 0 0 3px rgba(26,92,51,.1); }
textarea.form-control { min-height: 110px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-hint { font-size: .78rem; color: var(--text-light); margin-top: .3rem; }

/* ── Alerts ── */
.alert { padding: .9rem 1.2rem; border-radius: var(--radius-sm); margin-bottom: 1.2rem; font-size: .92rem; border-left: 4px solid; }
.alert-success { background: #e8f5e9; color: #1b5e20; border-color: #4caf50; }
.alert-error   { background: #ffebee; color: #b71c1c; border-color: #f44336; }
.alert-info    { background: #e3f2fd; color: #0d47a1; border-color: #2196f3; }

/* ── Dashboard ── */
.dashboard-wrap { max-width: 960px; margin: 2rem auto; padding: 0 1.5rem; }
.dashboard-header { background: linear-gradient(135deg, var(--green-deep), #1a5c33); color: var(--white); border-radius: var(--radius); padding: 1.8rem 2rem; margin-bottom: 1.5rem; }
.dashboard-header h2 { font-size: 1.5rem; font-weight: 700; }
.dashboard-header p  { opacity: .8; margin-top: .3rem; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--white); border-radius: var(--radius-sm); padding: 1.2rem; box-shadow: var(--shadow); border: 1.5px solid var(--border); text-align: center; }
.stat-card .num { font-size: 2rem; font-weight: 800; color: var(--green-deep); }
.stat-card .lbl { font-size: .8rem; color: var(--text-mid); margin-top: .2rem; }

/* ── Tables ── */
.table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th { background: var(--green-deep); color: var(--gold); padding: .9rem 1rem; text-align: left; font-size: .82rem; text-transform: uppercase; letter-spacing: .4px; }
.table td { padding: .85rem 1rem; border-bottom: 1px solid var(--border); font-size: .9rem; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--cream); }

/* ── Badges ── */
.badge { display: inline-block; padding: .2rem .7rem; border-radius: 12px; font-size: .75rem; font-weight: 700; text-transform: uppercase; }
.badge-active  { background: #e8f5e9; color: #2e7d32; }
.badge-pending { background: #fff8e1; color: #e65100; }
.badge-funded  { background: #e3f2fd; color: #0d47a1; }
.badge-closed  { background: #f5f5f5; color: #757575; }
.badge-rejected { background: #ffebee; color: #c62828; }

/* ── Tabs ── */
.tabs { display: flex; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.tab-btn { flex: 1; padding: .85rem; font-size: .9rem; font-weight: 600; background: none; border: none; cursor: pointer; color: var(--text-mid); border-bottom: 3px solid transparent; transition: var(--transition); }
.tab-btn.active { color: var(--green-deep); border-bottom-color: var(--gold); background: var(--cream); }

/* ── Footer ── */
footer { background: var(--green-deep); color: rgba(255,255,255,.75); padding: 3rem 1.5rem 1.5rem; margin-top: 4rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; max-width: 1180px; margin: 0 auto 2rem; }
.footer-brand { font-size: 1.3rem; font-weight: 800; color: var(--gold); }
.footer-brand p { font-size: .83rem; color: rgba(255,255,255,.55); font-weight: 400; margin-top: .3rem; }
.footer-heading { font-size: .8rem; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: .5px; margin-bottom: .8rem; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: .4rem; }
.footer-links a { color: rgba(255,255,255,.6); font-size: .88rem; transition: var(--transition); }
.footer-links a:hover { color: var(--gold); }
.footer-bottom { text-align: center; border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.2rem; font-size: .82rem; max-width: 1180px; margin: 0 auto; }

.empty-state { text-align: center; padding: 4rem 1rem; color: var(--text-light); }
.empty-state .icon { font-size: 3.5rem; margin-bottom: 1rem; opacity: .5; }
.empty-state h3 { font-size: 1.2rem; color: var(--text-mid); margin-bottom: .5rem; }

/* ── Mobile nav drawer (Material Design 3 modal navigation drawer) ── */
.nav-toggle { display: none; background: none; border: none; color: var(--white); font-size: 1.5rem; cursor: pointer; padding: .3rem .5rem; line-height: 1; }
.nav-scrim { display: none; }
.nav-brand { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Tablet: tighten the desktop nav row before it switches to a drawer ── */
@media (max-width: 1024px) {
    .navbar { padding: 0 1.1rem; }
    .nav-links { gap: 1rem; }
    .nav-links a { font-size: .85rem; padding: .35rem .6rem; }
}

@media (max-width: 768px) {
    .navbar { padding: 0 1rem; height: 60px; flex-direction: row; align-items: center; }
    .nav-brand { font-size: 1.1rem; max-width: 65vw; }
    .nav-toggle { display: block; }
    .nav-links {
        position: fixed; top: 0; left: 0; height: 100vh; width: 80%; max-width: 300px;
        background: var(--green-deep, #0a3d1f); flex-direction: column; align-items: stretch;
        justify-content: flex-start; padding: 5rem 1.2rem 2rem; gap: .3rem;
        transform: translateX(-100%); transition: transform .28s cubic-bezier(.4,0,.2,1);
        z-index: 200; border-radius: 0 16px 16px 0; box-shadow: 4px 0 24px rgba(0,0,0,.35);
        flex-wrap: nowrap; overflow-y: auto;
    }
    .nav-links.nav-open { transform: translateX(0); }
    .nav-links a { width: 100%; padding: .85rem 1rem; font-size: 1rem; border-radius: 12px; }
    .nav-user { width: 100%; max-width: none; padding: .85rem 1rem; font-size: 1rem; margin-bottom: .3rem; box-sizing: border-box; }
    .nav-scrim {
        display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 150;
        opacity: 0; pointer-events: none; transition: opacity .28s ease;
    }
    .nav-scrim.show { opacity: 1; pointer-events: auto; }

    .hero { padding: 2.5rem 1rem; }
    .hero h1 { font-size: 1.6rem; }
    .hero p { font-size: .95rem; }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-stats { gap: 1.2rem; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .mission-grid { grid-template-columns: 1fr; gap: 1.8rem; }
    .mission-band { padding: 2.2rem 1.2rem; }
    .form-row { grid-template-columns: 1fr; }
    .auth-box { padding: 1.5rem; }
    .container, .section { padding-left: 1rem; padding-right: 1rem; }
    .dashboard-wrap { padding: 0 1rem; }
    .dashboard-header { padding: 1.2rem 1.4rem; }

    /* Tables become Material-style elevated cards instead of horizontal-scrolling grids */
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table { border: none; }
    .table tr {
        margin-bottom: .9rem; border-radius: 12px; background: var(--white);
        box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
        padding: .9rem 1rem; border: none;
    }
    .table td {
        display: flex; justify-content: space-between; align-items: center;
        padding: .5rem 0; border: none; text-align: right; gap: .8rem; white-space: normal;
    }
    .table td:not(:last-child) { border-bottom: 1px solid var(--border); }
    .table td::before {
        content: attr(data-label); font-weight: 600; color: var(--text-mid);
        font-size: .72rem; text-transform: uppercase; letter-spacing: .3px;
        text-align: left; flex-shrink: 0;
    }
    .table td:last-child { justify-content: flex-end; }

    .amount-presets { gap: .4rem; }
    .preset-btn { font-size: .8rem; padding: .4rem .8rem; }
    .stat-cards { grid-template-columns: repeat(2, 1fr); }

    /* ── Footer: stack and center instead of left-aligning a single column ── */
    footer { padding: 2.2rem 1.2rem 1.2rem; margin-top: 3rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; text-align: center; }
    .footer-links { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
    .footer-links li { margin-bottom: 0; }
}
@media (max-width: 420px) {
    .hero h1 { font-size: 1.4rem; }
    .nav-brand { font-size: 1.05rem; }
    .btn { padding: .6rem 1.2rem; font-size: .88rem; }
    .stat-cards { grid-template-columns: 1fr; }
}
