/* 
 * Raj3 Global Design System
 * Unified CSS variables and base styles for the entire project
 */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700;800;900&family=IBM+Plex+Sans:wght@400;500;600;700;800&display=swap');
/* ========================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ======================================== */
:root {
  /* Colors - Professional Palette */
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-soft: #F1F5F9;
  --text: #0F172A;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --primary: #1E40AF;
  --primary-hover: #1E3A8A;
  --primary-soft: #EFF6FF;
  --danger: #DC2626;
  --warning: #EA580C;
  --success: #059669;
  --accent: #7C3AED;

  /* Typography */
  --font-family: 'IBM Plex Sans Arabic', sans-serif;
  --font-family-en: 'IBM Plex Sans', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --btn-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 2px 6px rgba(15, 23, 42, 0.08);
  --btn-shadow-hover: 0 4px 12px rgba(15, 23, 42, 0.12), 0 2px 4px rgba(15, 23, 42, 0.06);
  --accent-blue: #1E40AF;
  --accent-blue-dark: #1E3A8A;

  /* Z-Index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}


:lang(en),
[lang="en"],
[dir="ltr"],
.english,
.latin,
input[type="email"],
input[type="url"],
input[type="password"],
input[type="tel"],
input[type="number"] {
  font-family: var(--font-family-en);
}

/* ========================================
   BASE STYLES
   ======================================== */

/* Reset and base styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography base */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: var(--line-height-tight);
  color: var(--text);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
  margin-bottom: var(--space-4);
  color: var(--text);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
}

/* Lists */
ul, ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* ========================================
   LAYOUT COMPONENTS
   ======================================== */

.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

@media (min-width: 640px) {
  .page-container {
    padding: 0 var(--space-8);
  }
}

.section-title {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  margin-bottom: var(--space-6);
  text-align: center;
}

/* ========================================
   UI COMPONENTS
   ======================================== */

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.card-header {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin: 0;
}

.card-content {
  margin-bottom: var(--space-4);
}

.card-footer {
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

/* Buttons — polished SaaS-style */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.15;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease,
    box-shadow 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
  box-shadow: var(--btn-shadow);
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--btn-shadow-hover);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: var(--btn-shadow);
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn:focus:not(:focus-visible) {
  outline: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Button variants */
.btn-primary {
  background: linear-gradient(180deg, #3B82F6 0%, var(--primary) 55%, var(--primary-hover) 100%);
  color: white;
  border-color: rgba(30, 64, 175, 0.5);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #60A5FA 0%, #2563EB 50%, var(--primary-hover) 100%);
  border-color: var(--primary-hover);
}

.btn-secondary {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--surface-soft);
  border-color: #cbd5e1;
  color: var(--text);
}

.btn-danger {
  background: linear-gradient(180deg, #f87171 0%, var(--danger) 55%, #b91c1c 100%);
  color: white;
  border-color: rgba(185, 28, 28, 0.45);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(180deg, #fca5a5 0%, #dc2626 55%, #991b1b 100%);
  border-color: #b91c1c;
}

.btn-success {
  background: linear-gradient(180deg, #10B981 0%, var(--success) 50%, #047857 100%);
  color: white;
  border-color: rgba(5, 150, 105, 0.45);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.btn-success:hover:not(:disabled) {
  filter: brightness(1.03);
}

.btn-warning {
  background: linear-gradient(180deg, #F59E0B 0%, var(--warning) 55%, #C2410C 100%);
  color: white;
  border-color: rgba(194, 65, 12, 0.5);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.btn-warning:hover:not(:disabled) {
  filter: brightness(1.05);
}

/* Button sizes */
.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-xs);
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: var(--font-size-base);
}

/* Form inputs */
.input,
textarea,
select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(22 163 74 / 0.1);
}

.input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

/* Form groups */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.form-label.required::after {
  content: " *";
  color: var(--danger);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--font-size-xs);
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-primary {
  background-color: var(--primary-soft);
  color: var(--primary);
}

.badge-success {
  background-color: #D1FAE5;
  color: var(--success);
}

.badge-danger {
  background-color: #fee2e2;
  color: var(--danger);
}

.badge-warning {
  background-color: #FEF3C7;
  color: var(--warning);
}

.badge-secondary {
  background-color: var(--surface-soft);
  color: var(--text-muted);
}

/* Utility classes */
.muted {
  color: var(--text-muted);
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none; }

.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.ml-1 { margin-left: var(--space-1); }
.ml-2 { margin-left: var(--space-2); }
.ml-3 { margin-left: var(--space-3); }
.ml-4 { margin-left: var(--space-4); }

.mr-1 { margin-right: var(--space-1); }
.mr-2 { margin-right: var(--space-2); }
.mr-3 { margin-right: var(--space-3); }
.mr-4 { margin-right: var(--space-4); }

.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.px-1 { padding-left: var(--space-1); padding-right: var(--space-1); }
.px-2 { padding-left: var(--space-2); padding-right: var(--space-2); }
.px-3 { padding-left: var(--space-3); padding-right: var(--space-3); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }

.py-1 { padding-top: var(--space-1); padding-bottom: var(--space-1); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: var(--radius); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

@media (max-width: 640px) {
  .mobile-hidden { display: none; }
  .mobile-block { display: block; }
  .mobile-flex { display: flex; }
}

@media (min-width: 641px) {
  .tablet-hidden { display: none; }
  .tablet-block { display: block; }
  .tablet-flex { display: flex; }
}

@media (min-width: 1024px) {
  .desktop-hidden { display: none; }
  .desktop-block { display: block; }
  .desktop-flex { display: flex; }
}

/* ========================================
   UNIFIED FOOTER + page shell
   ======================================== */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-shell-main {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
}

.app-shell-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.app-shell-pad {
  padding: 1.25rem;
  box-sizing: border-box;
}

.app-footer {
  flex-shrink: 0;
  width: 100%;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: var(--space-4) var(--space-4) var(--space-5);
}

.app-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.app-footer-line {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--text);
  font-weight: 500;
  line-height: var(--line-height-relaxed);
}

.app-footer-copy {
  margin: var(--space-2) 0 0;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  line-height: var(--line-height-normal);
}
