/* ============================================
   KOTWAL SKIN & PAIN CLINIC — USER PANEL CSS
   ============================================ */

:root {
  --primary: #1a6b5a;
  --primary-light: #2a9d87;
  --primary-dark: #0f4a3d;
  --accent: #f4a261;
  --accent2: #e76f51;
  --bg: #f0f4f8;
  --surface: rgba(255,255,255,0.72);
  --surface-border: rgba(255,255,255,0.45);
  --text: #1a2332;
  --text-muted: #6b7a8d;
  --danger: #e63946;
  --pending: #f4a261;
  --approved: #2a9d87;
  --rejected: #e63946;
  --shadow: 0 8px 32px rgba(26,107,90,0.13);
  --shadow-sm: 0 2px 12px rgba(26,107,90,0.09);
  --radius: 18px;
  --radius-sm: 10px;
  --nav-h: 72px;
  --header-h: 60px;
  --font: 'DM Sans', sans-serif;
  --font-display: 'Playfair Display', serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* ---- SCREENS ---- */
.screen { display: none; width: 100%; height: 100vh; position: fixed; inset: 0; }
.screen.active { display: flex; flex-direction: column; }

/* ============ LOGIN SCREEN ============ */
#loginScreen {
  background: linear-gradient(145deg, #e8f5f2 0%, #d4ede8 40%, #c9e8e1 100%);
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-bg { position: absolute; inset: 0; pointer-events: none; }
.login-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
}
.b1 { width: 320px; height: 320px; background: radial-gradient(circle, #2a9d87, #1a6b5a); top: -80px; right: -80px; animation: blobFloat 8s ease-in-out infinite; }
.b2 { width: 220px; height: 220px; background: radial-gradient(circle, #f4a261, #e76f51); bottom: 60px; left: -60px; animation: blobFloat 10s ease-in-out infinite reverse; }
.b3 { width: 160px; height: 160px; background: radial-gradient(circle, #1a6b5a, #0f4a3d); top: 40%; left: 50%; animation: blobFloat 12s ease-in-out infinite; }

@keyframes blobFloat {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(15px,-20px) scale(1.05); }
  66% { transform: translate(-10px,10px) scale(0.97); }
}

.login-card {
  position: relative;
  z-index: 10;
  background: var(--surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1.5px solid var(--surface-border);
  border-radius: 28px;
  padding: 44px 36px 36px;
  width: 90%;
  max-width: 380px;
  box-shadow: var(--shadow);
  text-align: center;
  animation: cardIn 0.6s cubic-bezier(.22,.68,0,1.2) both;
}
@keyframes cardIn { from { opacity:0; transform: translateY(40px) scale(0.95); } to { opacity:1; transform: none; } }

.clinic-logo { margin-bottom: 16px; }
.logo-icon {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 30px; color: #fff;
  box-shadow: 0 8px 24px rgba(26,107,90,0.3);
}
.clinic-name { font-family: var(--font-display); font-size: 1.4rem; color: var(--primary-dark); line-height: 1.3; }
.clinic-sub { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }
.divider { height: 1px; background: linear-gradient(90deg, transparent, rgba(26,107,90,0.2), transparent); margin: 20px 0; }
.login-prompt { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }

.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 14px 20px;
  background: #fff; border: 1.5px solid #e0e0e0;
  border-radius: var(--radius-sm); cursor: pointer;
  font-family: var(--font); font-size: 0.95rem; font-weight: 600;
  color: var(--text); transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.google-btn img { width: 22px; height: 22px; }
.google-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); border-color: #bdbdbd; }
.google-btn:active { transform: translateY(0); }

.login-note { color: var(--text-muted); font-size: 0.75rem; margin-top: 14px; }

/* ============ APP SCREEN ============ */
#appScreen { background: var(--bg); }

/* HEADER */
.app-header {
  height: var(--header-h);
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  flex-shrink: 0;
  box-shadow: 0 2px 16px rgba(15,74,61,0.25);
  z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-logo-icon {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff;
}
.header-title { font-family: var(--font-display); font-size: 1.1rem; color: #fff; font-weight: 700; }
.header-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  background-size: cover; background-position: center;
  background-color: rgba(255,255,255,0.2);
}

/* MAIN */
.app-main {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* PAGES */
.page {
  display: none;
  position: absolute; inset: 0;
  animation: pageIn 0.3s ease both;
}
.page.active { display: block; }
.page-scroll {
  height: 100%;
  overflow-y: auto;
  padding: 16px 16px calc(var(--nav-h) + 20px);
  scrollbar-width: none;
}
.page-scroll::-webkit-scrollbar { display: none; }

@keyframes pageIn { from { opacity:0; transform: translateY(10px); } to { opacity:1; transform: none; } }

/* PAGE HEADER */
.page-header { margin-bottom: 20px; }
.page-header h2 { font-family: var(--font-display); font-size: 1.5rem; color: var(--primary-dark); }
.page-header p { color: var(--text-muted); font-size: 0.875rem; margin-top: 2px; }

/* GLASS CARD */
.glass-card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid var(--surface-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* BOTTOM NAV */
.bottom-nav {
  height: var(--nav-h);
  background: var(--surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1.5px solid var(--surface-border);
  display: flex; align-items: center; justify-content: space-around;
  padding: 0 8px;
  flex-shrink: 0;
  box-shadow: 0 -4px 20px rgba(26,107,90,0.09);
  z-index: 100;
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 0.65rem; font-family: var(--font); font-weight: 500;
  padding: 6px 4px; transition: all 0.2s; border-radius: 12px;
}
.nav-btn i { font-size: 20px; transition: all 0.2s; }
.nav-btn.active { color: var(--primary); }
.nav-btn.active i { transform: translateY(-1px); }
.nav-btn:hover { color: var(--primary); }
.nav-center-btn { flex: none; width: 52px; }
.nav-center-icon {
  width: 50px; height: 50px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 16px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px;
  box-shadow: 0 4px 16px rgba(26,107,90,0.4);
  transition: all 0.2s;
}
.nav-center-btn:hover .nav-center-icon { transform: scale(1.08); }

/* ============ DOCTOR PAGE ============ */
.doctor-hero {
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 0 12px;
  position: relative;
}
.doctor-photo-ring {
  width: 120px; height: 120px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 8px 32px rgba(26,107,90,0.25);
}
.doctor-photo {
  width: 100%; height: 100%; border-radius: 50%;
  object-fit: cover; border: 3px solid #fff;
}
.doctor-badge {
  margin-top: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; font-size: 0.7rem; font-weight: 700; letter-spacing: 1.5px;
  padding: 4px 12px; border-radius: 20px;
}
.doctor-info-card { padding: 20px; text-align: center; margin-bottom: 14px; }
.doctor-name { font-family: var(--font-display); font-size: 1.35rem; color: var(--primary-dark); }
.doctor-qual { color: var(--text-muted); font-size: 0.82rem; margin-top: 4px; }
.clinic-tag { color: var(--primary); font-size: 0.85rem; font-weight: 600; margin-top: 8px; }
.clinic-tag i { margin-right: 4px; }

.info-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 14px;
}
.info-tile { padding: 14px; display: flex; align-items: center; gap: 12px; }
.tile-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; flex-shrink: 0;
}
.tile-icon.eve { background: linear-gradient(135deg, #4a4080, #7c5cbf); }
.tile-icon.fee { background: linear-gradient(135deg, #c0701a, var(--accent)); }
.tile-icon.cal { background: linear-gradient(135deg, #1565c0, #42a5f5); }
.tile-body { display: flex; flex-direction: column; }
.tile-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; }
.tile-value { font-size: 0.9rem; font-weight: 700; color: var(--text); }

.rating-card {
  padding: 16px 20px; display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.rating-star { color: #f4c430; font-size: 20px; }
.rating-card p { color: var(--text); font-size: 0.88rem; }
.rate-link { color: #d62828; font-weight: 600; text-decoration: none; }
.rate-link:hover { text-decoration: underline; }

/* ============ BUTTONS ============ */
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(26,107,90,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(26,107,90,0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-danger {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 24px;
  background: linear-gradient(135deg, #c0392b, var(--danger));
  color: #fff; border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(230,57,70,0.3);
}
.btn-danger:hover { transform: translateY(-1px); }
.full-btn { width: 100%; margin-bottom: 16px; }

/* ============ DASHBOARD PAGE ============ */
.dash-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 20px;
}
.stat-card {
  padding: 16px 10px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.stat-icon {
  width: 44px; height: 44px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.pending-icon { background: rgba(244,162,97,0.15); color: var(--pending); }
.approved-icon { background: rgba(42,157,135,0.15); color: var(--approved); }
.rejected-icon { background: rgba(230,57,70,0.15); color: var(--rejected); }
.stat-num { font-size: 1.6rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; }

.section-title {
  font-family: var(--font-display); font-size: 1.05rem;
  color: var(--primary-dark); margin-bottom: 12px;
}

/* ============ APPOINTMENT CARDS ============ */
.appointments-list { display: flex; flex-direction: column; gap: 10px; }
.appt-card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1.5px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.appt-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; border-radius: 4px 0 0 4px;
}
.appt-card.pending::before { background: var(--pending); }
.appt-card.approved::before { background: var(--approved); }
.appt-card.rejected::before { background: var(--rejected); }

.appt-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.appt-name { font-weight: 700; font-size: 0.95rem; color: var(--text); }
.appt-id { font-size: 0.7rem; color: var(--text-muted); }
.appt-status {
  font-size: 0.7rem; font-weight: 700; padding: 4px 10px;
  border-radius: 20px; letter-spacing: 0.5px; text-transform: uppercase;
}
.appt-status.pending { background: rgba(244,162,97,0.15); color: #c0701a; }
.appt-status.approved { background: rgba(42,157,135,0.15); color: var(--approved); }
.appt-status.rejected { background: rgba(230,57,70,0.15); color: var(--rejected); }
.appt-meta { display: flex; gap: 14px; flex-wrap: wrap; }
.appt-meta span { font-size: 0.8rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.appt-meta i { color: var(--primary); font-size: 11px; }

.empty-state {
  text-align: center; padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 40px; margin-bottom: 10px; opacity: 0.4; display: block; }
.empty-state p { font-size: 0.88rem; }

/* ============ APPOINTMENT BOOKING PAGE ============ */
.patient-count-selector {
  display: flex; gap: 10px; margin-bottom: 20px;
}
.count-btn {
  flex: 1; padding: 12px 10px;
  background: var(--surface);
  border: 2px solid var(--surface-border);
  border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.88rem; font-weight: 600;
  color: var(--text-muted); cursor: pointer; transition: all 0.2s;
}
.count-btn.active {
  border-color: var(--primary); color: var(--primary);
  background: rgba(26,107,90,0.07);
}
.count-btn:hover { border-color: var(--primary-light); }

/* PATIENT FORM */
.patient-form-wrapper {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1.5px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  animation: cardIn 0.35s ease both;
}
.form-heading {
  font-family: var(--font-display); font-size: 1rem;
  color: var(--primary); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.form-heading .form-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 0.8rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font);
}
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; font-size: 0.8rem; font-weight: 600;
  color: var(--text-muted); margin-bottom: 6px; letter-spacing: 0.3px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 11px 14px;
  background: rgba(255,255,255,0.6);
  border: 1.5px solid rgba(26,107,90,0.15);
  border-radius: var(--radius-sm); font-family: var(--font); font-size: 0.88rem;
  color: var(--text); transition: all 0.2s; outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  background: rgba(255,255,255,0.85);
  box-shadow: 0 0 0 3px rgba(26,107,90,0.08);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ============ PROFILE PAGE ============ */
.profile-hero {
  text-align: center; padding: 28px 20px; margin-bottom: 20px;
}
.profile-photo {
  width: 90px; height: 90px; border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--primary);
  margin-bottom: 12px;
  box-shadow: 0 4px 20px rgba(26,107,90,0.25);
}
.profile-hero h2 { font-family: var(--font-display); font-size: 1.25rem; color: var(--primary-dark); }
.profile-hero p { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }

/* ============ TOAST ============ */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 16px); left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a2332; color: #fff;
  padding: 12px 22px; border-radius: 30px;
  font-size: 0.85rem; font-weight: 500;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  opacity: 0; transition: all 0.3s; pointer-events: none;
  z-index: 9999; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--primary); }
.toast.error { background: var(--danger); }

/* ============ LOADER ============ */
.loader-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s;
}
.loader-overlay.hidden { opacity: 0; pointer-events: none; }
.loader-spinner {
  width: 44px; height: 44px;
  border: 4px solid rgba(26,107,90,0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ RESPONSIVE ============ */
@media (min-width: 480px) {
  .login-card { max-width: 420px; }
}
@media (max-width: 320px) {
  .info-grid { grid-template-columns: 1fr; }
  .dash-stats { grid-template-columns: 1fr; }
}
