/* ═══════════════════════════════════════════════════════════════
   CounselConnect - Design System
   Theme: Warm, professional, accessible — NOT dark
═══════════════════════════════════════════════════════════════ */

:root {
  --primary: #2D6A4F;
  --primary-light: #40916C;
  --primary-lighter: #D8F3DC;
  --primary-dark: #1B4332;
  --accent: #F77F00;
  --accent-light: #FFF0D6;
  --surface: #FFFFFF;
  --surface-2: #F8FAF9;
  --surface-3: #EEF5F0;
  --border: #D9E9DE;
  --text-primary: #1A2E25;
  --text-secondary: #52705F;
  --text-muted: #8FA898;
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(45,106,79,.08);
  --shadow-md: 0 4px 24px rgba(45,106,79,.12);
  --shadow-lg: 0 8px 40px rgba(45,106,79,.16);
  --font-display: 'Playfair Display', serif;
  --font-body: 'DM Sans', sans-serif;
  --danger: #DC3545;
  --warning: #FFC107;
  --success: #198754;
  --info: #0DCAF0;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); color: var(--text-primary); background: var(--surface-2); font-size: 15px; line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); }
h1,h2,h3 { font-family: var(--font-display); }

/* ── App Layout ─────────────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .25s ease;
  box-shadow: var(--shadow);
}
.sidebar-brand { padding: 20px 24px; border-bottom: 1px solid var(--border); }
.brand-link { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--text-primary); }
.brand-icon { width: 36px; height: 36px; background: var(--primary); color: white; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 12px; scrollbar-width: thin; }
.nav-section-label { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); padding: 16px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-weight: 500;
  cursor: pointer; border: none; background: none;
  width: 100%; text-align: left; font-size: .9rem;
  transition: all .15s ease; position: relative;
}
.nav-item:hover { background: var(--surface-3); color: var(--primary); }
.nav-item.active { background: var(--primary-lighter); color: var(--primary-dark); font-weight: 600; }
.nav-item i { font-size: 1.1rem; width: 20px; flex-shrink: 0; }
.badge-pending { background: var(--accent); color: white; font-size: 10px; border-radius: 20px; padding: 1px 6px; margin-left: auto; }
.logout-btn { color: #dc3545 !important; }
.logout-btn:hover { background: #fff0f0 !important; }
.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }

/* Main Content */
.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* Topbar */
.topbar {
  height: var(--topbar-h); background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow);
}
.sidebar-toggle { background: none; border: none; font-size: 1.25rem; color: var(--text-secondary); cursor: pointer; padding: 6px; border-radius: 8px; }
.sidebar-toggle:hover { background: var(--surface-3); color: var(--primary); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.online-indicator { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--text-secondary); background: var(--surface-3); padding: 4px 10px; border-radius: 20px; }
.online-dot { width: 8px; height: 8px; background: #22C55E; border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1}50%{opacity:.5} }
.icon-btn { background: none; border: none; font-size: 1.15rem; color: var(--text-secondary); cursor: pointer; padding: 8px; border-radius: 8px; position: relative; }
.icon-btn:hover { background: var(--surface-3); color: var(--primary); }
.notif-count { position: absolute; top: 2px; right: 2px; background: var(--danger); color: white; font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.user-avatar-btn { background: none; border: none; cursor: pointer; padding: 2px; }
.avatar-circle { width: 36px; height: 36px; background: var(--primary-lighter); color: var(--primary-dark); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }

/* Notifications Dropdown */
.notif-dropdown { width: 340px; padding: 0; border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: var(--radius); overflow: hidden; }
.notif-header { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: .9rem; }
.mark-all-btn { background: none; border: none; color: var(--primary); font-size: .8rem; cursor: pointer; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; display: flex; gap: 10px; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--primary-lighter); }
.notif-item .notif-title { font-weight: 600; font-size: .85rem; }
.notif-item .notif-body { font-size: .8rem; color: var(--text-secondary); }
.notif-item .notif-time { font-size: .75rem; color: var(--text-muted); }
.notif-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: .9rem; }

/* Page Content */
.page-content { flex: 1; padding: 28px 32px; }
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.page-header .breadcrumb { font-size: .85rem; color: var(--text-muted); }

/* ── Cards ──────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 600; background: var(--surface); display: flex; align-items: center; justify-content: space-between; }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* Stat Cards */
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card .stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: 12px; }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 700; font-family: var(--font-display); color: var(--text-primary); line-height: 1; }
.stat-card .stat-label { font-size: .8rem; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.stat-card .stat-change { font-size: .8rem; font-weight: 600; margin-top: 8px; }
.stat-card .stat-change.up { color: var(--success); }
.stat-card .stat-change.down { color: var(--danger); }
.stat-icon-green { background: var(--primary-lighter); color: var(--primary); }
.stat-icon-orange { background: #FFF0D6; color: var(--accent); }
.stat-icon-blue { background: #EFF6FF; color: #3B82F6; }
.stat-icon-purple { background: #F3F0FF; color: #7C3AED; }
.stat-icon-red { background: #FFF1F1; color: #EF4444; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn { border-radius: var(--radius-sm); font-weight: 500; font-family: var(--font-body); font-size: .9rem; padding: 9px 18px; transition: all .15s ease; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); border-color: var(--primary-light); }
.btn-outline-primary { border-color: var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: white; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: white; }
.btn-accent:hover { background: #E07200; border-color: #E07200; }
.btn-sm { padding: 5px 12px; font-size: .82rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn-icon { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); }

/* ── Forms ────────────────────────────────────────────────────── */
.form-control, .form-select {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: .9rem;
  padding: 9px 14px; background: var(--surface);
  color: var(--text-primary); transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(45,106,79,.12);
  outline: none;
}
.form-label { font-weight: 600; font-size: .85rem; color: var(--text-primary); margin-bottom: 6px; }
.input-group-text { background: var(--surface-3); border: 1.5px solid var(--border); color: var(--text-secondary); }

/* ── Tables ──────────────────────────────────────────────────── */
.table { font-size: .88rem; color: var(--text-primary); }
.table th { font-weight: 700; color: var(--text-secondary); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; padding: 12px 16px; border-bottom: 2px solid var(--border); background: var(--surface-2); }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover { background: var(--surface-2); }
.table-responsive { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }

/* ── Badges ──────────────────────────────────────────────────── */
.badge { font-size: .72rem; font-weight: 600; padding: 4px 10px; border-radius: 20px; letter-spacing: .02em; }

/* ── Status Badges ───────────────────────────────────────────── */
.status-pending { background: #FEF3C7; color: #92400E; }
.status-approved { background: #D1FAE5; color: #065F46; }
.status-rejected { background: #FEE2E2; color: #991B1B; }
.status-suspended { background: #F3F4F6; color: #374151; }
.status-ongoing { background: #EFF6FF; color: #1D4ED8; animation: statusPulse 2s infinite; }
.status-completed { background: #D1FAE5; color: #065F46; }
.status-cancelled { background: #FEE2E2; color: #991B1B; }
.status-requested { background: #FEF9C3; color: #713F12; }
@keyframes statusPulse { 0%,100%{opacity:1}50%{opacity:.7} }

/* ── Counselor Card ──────────────────────────────────────────── */
.counselor-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow); transition: all .2s ease;
  position: relative; overflow: hidden;
}
.counselor-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--primary-light); }
.counselor-avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--primary-lighter); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 700; font-family: var(--font-display); overflow: hidden; border: 3px solid var(--border); }
.counselor-avatar img { width: 100%; height: 100%; object-fit: cover; }
.online-badge { position: absolute; width: 14px; height: 14px; background: #22C55E; border: 2px solid white; border-radius: 50%; bottom: 2px; right: 2px; }
.counselor-name { font-weight: 700; font-size: 1rem; color: var(--text-primary); }
.counselor-headline { font-size: .82rem; color: var(--text-secondary); margin-top: 2px; line-height: 1.4; }
.expertise-tag { display: inline-block; background: var(--primary-lighter); color: var(--primary-dark); font-size: .72rem; padding: 2px 8px; border-radius: 20px; font-weight: 600; margin: 2px; }
.rate-badge { background: var(--accent-light); color: var(--accent); font-weight: 700; font-size: .85rem; padding: 4px 10px; border-radius: 8px; display: inline-block; }
.star-rating { color: #F59E0B; font-size: .85rem; }
.star-rating .count { color: var(--text-muted); font-size: .78rem; }

/* ── Chat Window ─────────────────────────────────────────────── */
.chat-window { height: 520px; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.chat-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; background: var(--surface); }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.message { max-width: 70%; }
.message.sent { align-self: flex-end; }
.message.received { align-self: flex-start; }
.message-bubble { padding: 10px 14px; border-radius: 16px; font-size: .9rem; line-height: 1.5; }
.sent .message-bubble { background: var(--primary); color: white; border-bottom-right-radius: 4px; }
.received .message-bubble { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.message-time { font-size: .7rem; color: var(--text-muted); margin-top: 2px; }
.sent .message-time { text-align: right; }
.chat-input-area { padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface); display: flex; gap: 8px; align-items: center; }
.chat-input-area .form-control { border-radius: 24px; padding: 8px 16px; }
.chat-send-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: white; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.chat-send-btn:hover { background: var(--primary-light); }

/* ── Dashboard Charts ────────────────────────────────────────── */
.chart-container { position: relative; height: 280px; }

/* ── Session Timer ───────────────────────────────────────────── */
.session-timer { font-size: 2.5rem; font-weight: 700; font-family: var(--font-display); color: var(--primary); letter-spacing: .05em; }
.session-cost { font-size: 1.1rem; color: var(--accent); font-weight: 600; }

/* ── File Upload ─────────────────────────────────────────────── */
.upload-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 32px; text-align: center; cursor: pointer; transition: all .2s; background: var(--surface-2); }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: var(--primary-lighter); }
.upload-zone i { font-size: 2.5rem; color: var(--text-muted); }

/* ── Rating Stars ────────────────────────────────────────────── */
.rating-input { display: flex; flex-direction: row-reverse; gap: 4px; }
.rating-input input { display: none; }
.rating-input label { font-size: 1.75rem; color: var(--border); cursor: pointer; transition: color .15s; }
.rating-input label:hover, .rating-input label:hover ~ label,
.rating-input input:checked ~ label { color: #F59E0B; }

/* ── Public Landing ──────────────────────────────────────────── */
.public-nav { background: rgba(255,255,255,.97); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); padding: 12px 0; position: sticky; top: 0; z-index: 200; }
.hero-section { padding: 100px 0 80px; background: linear-gradient(135deg, #F0FAF4 0%, #FEFFFE 50%, #FFF8F0 100%); position: relative; overflow: hidden; }
.hero-section::before { content: ''; position: absolute; top: -100px; right: -100px; width: 500px; height: 500px; background: radial-gradient(circle, rgba(45,106,79,.08) 0%, transparent 70%); border-radius: 50%; }
.hero-title { font-size: clamp(2.5rem, 5vw, 4rem); color: var(--text-primary); line-height: 1.1; margin-bottom: 20px; }
.hero-title .accent { color: var(--primary); }
.hero-subtitle { font-size: 1.15rem; color: var(--text-secondary); max-width: 520px; line-height: 1.7; margin-bottom: 36px; }
.hero-stats { display: flex; gap: 40px; margin-top: 48px; }
.hero-stat .value { font-size: 2rem; font-weight: 700; font-family: var(--font-display); color: var(--primary); }
.hero-stat .label { font-size: .8rem; color: var(--text-muted); font-weight: 500; }
.category-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1.5px solid var(--border); color: var(--text-primary); padding: 10px 18px; border-radius: 50px; font-weight: 500; font-size: .9rem; transition: all .2s; cursor: pointer; }
.category-pill:hover { background: var(--primary); border-color: var(--primary); color: white; transform: translateY(-2px); }
.how-it-works-step { text-align: center; padding: 24px; }
.step-number { width: 48px; height: 48px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; margin: 0 auto 16px; font-family: var(--font-display); }
.public-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 48px 0 24px; margin-top: 64px; }

/* ── Wallet ───────────────────────────────────────────────────── */
.wallet-card { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: white; border-radius: 16px; padding: 28px 32px; position: relative; overflow: hidden; }
.wallet-card::before { content: ''; position: absolute; top: -40px; right: -40px; width: 200px; height: 200px; background: rgba(255,255,255,.06); border-radius: 50%; }
.wallet-balance { font-size: 2.5rem; font-weight: 700; font-family: var(--font-display); line-height: 1; }
.wallet-label { opacity: .8; font-size: .85rem; margin-bottom: 8px; }
.tx-credit { color: var(--success); font-weight: 600; }
.tx-debit { color: var(--danger); font-weight: 600; }

/* ── Availability Grid ───────────────────────────────────────── */
.avail-grid { display: grid; grid-template-columns: auto 1fr 1fr auto; gap: 10px 16px; align-items: center; }
.avail-day-label { font-weight: 600; font-size: .9rem; min-width: 90px; }

/* ── Alert customization ─────────────────────────────────────── */
.alert { border-radius: var(--radius-sm); border: none; font-size: .9rem; }
.alert-success { background: #D1FAE5; color: #065F46; }
.alert-danger { background: #FEE2E2; color: #991B1B; }
.alert-warning { background: #FEF3C7; color: #92400E; }
.alert-info { background: #EFF6FF; color: #1D4ED8; }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination .page-link { color: var(--primary); border-color: var(--border); border-radius: var(--radius-sm) !important; margin: 0 2px; }
.pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); }

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .page-content { padding: 20px 16px; }
  .hero-stats { gap: 24px; }
  .hero-title { font-size: 2.2rem; }
}
@media (max-width: 575px) {
  .stat-card .stat-value { font-size: 1.5rem; }
  .wallet-balance { font-size: 2rem; }
  .session-timer { font-size: 2rem; }
}

/* ── Utilities ───────────────────────────────────────────────── */
.section-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ''; width: 4px; height: 20px; background: var(--primary); border-radius: 2px; display: block; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state i { font-size: 3rem; margin-bottom: 12px; display: block; opacity: .4; }
.empty-state p { font-size: .95rem; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.text-primary-custom { color: var(--primary) !important; }
.bg-primary-light { background: var(--primary-lighter) !important; }
.rounded-custom { border-radius: var(--radius) !important; }

/* ── Voice Call UI ───────────────────────────────────────────── */
.voice-call-overlay { position: fixed; inset: 0; background: rgba(26,46,37,.92); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.voice-call-card { background: white; border-radius: 24px; padding: 40px 48px; text-align: center; box-shadow: var(--shadow-lg); min-width: 320px; }
.voice-avatar { width: 100px; height: 100px; border-radius: 50%; background: var(--primary-lighter); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; font-weight: 700; margin: 0 auto 16px; }
.call-btn { width: 60px; height: 60px; border-radius: 50%; border: none; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; cursor: pointer; margin: 0 8px; }
.call-btn-accept { background: #22C55E; color: white; }
.call-btn-reject { background: #EF4444; color: white; }
.call-btn-end { background: #EF4444; color: white; }
.call-btn-mute { background: var(--surface-3); color: var(--text-secondary); }
.call-ripple { position: absolute; border-radius: 50%; background: rgba(45,106,79,.15); animation: ripple 1.5s infinite; }
@keyframes ripple { 0%{transform:scale(1);opacity:1}100%{transform:scale(2.5);opacity:0} }

/* ── Profile Page ────────────────────────────────────────────── */
.profile-cover { height: 180px; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); border-radius: var(--radius) var(--radius) 0 0; position: relative; }
.profile-avatar-wrap { position: absolute; bottom: -44px; left: 32px; }
.profile-avatar-lg { width: 88px; height: 88px; border-radius: 50%; border: 4px solid white; background: var(--primary-lighter); color: var(--primary); font-size: 2rem; font-weight: 700; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.profile-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
