@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&family=Open+Sans:wght@300;400;600&display=swap');

:root {
  --bg1: #e3f2fd;
  --bg2: #ede7f6;
  --bg3: #e8f5e9;
  --primary: #6C63FF;
  --secondary: #4b6cb7;
  --accent: #A1C4FD;
  --text: #1f2a44;
  --muted: #5b6f92;
  --card: rgba(255,255,255,0.7);
  --card-strong: rgba(255,255,255,0.9);
  --shadow: 0 10px 30px rgba(75,108,183,0.15);
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'Poppins', 'Open Sans', system-ui, -apple-system, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, var(--bg1), var(--bg2) 50%, var(--bg3));
  background-attachment: fixed;
}

.container { width: min(1100px, 92%); margin: 0 auto; }

.header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.6);
  box-shadow: var(--shadow);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 40px; width: auto; }
.brand span { font-weight: 700; letter-spacing: 0.5px; }

.auth-actions { display: flex; gap: 10px; }

.nav {
  display: flex; flex-wrap: wrap; gap: 10px; padding: 10px 0 16px;
}
.nav a { text-decoration: none; color: var(--secondary); padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,0.8); transition: transform .2s ease, background .2s ease; }
.nav a:hover { transform: translateY(-2px); background: var(--card-strong); }

.hero { text-align: center; padding: 72px 0 48px; }
.hero h1 { font-size: clamp(28px, 5vw, 56px); margin: 12px 0 8px; line-height: 1.15; }
.hero p { font-size: clamp(16px, 2.5vw, 20px); color: var(--muted); margin: 0 auto; max-width: 720px; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}
.card:hover { transform: translateY(-4px); background: var(--card-strong); box-shadow: 0 14px 34px rgba(75,108,183,0.22); }
.card h3 { margin-top: 0; }

.btn { border: 0; border-radius: 999px; padding: 10px 18px; cursor: pointer; font-weight: 600; letter-spacing: .2px; }
.btn-primary { background: linear-gradient(135deg, var(--secondary), var(--primary)); color: white; box-shadow: var(--shadow); }
.btn-secondary { background: white; color: var(--secondary); border: 2px solid var(--accent); }
.btn-ghost { background: transparent; color: var(--secondary); border: 1px solid rgba(75,108,183,.25); }
.btn:active { transform: translateY(1px); }

footer { margin-top: 48px; padding: 24px 0 48px; text-align: center; color: var(--muted); }
footer .social { display: flex; gap: 12px; justify-content: center; margin-bottom: 8px; }
footer a { color: var(--secondary); text-decoration: none; }

/* Index specific */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; }
.logo-center { display: flex; justify-content: center; align-items: center; gap: 10px; }
.logo-center img { height: 64px; }

/* Progress bars */
.progress { width: 100%; height: 12px; background: rgba(75,108,183,0.15); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--primary)); transition: width .6s ease; }

/* Chatbot */
.chatbot-toggle { position: fixed; right: 20px; bottom: 20px; z-index: 50; }
.chatbot-panel { position: fixed; right: 20px; bottom: 76px; width: min(360px, 92vw); max-height: 60vh; display: none; flex-direction: column; background: white; border-radius: 16px; box-shadow: 0 16px 40px rgba(0,0,0,0.18); overflow: hidden; z-index: 60; }
.chatbot-header { padding: 12px 14px; background: linear-gradient(135deg, var(--accent), var(--primary)); color: #fff; font-weight: 600; }
.chatbot-body { padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.message { padding: 8px 12px; border-radius: 12px; max-width: 80%; }
.message.user { align-self: flex-end; background: #eef2ff; color: var(--secondary); }
.message.bot { align-self: flex-start; background: #f3f8ff; color: var(--text); }
.chatbot-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #eef2ff; }
.chatbot-input input { flex: 1; border-radius: 999px; border: 1px solid #e5e7eb; padding: 10px 12px; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.35); display: none; align-items: center; justify-content: center; z-index: 80; }
.modal .sheet { background: white; width: min(520px, 92vw); border-radius: 14px; box-shadow: var(--shadow); padding: 20px; }
.modal .sheet h3 { margin-top: 0; }

/* Stress breathing */
.breathing { display: grid; place-items: center; gap: 10px; padding: 24px 0; }
.breathing-circle { width: 140px; height: 140px; border-radius: 999px; background: radial-gradient(circle at 30% 30%, #c2e9fb, #a1c4fd); box-shadow: 0 10px 30px rgba(75,108,183,0.25); animation: breathe 8s ease-in-out infinite; }
@keyframes breathe { 0% { transform: scale(0.85);} 25% { transform: scale(1.0);} 50% { transform: scale(1.15);} 75% { transform: scale(1.0);} 100% { transform: scale(0.85);} }

.quote { font-style: italic; color: var(--muted); }

/* Cards for doctors/groups */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.card-media { width: 100%; height: 120px; border-radius: 12px; background: linear-gradient(135deg, #e0e7ff, #f5f3ff); margin-bottom: 10px; }

/* Meditation controls */
.meditation-controls { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.control { background: var(--card); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }

/* Responsive */
@media (max-width: 640px) {
  .nav { overflow-x: auto; padding-bottom: 12px; }
  .header-inner { flex-wrap: wrap; gap: 10px; }
}