/* css/client-workspace.css */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&family=Outfit:wght@400;700&display=swap');

:root {
  /* Re-Mind Visual Identity Palette */
  --primary: #0284c7;
  /* Re-Mind Blue */
  --primary-light: #e0f2fe;
  --secondary: #14b8a6;
  /* Re-Mind Teal */
  --secondary-light: #ccfbf1;
  --bg-color: #f8fafc;
  --card-bg: rgba(255, 255, 255, 0.85);
  --text-main: #1e293b;
  --text-muted: #64748b;
  --danger: #f43f5e;
  --danger-light: #ffe4e6;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Cairo', sans-serif;
}

body {
  background: var(--bg-color);
  background-image: radial-gradient(circle at 100% 0%, #e0e7ff 0%, transparent 40%),
    radial-gradient(circle at 0% 100%, #ccfbf1 0%, transparent 40%);
  /* background-attachment: fixed removed - causes paint issues on mobile */
  color: var(--text-main);
  direction: rtl;
  min-height: 100dvh;
  padding-bottom: 100px; /* space for fixed bottom nav */
}

/* ── Typography & Utilities ── */
.text-center {
  text-align: center;
}

.mt-1 {
  margin-top: 10px;
}

.mt-2 {
  margin-top: 20px;
}

.mb-1 {
  margin-bottom: 10px;
}

.mb-2 {
  margin-bottom: 20px;
}

.text-muted {
  color: var(--text-muted);
}

.text-primary {
  color: var(--primary);
}

/* ── Glass Cards ── */
.glass-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
  margin-bottom: 16px;
  transition: transform 0.3s ease;
}

.glass-card:active {
  transform: scale(0.98);
}

/* ── Layout & Container ── */
.app-container {
  width: 100%;
  max-width: 500px; /* Mobile Default */
  margin: 0 auto;
  padding: 20px 15px;
  transition: max-width 0.3s ease;
}

@media (min-width: 600px) {
  .app-container {
    max-width: 850px; /* Tablet Width */
    padding: 30px 25px;
  }
}

/* ── Login Page ── */
.login-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100dvh;
  padding: 30px 20px;
}

.login-logo {
  font-size: 45px;
  color: var(--primary);
  text-align: center;
  margin-bottom: 10px;
}

.login-title {
  text-align: center;
  font-weight: 800;
  font-size: 24px;
  color: var(--text-main);
  margin-bottom: 5px;
}

.login-subtitle {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 30px;
}

.input-group {
  margin-bottom: 15px;
}

.input-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.glass-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  outline: none;
  transition: all 0.3s;
}

.glass-input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px var(--primary-light);
}

.btn-primary {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  border: none;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.25);
  transition: all 0.3s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(99, 102, 241, 0.35);
}

.btn-primary:active {
  transform: scale(0.98);
}

/* ── Top Bar ── */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.user-greeting {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.greeting-text {
  font-size: 13px;
  color: var(--text-muted);
}

.user-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

/* ── Appointment Card ── */
.appt-card {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  border: none;
  position: relative;
  overflow: hidden;
}

.appt-card::after {
  content: '\f073';
  /* Calendar icon */
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  position: absolute;
  left: -10px;
  bottom: -20px;
  font-size: 120px;
  opacity: 0.1;
}

/* ── Bottom Navigation ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-around;
  padding: 10px 15px;
  padding-bottom: max(15px, env(safe-area-inset-bottom));
  z-index: 1000;
  transition: all 0.3s ease;
}

@media (min-width: 600px) {
  .bottom-nav {
    max-width: 450px;
    left: 50%;
    transform: translateX(-50%);
    bottom: 20px;
    border-radius: 30px !important;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important;
    padding: 10px 25px;
  }
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  padding: 8px 12px 12px 12px;
  border-radius: 20px;
}

.nav-item i {
  font-size: 20px;
  transition: all 0.3s;
}

.nav-item.active {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-item.active i {
  transform: translateY(-2px);
}

/* ── Pages ── */
.page {
  display: none;
  /* animation removed from display:none state - causes initial render bug on mobile */
}

.page.active {
  display: block;
  animation: fadeIn 0.2s ease forwards;
}

/* Pages that have just been activated (not initial load) */
.page.switching {
  animation: fadeIn 0.2s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ── Medication List ── */
.med-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  background: #fff;
  border-radius: 16px;
  border: 1.5px solid #f1f5f9;
  margin-bottom: 12px;
}

.med-icon {
  width: 44px;
  height: 44px;
  background: var(--secondary-light);
  color: var(--secondary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.med-details {
  flex: 1;
  margin-right: 12px;
}

.med-name {
  font-weight: 800;
  font-size: 15px;
  color: var(--text-main);
}

.med-dose {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.med-check {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  cursor: pointer;
  transition: all 0.3s;
}

/* ── Mood Tracker UI (How We Feel Style) ── */
.mood-trigger-btn {
  background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
  border: 2px solid transparent;
  border-radius: 20px;
  padding: 20px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.mood-trigger-btn::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, #f59e0b, #ef4444, #3b82f6, #10b981);
  z-index: -1;
  border-radius: 22px;
  opacity: 0.2;
  /* rotateGradient animation removed - performance */
}

/* @keyframes rotateGradient removed */

.mood-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mood-quadrants-container {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 130px);
  grid-template-rows: repeat(2, 130px);
  gap: -20px;
  /* Overlap effect */
  padding: 0;
  align-content: center;
  justify-content: center;
  position: relative;
}

.mood-quadrant {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.3s ease, filter 0.3s ease;
  /* energyPulse animation removed - performance */
  border: none;
  filter: blur(2px);
  margin: -15px;
  box-shadow: inset 0 0 40px rgba(255, 255, 255, 0.3);
}

.mood-quadrant:hover {
  transform: scale(1.1);
  filter: blur(0px);
  z-index: 10;
}

.mood-q-high-pleasant {
  background: radial-gradient(circle at 30% 30%, #FFE082, #FFC107);
}

.mood-q-high-unpleasant {
  background: radial-gradient(circle at 30% 30%, #FFAB91, #FF7043);
}

.mood-q-low-unpleasant {
  background: radial-gradient(circle at 30% 30%, #90CAF9, #42A5F5);
}

.mood-q-low-pleasant {
  background: radial-gradient(circle at 30% 30%, #A5D6A7, #66BB6A);
}

/* @keyframes energyPulse removed */

.mood-emotions-grid {
  display: none;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 40px 20px;
  overflow-y: auto;
  animation: fadeIn 0.4s ease forwards;
}

.emotions-grid-title {
  font-size: 24px;
  font-weight: 900;
  text-align: center;
  margin-bottom: 30px;
  line-height: 1.4;
}

.emotions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.emotion-ball {
  background: rgba(255, 255, 255, 0.9);
  color: #1e293b;
  padding: 15px 25px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1.5px solid transparent;
}

.emotion-ball:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.emotion-ball:active {
  transform: scale(0.95);
}

.emotion-pill {
  padding: 18px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
}

.emotion-pill:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* CBCL Report Styles inside Workspace */
.report-header {
  background: linear-gradient(135deg, #005082, #00a884);
  color: white;
  padding: 30px 20px;
  border-radius: 20px;
  margin-bottom: 25px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 80, 130, 0.1);
}
.report-header h2 {
  font-size: 22px;
  margin-top: 0;
  margin-bottom: 8px;
  font-weight: 950;
  color: white;
}
.report-header p {
  margin: 0;
  opacity: 0.95;
  font-weight: 600;
  font-size: 13px;
}
.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}
@media (max-width: 600px) {
  .report-grid {
    grid-template-columns: 1fr;
  }
}
.report-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.01);
  text-align: right;
}
.report-section h3 {
  color: #005082;
  font-size: 14px;
  font-weight: 900;
  margin-top: 0;
  margin-bottom: 12px;
  border-bottom: 2px solid #00a884;
  padding-bottom: 6px;
}
.report-section p {
  margin: 6px 0;
  font-size: 13px;
  line-height: 1.5;
}
.scale-card {
  background: #f8fafc;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.01);
  border: 1px solid #e2e8f0;
  border-right: 5px solid #00a884;
  transition: all 0.3s;
  text-align: right;
}
.scale-card:hover {
  border-right-color: #005082;
  transform: translateY(-1px);
}
.scale-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.scale-name {
  font-weight: 850;
  color: #005082;
  font-size: 13.5px;
}
.scale-score {
  background: rgba(0, 168, 132, 0.1);
  padding: 4px 12px;
  border-radius: 100px;
  font-weight: 800;
  color: #00a884;
  font-size: 12px;
  border: 1px solid rgba(0, 168, 132, 0.15);
}
.t-score-bar {
  height: 10px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 100px;
  overflow: hidden;
  margin-top: 6px;
}
.t-score-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.t-score-fill.status-normal-bg {
  background: #10b981;
}
.t-score-fill.status-borderline-bg {
  background: #ea580c;
}
.t-score-fill.status-clinical-bg {
  background: #dc2626;
}
.status-normal {
  color: #10b981;
  font-weight: 800;
}
.status-borderline {
  color: #ea580c;
  font-weight: 800;
}
.status-clinical {
  color: #dc2626;
  font-weight: 900;
}
.legend-box {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin: 15px 0;
  flex-wrap: wrap;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}
.comp-table {
  width: 100%;
  margin-top: 10px;
  margin-bottom: 20px;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}
.comp-table th {
  background: rgba(0, 80, 130, 0.05);
  padding: 10px;
  font-size: 12px;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.05);
  font-weight: 800;
  color: #005082;
}
.comp-table td {
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  text-align: center;
  font-weight: 700;
  font-size: 12px;
}
.comp-table tr:nth-child(even) {
  background: rgba(248, 250, 252, 0.5);
}
.section-title {
  font-size: 14px;
  font-weight: 800;
  color: #005082;
  margin: 20px 0 10px;
  border-right: 4px solid #00a884;
  padding: 6px 10px;
  background: rgba(0, 80, 130, 0.03);
  border-radius: 0 6px 6px 0;
  text-align: right;
}
.chart-container {
  position: relative;
  height: 280px;
  margin: 20px 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 15px;
}
.disclaimer {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-right: 5px solid #f59e0b;
  border-radius: 8px;
  padding: 12px 15px;
  margin-top: 15px;
}
.disclaimer p {
  font-size: 12px;
  color: #92400e;
  font-weight: 700;
  margin: 0;
  line-height: 1.6;
}
.report-footer {
  text-align: center;
  margin-top: 20px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  font-size: 11px;
  color: #64748b;
}