/* ============================================================
   css/components.css
   مكونات مشتركة بين admin1.html و therapist.html
   ============================================================ */

/* ─── MODAL OVERLAY (Admin) ─── */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.modal-overlay.show { opacity: 1; }
.modal-box {
  background: var(--bg-surface);
  width: 90%;
  max-width: 450px;
  border-radius: 30px !important;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  border: 1px solid rgba(0,0,0,0.1);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}
.modal-overlay.show .modal-box { transform: scale(1); }
.modal-header {
  background: var(--remind-blue, #0868a3);
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  font-size: 14px;
  border-top-left-radius: 30px !important;
  border-top-right-radius: 30px !important;
}
.modal-body { padding: 0; overflow-y: auto; background: var(--bg-surface); }

/* Force bottom rounding on whatever is at the bottom of the modal */
.modal-box > *:last-child {
  border-bottom-left-radius: 30px !important;
  border-bottom-right-radius: 30px !important;
}
.close-icon { cursor: pointer; font-size: 18px; transition: color 0.2s; }
.close-icon:hover { color: #fed7d7; }

/* ─── GENERIC CARD ─── */
.card {
  background: var(--bg-surface);
  padding: 25px;
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  margin-bottom: 20px;
  border: 1px solid rgba(0,0,0,0.02);
}
.card h3 {
  margin-top: 0;
  color: var(--remind-blue, #0868a3);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ─── GLASS PANEL ─── */
.glass-panel {
  background: var(--glass-bg, rgba(255,255,255,0.85));
  backdrop-filter: var(--blur, blur(16px));
  -webkit-backdrop-filter: var(--blur, blur(16px));
  border: var(--glass-border, 1px solid rgba(255,255,255,0.7));
  box-shadow: var(--glass-shadow, 0 10px 40px -10px rgba(8, 104, 163, 0.1));
  border-radius: 20px;
  padding: 15px;
  margin-bottom: 20px;
  transition: transform 0.2s ease;
}

/* ─── SELECT2 OVERRIDES (shared) ─── */
.select2-container .select2-selection--single {
  height: 48px;
  border-radius: 12px;
  border: 1.5px solid #edf2f7;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 48px;
  padding-right: 15px;
  text-align: right;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 46px;
  left: 10px;
}
.select2-container--open,
.select2-container--open .select2-dropdown,
.select2-dropdown { z-index: 9999999 !important; }

/* ─── FINANCIAL LIST ─── */
.fin-list { list-style: none; padding: 0; margin: 0; }
.fin-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  transition: background 0.2s ease;
}
.fin-item:last-child { border-bottom: none; }
.fin-item:hover { background: var(--hover-bg); }
.fin-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  margin-left: 10px;
  font-size: 12px;
}

/* ─── GLASS ALERT ─── */
.glass-alert {
  background: rgba(254, 226, 226, 0.8);
  border: 1px solid rgba(239, 68, 68, 0.2);
  backdrop-filter: blur(5px);
  color: #991b1b;
  padding: 15px;
  border-radius: 12px;
  margin-bottom: 20px;
  display: none;
  font-size: 13px;
}
.alert-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* ─── TOGGLE SWITCH ─── */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 22px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px; width: 16px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider { background-color: var(--remind-teal, #0d9488); }
input:checked + .slider:before { transform: translateX(22px); }

/* ─── SESSION BADGE ─── */
.session-badge {
  background: var(--remind-teal, #0d9488);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0, 168, 132, 0.2);
}

/* ─── CLIENT ROW (modals) ─── */
.client-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  transition: background 0.2s;
}
.client-row:hover { background: var(--hover-bg); }
.client-info div:first-child { font-weight: bold; color: var(--text-primary); font-size: 13px; }
.client-info div:last-child { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ─── NOTIFICATION SYSTEM (shared base) ─── */
.notif-badge {
  position: absolute;
  top: -5px; right: -5px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  width: 17px; height: 17px;
  font-size: 9px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid white;
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.2)} }

/* ─── FILTER BAR ─── */
.filter-bar { display: flex; gap: 10px; align-items: flex-end; }
.filter-btn {
  padding: 6px 15px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-family: 'Cairo', sans-serif;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-weight: 700;
}
.filter-btn:hover { border-color: var(--remind-blue, #0868a3); color: var(--remind-blue, #0868a3); }
.filter-btn.active {
  background: var(--remind-blue, #0868a3);
  color: #fff;
  border-color: var(--remind-blue, #0868a3);
  box-shadow: 0 4px 10px rgba(8, 104, 163, 0.2);
}

/* ─── VIEW MODE BUTTONS ─── */
.view-mode-btn {
  border: 2px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-radius: 12px;
  padding: 8px 16px;
  font-family: 'Cairo', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.view-mode-btn.active {
  border-color: var(--remind-blue, #0868a3);
  background: #eff6ff;
  color: var(--remind-blue, #0868a3);
}

/* ─── STAT BADGE ─── */
.stat-badge {
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: bold;
}
.stat-badge.blue { background: #e0f2fe; color: #0284c7; border: 1px solid #bae6fd; }
.stat-badge.green { background: #dcfce7; color: #16a34a; border: 1px solid #bbf7d0; }
.stat-badge .label { opacity: 0.8; }

/* ─── INFO ROW (client detail) ─── */
.info-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin-bottom: 12px; }
.info-label { color: #64748b; font-weight: bold; }
.info-val { color: #1e293b; font-weight: 800; }

/* ─── PROGRESS BARS ─── */
.balance-progress-bg { background: #e2e8f0; height: 8px; border-radius: 10px; overflow: hidden; margin-top: 6px; }
.balance-progress-fill { height: 100%; border-radius: 10px; transition: width 0.8s ease-in-out, background 0.3s; }
.ac-progress-bg { background: #f1f5f9; height: 6px; border-radius: 10px; overflow: hidden; }
.ac-progress-fill { height: 100%; border-radius: 10px; transition: width 0.6s ease; }

/* ─── SHARED ANIMATIONS ─── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: translateX(0); } }
