/* ==========================================================================
   نظام إدارة الجامعات الذكي | Smart University Management System Design System
   Google Font: Readex Pro
   Apple-inspired UI: Emerald Green & Ocean Blue Palette, Large Readable Typography
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Readex+Pro:wght@160..700&display=swap');

:root {
  /* Brand Primary & Accent Colors: Ocean Blue & Emerald Green */
  --brand-blue: #2563eb;
  --brand-blue-hover: #1d4ed8;
  --brand-green: #10b981;
  --brand-green-hover: #059669;

  /* Dark Theme Colors (Comfortable, Eye-pleasing Dark Slate & Blue Tint) */
  --bg-primary: #0b1329;
  --bg-secondary: #131e3a;
  --bg-tertiary: #1c2b4e;
  --bg-surface: #152244;
  --bg-elevated: #1e2f5c;

  --accent-primary: var(--brand-blue);
  --accent-hover: var(--brand-blue-hover);
  --accent-success: var(--brand-green);
  --accent-success-hover: var(--brand-green-hover);
  --accent-glow: rgba(37, 99, 235, 0.35);

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0b1329;

  --border-color: rgba(255, 255, 255, 0.14);
  --border-focus: #3b82f6;

  --status-success: #10b981;
  --status-warning: #f59e0b;
  --status-error: #ef4444;
  --status-info: #3b82f6;

  /* Apple-inspired Glassmorphism & Radius */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-full: 9999px;

  --glass-bg: rgba(19, 30, 58, 0.85);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-blur: blur(16px);
  --box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.4);
  --box-shadow-apple: 0 8px 24px rgba(0, 0, 0, 0.25);

  /* Enhanced High-Clarity Typography (Large & Crisp Font Sizes) */
  --font-family: 'Readex Pro', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.85rem;   /* ~13.6px */
  --font-size-sm: 0.98rem;   /* ~15.7px */
  --font-size-base: 1.1rem;  /* ~17.6px */
  --font-size-lg: 1.28rem;  /* ~20.5px */
  --font-size-xl: 1.5rem;   /* ~24px */

  /* Smooth Cubic-Bezier Transitions */
  --transition-fast: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout Dimensions */
  --header-height: 56px;
  --tab-height: 44px;
  --toolbar-height: 52px;
  --sidebar-width: 280px;
  --statusbar-height: 32px;
}

/* Light Theme (Eye-friendly Clean White & Soft Blue) */
[data-theme="light"] {
  --bg-primary: #f0f4f8;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e2e8f0;
  --bg-surface: #ffffff;
  --bg-elevated: #f8fafc;

  --accent-primary: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-success: #059669;
  --accent-success-hover: #047857;
  --accent-glow: rgba(29, 78, 216, 0.2);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --border-color: #cbd5e1;
  --border-focus: #2563eb;

  --glass-bg: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(0, 0, 0, 0.08);
  --box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
  --box-shadow-apple: 0 6px 20px rgba(0, 0, 0, 0.06);
}

/* Reset & Global High-Clarity Settings */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 15px; /* Base 15px global readable font size */
  line-height: 1.5;
}

/* Form Elements & Inputs Global Typography */
label {
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.2px;
}

input, select, textarea {
  font-size: 0.95rem !important;
  font-weight: 500 !important;
}

button {
  font-size: 0.9rem !important;
  font-weight: 600 !important;
}

/* Data Table Typography & Clear Rows */
table th {
  font-size: 0.9rem !important;
  font-weight: 700 !important;
}

table td {
  font-size: 0.92rem !important;
  font-weight: 500 !important;
}

/* Scrollbar Style - Apple Minimalist */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.55);
}

/* ==========================================================================
   Universal Professional Print Engine Stylesheet
   ========================================================================== */
@media print {
  @page { size: A4 landscape; margin: 6mm; }

  /* Hide non-printable elements by default */
  .toolbar-bar,
  .toolbar-group,
  .form-card,
  .form-panel,
  .mode-indicator-badge,
  .search-box,
  .shell-sidebar,
  .shell-statusbar,
  .shell-tab-strip,
  .shell-header,
  .erp-toolbar,
  #btn-add, #btn-edit, #btn-delete, #btn-save, #btn-refresh, #btn-print,
  button, input[type="text"], input[type="search"], select, textarea {
    display: none !important;
  }

  body, html {
    background: #ffffff !important;
    color: #000000 !important;
    height: auto !important;
    overflow: visible !important;
    font-size: 8pt !important;
    line-height: 1.15 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .screen-container, .workspace-body, .screen-body, .grid-card, .grid-panel, .grid-wrapper, .erp-datagrid-container {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    background: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* When #print-surface is active, present only #print-surface */
  body:has(#print-surface) * {
    visibility: hidden;
  }
  body:has(#print-surface) #print-surface,
  body:has(#print-surface) #print-surface * {
    visibility: visible;
  }
  #print-surface {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    background: #ffffff !important;
    color: #000000 !important;
  }

  /* Table Print Aesthetics */
  table {
    width: 100% !important;
    border-collapse: collapse !important;
    table-layout: auto !important;
    margin-top: 4px !important;
    page-break-inside: auto !important;
    font-size: 7.6pt !important;
  }

  tr {
    page-break-inside: avoid !important;
    page-break-after: auto !important;
  }

  thead {
    display: table-header-group !important;
  }

  tfoot {
    display: table-footer-group !important;
  }

  th, td {
    border: 1px solid #475569 !important;
    padding: 2.2px 3.5px !important;
    color: #000000 !important;
    background: transparent !important;
    font-size: 7.6pt !important;
    line-height: 1.12 !important;
    text-align: right;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: clip !important;
  }

  th {
    background-color: #f1f5f9 !important;
    font-weight: 700 !important;
    font-size: 7.4pt !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  tbody tr:nth-child(even) td {
    background-color: #f8fafc !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
