/* 
   EFFECT - משפיעים בבריאות חינוך ורווחה
   Clean White Header & Navbar Theme (Logo High Visibility)
*/

@import url('https://fonts.googleapis.com/css2?family=Assistant:wght@300;400;500;600;700;800&family=Rubik:wght@400;500;600;700&display=swap');

:root {
  --primary: #0088cc;
  --primary-hover: #006699;
  --primary-light: #e6f4fc;
  --primary-dark: #004466;
  
  --secondary: #06b6d4;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-header: #ffffff; /* Pure White Header */
  
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-white: #ffffff;
  
  --border: #cbd5e1;
  --border-light: #e2e8f0;
  
  --success: #10b981;
  --success-bg: #d1fae5;
  --danger: #ef4444;
  --danger-bg: #fee2e2;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 20px -3px rgba(0, 136, 204, 0.15);
  
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  
  --transition: all 0.15s ease-in-out;
}

[data-theme="dark"] {
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --bg-header: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
  --border-light: #1e293b;
}

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

body {
  font-family: 'Assistant', 'Rubik', system-ui, -apple-system, sans-serif;
  direction: rtl;
  text-align: right;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 0.875rem; /* 14px compact typography */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Auth Overlay Screen */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0088cc 0%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-logo {
  max-width: 240px;
  margin-bottom: 20px;
}

.auth-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 14px;
  text-align: right;
}

.form-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-main);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.875rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  color: var(--text-main);
  transition: var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.15);
}

/* Multi-Select Class Checkboxes Group */
.class-checkboxes-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-main);
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  max-height: 160px;
  overflow-y: auto;
}

.class-checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.class-checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #0088cc;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

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

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: var(--primary-light);
  color: var(--primary-dark);
}

.btn-secondary:hover {
  background-color: #bae6fd;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--primary-light);
}

.btn-danger {
  background-color: var(--danger);
  color: var(--text-white);
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.8rem;
}

/* CLEAN WHITE HEADER & LOGO HIGH VISIBILITY */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-header); /* Pure White */
  color: var(--text-main);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  height: 42px;
  width: auto;
  filter: none !important;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: var(--primary-light);
  border-radius: var(--radius-full);
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 0.85rem;
  border: 1px solid #bae6fd;
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #0088cc;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

/* SLEEK WHITE NAVIGATION TABS BAR */
.app-nav {
  background: #ffffff;
  border-bottom: 2px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-tab:hover {
  color: #0088cc;
  background-color: #f8fafc;
}

.nav-tab.active {
  color: #0088cc;
  border-bottom-color: #0088cc;
  background-color: #f0f9ff;
  font-weight: 700;
}

/* Main Layout Container */
.main-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px;
  flex: 1;
  width: 100%;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* HIGH-DENSITY COMPACT TABLE SYSTEM */
.doc-table-container {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  margin-bottom: 20px;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 0.85rem;
}

.doc-table th {
  background-color: #0088cc;
  color: white;
  font-weight: 700;
  padding: 10px 14px;
  border: 1px solid #0077b6;
  white-space: nowrap;
  font-size: 0.85rem;
}

.doc-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-light);
  border-left: 1px solid #f1f5f9;
  vertical-align: middle;
}

.doc-table tr:hover {
  background-color: #f8fafc;
}

.doc-table tr:nth-child(even) {
  background-color: #fafafa;
}

.doc-table tr:nth-child(even):hover {
  background-color: #f1f5f9;
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Filter Controls Bar */
.filter-bar {
  background: var(--bg-card);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.search-box input {
  padding-right: 36px;
}

.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* Content Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.doc-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.doc-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.doc-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}

.child-name-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2px;
}

.doc-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.775rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-profession {
  background-color: var(--primary-light);
  color: var(--primary-dark);
}

.badge-individual {
  background-color: #e0e7ff;
  color: #3730a3;
}

.badge-group {
  background-color: #fae8ff;
  color: #86198f;
}

.badge-tabam {
  background-color: #dbeafe;
  color: #1e40af;
}

.badge-meeting {
  background-color: #fef3c7;
  color: #92400e;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
}

.metric-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: var(--primary-light);
  color: var(--primary);
  flex-shrink: 0;
}

.metric-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Student Profile Header */
.student-profile-header {
  background: linear-gradient(135deg, #0088cc 0%, #005599 100%);
  color: white;
  padding: 20px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.student-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  background: var(--bg-main);
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 16px;
  font-size: 0.85rem;
}

/* Patient Profile Internal Tabs */
.profile-nav-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.profile-tab-btn {
  background: transparent;
  border: none;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.profile-tab-btn:hover {
  color: var(--primary);
}

.profile-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--primary-light);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.profile-tab-pane {
  display: none;
}

.profile-tab-pane.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Secure ID Lookup Box */
.secure-search-card {
  background: var(--bg-card);
  border: 2px solid var(--primary-light);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.secure-search-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.secure-badge {
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}


/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 760px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background-color: var(--bg-main);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-grid-full {
  grid-column: 1 / -1;
}

/* Radio Group */
.session-type-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.session-type-option {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.85rem;
}

.session-type-option.selected {
  border-color: var(--primary);
  background-color: var(--primary-light);
  color: var(--primary-dark);
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--text-main);
  color: var(--text-white);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-success { background: #065f46; }
.toast-error { background: #991b1b; }

@media print {
  body { background: white !important; color: black !important; }
  .app-header, .app-nav, .filter-bar, .modal-footer, .btn, .toast-container { display: none !important; }
  .main-container { padding: 0 !important; }
}
