/* ============================================================
   HKCARE NGO – Shared Stylesheet
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+TC:wght@400;700;900&family=Noto+Sans+TC:wght@300;400;500;700&display=swap');

:root {
  --red:        #C0392B;
  --red-dark:   #922B21;
  --gold:       #D4A017;
  --navy:       #1A2744;
  --navy-light: #2C3E6B;
  --white:      #FAFAF8;
  --gray:       #6B7280;
  --light:      #F5F0EB;
  --shadow:     0 4px 24px rgba(0,0,0,0.12);
}
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'Noto Sans TC',sans-serif; background:var(--white); color:var(--navy); }

/* ── HEADER ── */
header { background:linear-gradient(135deg,var(--navy),var(--navy-light)); color:white; box-shadow:var(--shadow); position:sticky; top:0; z-index:1000; }
.header-top { background:var(--red-dark); display:flex; justify-content:space-between; align-items:center; padding:6px 40px; font-size:12px; }
.header-top a { color:#ffdddd; text-decoration:none; margin-left:16px; }
.header-top a:hover { color:white; }
.header-main { display:flex; align-items:center; justify-content:space-between; padding:14px 40px; }
.logo-area { display:flex; align-items:center; gap:16px; text-decoration:none; }
.logo-icon { width:54px; height:54px; background:var(--gold); border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:28px; box-shadow:0 0 0 3px rgba(212,160,23,.3); flex-shrink:0; }
.logo-text h1 { font-family:'Noto Serif TC',serif; font-size:22px; font-weight:900; letter-spacing:2px; color:white; }
.logo-text p { font-size:11px; color:#aac; letter-spacing:3px; text-transform:uppercase; }

nav { display:flex; gap:4px; align-items:center; }
nav a { color:#ccd; text-decoration:none; padding:8px 14px; border-radius:6px; font-size:13px; font-weight:500; transition:all .2s; white-space:nowrap; }
nav a:hover, nav a.active { background:rgba(255,255,255,.15); color:white; }
nav a.active { color:var(--gold); font-weight:700; }
.nav-login-btn { background:var(--gold) !important; color:var(--navy) !important; font-weight:700 !important; border-radius:20px !important; padding:8px 20px !important; }
.nav-login-btn:hover { background:#e6b520 !important; }

/* ── BUTTONS ── */
.btn-primary { background:var(--gold); color:var(--navy); padding:13px 28px; border-radius:30px; font-weight:700; font-size:15px; border:none; cursor:pointer; text-decoration:none; transition:all .2s; display:inline-block; font-family:'Noto Sans TC',sans-serif; }
.btn-primary:hover { background:#e6b520; transform:translateY(-2px); box-shadow:0 8px 20px rgba(212,160,23,.4); }
.btn-secondary { background:var(--navy); color:white; padding:13px 28px; border-radius:30px; font-weight:700; font-size:15px; border:none; cursor:pointer; text-decoration:none; transition:all .2s; display:inline-block; font-family:'Noto Sans TC',sans-serif; }
.btn-secondary:hover { background:var(--navy-light); transform:translateY(-2px); }
.btn-outline { background:transparent; color:white; padding:13px 28px; border-radius:30px; font-weight:700; font-size:15px; border:2px solid rgba(255,255,255,.6); cursor:pointer; text-decoration:none; transition:all .2s; display:inline-block; }
.btn-outline:hover { background:rgba(255,255,255,.1); }
.btn-outline-red { background:transparent; color:var(--red); padding:10px 24px; border-radius:30px; font-weight:700; font-size:14px; border:2px solid var(--red); cursor:pointer; text-decoration:none; transition:all .2s; display:inline-block; font-family:'Noto Sans TC',sans-serif; }
.btn-outline-red:hover { background:var(--red); color:white; }

/* ── PAGE HERO ── */
.hero { background:linear-gradient(135deg,#1A2744 0%,#2C3E6B 50%,#C0392B 100%); color:white; padding:80px 40px; text-align:center; position:relative; overflow:hidden; }
.hero::before { content:''; position:absolute; inset:0; background:url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Cg fill='%23fff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); }
.hero h2 { font-family:'Noto Serif TC',serif; font-size:44px; font-weight:900; margin-bottom:16px; text-shadow:0 2px 12px rgba(0,0,0,.3); position:relative; }
.hero p { font-size:18px; opacity:.85; margin-bottom:36px; max-width:600px; margin-left:auto; margin-right:auto; position:relative; }
.hero-btns { display:flex; gap:16px; justify-content:center; flex-wrap:wrap; position:relative; }
.page-hero { background:linear-gradient(135deg,var(--navy),var(--navy-light)); color:white; padding:48px 40px; position:relative; overflow:hidden; }
.page-hero::before { content:''; position:absolute; inset:0; background:url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Cg fill='%23fff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); }
.page-hero h2 { font-family:'Noto Serif TC',serif; font-size:34px; font-weight:900; position:relative; }
.page-hero p { font-size:16px; opacity:.8; margin-top:8px; position:relative; }

/* ── STATS BAR ── */
.stats-bar { background:white; border-bottom:2px solid var(--light); display:flex; justify-content:center; flex-wrap:wrap; }
.stat-item { padding:24px 48px; text-align:center; border-right:1px solid var(--light); }
.stat-item:last-child { border-right:none; }
.stat-num { font-family:'Noto Serif TC',serif; font-size:32px; font-weight:900; color:var(--red); }
.stat-label { font-size:12px; color:var(--gray); margin-top:4px; }

/* ── LAYOUT ── */
main { max-width:1200px; margin:0 auto; padding:60px 40px; }
.section-title { font-family:'Noto Serif TC',serif; font-size:28px; font-weight:900; color:var(--navy); margin-bottom:8px; }
.section-sub { color:var(--gray); font-size:14px; margin-bottom:36px; }
.grid-3 { display:grid; grid-template-columns:repeat(3,1fr); gap:24px; margin-bottom:48px; }
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.grid-4 { display:grid; grid-template-columns:repeat(4,1fr); gap:20px; }

/* ── CARDS ── */
.card { background:white; border-radius:16px; padding:28px; box-shadow:0 2px 12px rgba(0,0,0,.06); border:1px solid rgba(0,0,0,.06); transition:all .2s; }
.card:hover { transform:translateY(-4px); box-shadow:var(--shadow); }
.card-icon { font-size:36px; margin-bottom:16px; }
.card h3 { font-family:'Noto Serif TC',serif; font-size:17px; font-weight:700; margin-bottom:10px; color:var(--navy); }
.card p { font-size:13px; color:var(--gray); line-height:1.8; }
.card-link { display:inline-block; margin-top:14px; color:var(--red); font-size:13px; font-weight:600; text-decoration:none; }
.card-link:hover { text-decoration:underline; }

/* ── MODAL ── */
.modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.6); z-index:9000; align-items:center; justify-content:center; backdrop-filter:blur(4px); }
.modal-overlay.active { display:flex; }
.modal { background:white; border-radius:20px; padding:40px; width:90%; max-width:480px; box-shadow:0 24px 60px rgba(0,0,0,.3); position:relative; animation:modalIn .3s ease; max-height:90vh; overflow-y:auto; }
@keyframes modalIn { from{transform:scale(.9);opacity:0} to{transform:scale(1);opacity:1} }
.modal-close { position:absolute; top:16px; right:20px; background:none; border:none; font-size:24px; cursor:pointer; color:var(--gray); line-height:1; }
.modal h2 { font-family:'Noto Serif TC',serif; font-size:22px; color:var(--navy); margin-bottom:6px; }
.modal .subtitle { font-size:13px; color:var(--gray); margin-bottom:24px; }

/* ── FORMS ── */
.form-group { margin-bottom:18px; }
.form-group label { display:block; font-size:13px; font-weight:600; color:var(--navy); margin-bottom:6px; }
.form-group input, .form-group select, .form-group textarea { width:100%; padding:11px 14px; border:1.5px solid #ddd; border-radius:10px; font-size:14px; font-family:'Noto Sans TC',sans-serif; transition:border-color .2s; background:white; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color:var(--red); outline:none; box-shadow:0 0 0 3px rgba(192,57,43,.1); }
.sqli-hint { display:none; margin-top:7px; background:#fff9c4; border:1px dashed #f9a825; border-radius:6px; padding:8px 12px; font-family:'Courier New',monospace; font-size:11px; color:#6d4c41; }

/* ── CAPTCHA ── */
.captcha-box { background:#f8f9fa; border:1px solid #dee2e6; border-radius:8px; padding:12px; display:flex; align-items:center; gap:12px; }
.captcha-display { background:#e9ecef; padding:8px 14px; border-radius:6px; font-family:'Courier New',monospace; font-size:22px; font-weight:bold; letter-spacing:4px; color:#333; user-select:none; filter:blur(.4px); transform:skew(-2deg); min-width:130px; text-align:center; }
.captcha-display span { display:inline-block; transform:rotate(var(--r,0deg)); }

/* ── DASHBOARD ── */
.dashboard-header { background:linear-gradient(135deg,var(--navy),var(--navy-light)); color:white; padding:48px 40px 32px; margin:-40px -40px 32px; border-radius:0 0 20px 20px; }
.dashboard-header h2 { font-family:'Noto Serif TC',serif; font-size:24px; }
.dashboard-header p { opacity:.7; font-size:13px; margin-top:6px; }
.data-card { background:white; border-radius:12px; padding:20px 24px; box-shadow:0 2px 12px rgba(0,0,0,.06); margin-bottom:16px; border-left:4px solid var(--red); }
.data-card h4 { font-size:11px; color:var(--gray); text-transform:uppercase; letter-spacing:1px; margin-bottom:12px; font-weight:700; }
.data-row { display:flex; justify-content:space-between; align-items:center; padding:7px 0; border-bottom:1px solid #f0f0f0; font-size:14px; }
.data-row:last-child { border-bottom:none; }
.data-row .key { color:var(--gray); font-size:13px; }
.data-row .val { font-weight:600; color:var(--navy); }
.data-row .val.sensitive { color:var(--red); font-family:'Courier New',monospace; font-size:13px; }

/* ── TABS (member dashboard) ── */
.tabs { display:flex; gap:4px; margin-bottom:24px; border-bottom:2px solid #eee; overflow-x:auto; }
.tab-btn { padding:10px 20px; border:none; background:none; cursor:pointer; font-family:'Noto Sans TC',sans-serif; font-size:14px; font-weight:500; color:var(--gray); border-bottom:3px solid transparent; margin-bottom:-2px; transition:all .2s; white-space:nowrap; }
.tab-btn.active { color:var(--red); border-bottom-color:var(--red); font-weight:700; }
.tab-panel { display:none; }
.tab-panel.active { display:block; }

/* ── ALERTS ── */
.alert { padding:12px 16px; border-radius:10px; margin-bottom:16px; font-size:13px; }
.alert-success { background:#d1fae5; color:#065f46; border:1px solid #a7f3d0; }
.alert-danger { background:#fee2e2; color:#991b1b; border:1px solid #fca5a5; }
.alert-info { background:#dbeafe; color:#1e40af; border:1px solid #93c5fd; }
.alert-warning { background:#fef3c7; color:#92400e; border:1px solid #fde68a; }

/* ── DONATION ── */
.donation-amounts { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:16px; }
.amount-btn { padding:10px 20px; border:2px solid #ddd; border-radius:30px; background:white; font-size:14px; font-weight:600; cursor:pointer; transition:all .2s; font-family:'Noto Sans TC',sans-serif; }
.amount-btn.active,.amount-btn:hover { border-color:var(--red); background:var(--red); color:white; }
.prog-bar { background:#eee; border-radius:6px; height:8px; margin-top:6px; }
.prog-fill { height:8px; border-radius:6px; }

/* ── SHOP ── */
.shop-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:20px; margin-bottom:32px; }
.shop-item { background:white; border-radius:12px; overflow:hidden; box-shadow:0 2px 8px rgba(0,0,0,.08); transition:all .2s; }
.shop-item:hover { transform:translateY(-3px); box-shadow:var(--shadow); }
.shop-img { height:150px; display:flex; align-items:center; justify-content:center; font-size:64px; background:linear-gradient(135deg,#f8f0e3,#fce4d6); }
.shop-info { padding:16px; }
.shop-info h4 { font-size:14px; font-weight:700; margin-bottom:4px; }
.shop-info .price { color:var(--red); font-weight:700; font-size:16px; margin-top:4px; }
.shop-btn { width:100%; margin-top:10px; padding:9px; background:var(--navy); color:white; border:none; border-radius:8px; cursor:pointer; font-family:'Noto Sans TC',sans-serif; font-size:13px; transition:background .2s; }
.shop-btn:hover { background:var(--navy-light); }
.cart-bar { background:white; border:1px solid #e0e0e0; border-radius:12px; padding:14px 20px; margin-bottom:24px; display:flex; align-items:center; justify-content:space-between; font-size:14px; box-shadow:0 2px 8px rgba(0,0,0,.04); }
.cart-bar .cart-total { font-weight:700; color:var(--red); font-size:16px; }

/* ── FLOATING AI CHAT ── */
.ai-fab { position:fixed; bottom:28px; right:28px; z-index:8000; }
.ai-fab-btn { width:60px; height:60px; border-radius:50%; background:linear-gradient(135deg,var(--red),#922B21); border:none; cursor:pointer; box-shadow:0 4px 20px rgba(192,57,43,.45); display:flex; align-items:center; justify-content:center; font-size:26px; transition:all .3s; position:relative; }
.ai-fab-btn:hover { transform:scale(1.08); box-shadow:0 6px 28px rgba(192,57,43,.55); }
.pulse-ring { position:absolute; inset:-5px; border-radius:50%; border:2.5px solid rgba(192,57,43,.4); animation:ring-pulse 2.4s ease-out infinite; }
@keyframes ring-pulse { 0%{transform:scale(1);opacity:.8} 100%{transform:scale(1.55);opacity:0} }
.fab-badge { position:absolute; top:-4px; right:-4px; background:#ef4444; color:white; border-radius:50%; width:20px; height:20px; font-size:11px; font-weight:700; display:flex; align-items:center; justify-content:center; border:2px solid white; }
.ai-chat-window { position:fixed; bottom:104px; right:28px; z-index:8000; width:360px; background:white; border-radius:20px; box-shadow:0 12px 48px rgba(0,0,0,.18); display:none; flex-direction:column; overflow:hidden; border:1px solid rgba(0,0,0,.08); max-height:520px; }
.ai-chat-window.open { display:flex; animation:chatIn .3s ease; }
@keyframes chatIn { from{transform:scale(.88) translateY(16px);opacity:0} to{transform:scale(1) translateY(0);opacity:1} }
.chat-header { background:linear-gradient(135deg,var(--navy),var(--navy-light)); color:white; padding:16px 20px; display:flex; align-items:center; gap:12px; }
.chat-avatar { width:40px; height:40px; border-radius:50%; background:var(--gold); display:flex; align-items:center; justify-content:center; font-size:20px; flex-shrink:0; box-shadow:0 0 0 2px rgba(255,255,255,.25); }
.chat-header-info { flex:1; }
.chat-header-info h4 { font-size:14px; font-weight:700; }
.chat-header-info p { font-size:11px; opacity:.7; margin-top:2px; }
.online-dot { width:7px; height:7px; border-radius:50%; background:#4ade80; display:inline-block; margin-right:4px; }
.chat-close-btn { background:rgba(255,255,255,.15); border:none; color:white; border-radius:8px; padding:5px 9px; cursor:pointer; font-size:15px; line-height:1; transition:background .2s; }
.chat-close-btn:hover { background:rgba(255,255,255,.28); }
.quick-replies-bar { padding:10px 14px 2px; background:#f8f9fa; border-bottom:1px solid #eee; display:flex; gap:6px; flex-wrap:wrap; }
.qr-btn { background:white; border:1px solid #ddd; border-radius:16px; padding:5px 11px; font-size:11px; cursor:pointer; color:var(--navy); font-family:'Noto Sans TC',sans-serif; transition:all .2s; margin-bottom:8px; white-space:nowrap; }
.qr-btn:hover { border-color:var(--red); color:var(--red); background:#fff5f5; }
.chat-messages { flex:1; overflow-y:auto; padding:14px 16px; display:flex; flex-direction:column; gap:10px; background:#f8f9fa; min-height:200px; max-height:290px; }
.chat-msg { padding:10px 14px; border-radius:16px; max-width:86%; font-size:13px; line-height:1.55; word-break:break-word; }
.chat-msg.bot { background:white; border:1px solid #e5e5e5; border-bottom-left-radius:4px; align-self:flex-start; color:var(--navy); box-shadow:0 1px 4px rgba(0,0,0,.05); }
.chat-msg.user { background:var(--navy); color:white; margin-left:auto; border-bottom-right-radius:4px; align-self:flex-end; }
.typing-indicator { background:white; border:1px solid #e5e5e5; border-radius:16px 16px 16px 4px; padding:12px 16px; align-self:flex-start; display:flex; gap:4px; align-items:center; }
.typing-indicator span { width:7px; height:7px; border-radius:50%; background:#bbb; animation:dotBounce 1.2s infinite; }
.typing-indicator span:nth-child(2){animation-delay:.2s;}
.typing-indicator span:nth-child(3){animation-delay:.4s;}
@keyframes dotBounce{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-6px)}}
.chat-input-area { padding:12px 14px; border-top:1px solid #eee; background:white; display:flex; gap:8px; align-items:center; }
.chat-input-area input { flex:1; padding:10px 14px; border:1.5px solid #eee; border-radius:20px; font-family:'Noto Sans TC',sans-serif; font-size:13px; outline:none; transition:border-color .2s; }
.chat-input-area input:focus { border-color:var(--red); }
.chat-send-btn { width:38px; height:38px; border-radius:50%; background:var(--red); color:white; border:none; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:15px; flex-shrink:0; transition:all .2s; }
.chat-send-btn:hover { background:var(--red-dark); transform:scale(1.05); }

/* ── FOOTER ── */
footer { background:var(--navy); color:#aab; padding:48px 40px 32px; margin-top:60px; font-size:13px; }
.footer-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:32px; max-width:1200px; margin:0 auto 32px; }
.footer-col h4 { color:white; font-size:14px; font-weight:700; margin-bottom:14px; }
.footer-col a { display:block; color:#aab; text-decoration:none; margin-bottom:6px; font-size:12px; }
.footer-col a:hover { color:var(--gold); }
.footer-col p { font-size:12px; line-height:1.9; color:#889; }
.footer-bottom { border-top:1px solid rgba(255,255,255,.1); padding-top:20px; text-align:center; font-size:12px; max-width:1200px; margin:0 auto; color:#667; }

/* ── NOTIFICATION TOAST ── */
.notification { position:fixed; bottom:108px; left:50%; transform:translateX(-50%); background:#1a1a2e; color:#00ff88; font-family:'Courier New',monospace; padding:12px 24px; border-radius:30px; font-size:13px; box-shadow:0 8px 24px rgba(0,0,0,.3); z-index:9999; display:none; border:1px solid #00ff8844; animation:slideUp .3s ease; max-width:90vw; text-align:center; }
@keyframes slideUp{from{transform:translateX(-50%) translateY(16px);opacity:0}to{transform:translateX(-50%) translateY(0);opacity:1}}

/* ── RESPONSIVE ── */
@media(max-width:900px) {
  .grid-3,.shop-grid { grid-template-columns:repeat(2,1fr); }
  .grid-4 { grid-template-columns:repeat(2,1fr); }
  .footer-grid { grid-template-columns:repeat(2,1fr); }
}
@media(max-width:640px) {
  .header-main { flex-wrap:wrap; gap:12px; padding:14px 20px; }
  .header-top { padding:6px 20px; flex-wrap:wrap; gap:4px; }
  nav { flex-wrap:wrap; justify-content:center; }
  main { padding:40px 20px; }
  .hero { padding:60px 20px; }
  .hero h2 { font-size:30px; }
  .grid-3,.grid-2,.shop-grid,.footer-grid,.grid-4 { grid-template-columns:1fr; }
  .stats-bar { flex-wrap:wrap; }
  .stat-item { padding:16px 24px; border-right:none; border-bottom:1px solid var(--light); }
  .ai-chat-window { width:calc(100vw - 32px); right:16px; }
  .page-hero { padding:36px 20px; }
  .page-hero h2 { font-size:26px; }
}
