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

/* ====================== Base Reset ====================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Inter", "Tajawal", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* RTL Optimization */
[dir="rtl"] body,
body.rtl {
  font-family: "Tajawal", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  text-decoration: none;
  transition: color 0.3s ease;
}

/* ====================== Container Override ====================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 576px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 992px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* ====================== Flex Utilities ====================== */
.d-flex {
  display: flex !important;
}

.flex-column {
  flex-direction: column !important;
}

.flex-wrap {
  flex-wrap: wrap !important;
}

.align-items-center {
  align-items: center !important;
}

.justify-content-center {
  justify-content: center !important;
}

.justify-content-between {
  justify-content: space-between !important;
}

/* ====================== Spacing ====================== */
.gap-2 {
  gap: 0.5rem !important;
}

.gap-3 {
  gap: 1rem !important;
}

.gap-4 {
  gap: 1.5rem !important;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.mb-1 {
  margin-bottom: 0.25rem !important;
}

.mb-2 {
  margin-bottom: 0.5rem !important;
}

.mb-3 {
  margin-bottom: 1rem !important;
}

.mb-4 {
  margin-bottom: 1.5rem !important;
}

.mb-5 {
  margin-bottom: 3rem !important;
}

.mt-3 {
  margin-top: 1rem !important;
}

.mt-4 {
  margin-top: 1.5rem !important;
}

.mt-5 {
  margin-top: 3rem !important;
}

.py-3 {
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
}

.py-4 {
  padding-top: 1.5rem !important;
  padding-bottom: 1.5rem !important;
}

.py-5 {
  padding-top: 3rem !important;
  padding-bottom: 3rem !important;
}

.px-3 {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

.px-4 {
  padding-left: 1.5rem !important;
  padding-right: 1.5rem !important;
}

.p-3 {
  padding: 1rem !important;
}

.p-4 {
  padding: 1.5rem !important;
}

.p-5 {
  padding: 3rem !important;
}

/* ====================== Text Utilities ====================== */
.text-center {
  text-align: center !important;
}

.text-start {
  text-align: left !important;
}

.text-end {
  text-align: right !important;
}

[dir="rtl"] .text-start {
  text-align: right !important;
}

[dir="rtl"] .text-end {
  text-align: left !important;
}

.fw-bold {
  font-weight: 700 !important;
}

.fw-bolder {
  font-weight: 800 !important;
}

.fw-semibold {
  font-weight: 600 !important;
}

.small {
  font-size: 0.875rem !important;
}

.lead {
  font-size: 1.1rem !important;
  line-height: 1.7;
}

/* ====================== Display Utilities ====================== */
.d-none {
  display: none !important;
}

.d-block {
  display: block !important;
}

.d-inline-block {
  display: inline-block !important;
}

@media (min-width: 576px) {
  .d-sm-flex {
    display: flex !important;
  }

  .d-sm-block {
    display: block !important;
  }
}

@media (min-width: 768px) {
  .d-md-flex {
    display: flex !important;
  }

  .d-md-block {
    display: block !important;
  }

  .d-md-none {
    display: none !important;
  }
}

@media (min-width: 992px) {
  .d-lg-flex {
    display: flex !important;
  }

  .d-lg-block {
    display: block !important;
  }

  .d-lg-none {
    display: none !important;
  }
}

/* ====================== Grid System ====================== */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-left: -0.75rem;
  margin-right: -0.75rem;
}

.row.g-3 {
  --bs-gutter-x: 1rem;
  --bs-gutter-y: 1rem;
}

.row.g-4 {
  --bs-gutter-x: 1.5rem;
  --bs-gutter-y: 1.5rem;
}

.row>* {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  margin-bottom: var(--bs-gutter-y, 0);
}

.col-12 {
  flex: 0 0 auto;
  width: 100%;
}

.col-6 {
  flex: 0 0 auto;
  width: 50%;
}

@media (min-width: 576px) {
  .col-sm-6 {
    flex: 0 0 auto;
    width: 50%;
  }
}

@media (min-width: 768px) {
  .col-md-4 {
    flex: 0 0 auto;
    width: 33.333333%;
  }

  .col-md-6 {
    flex: 0 0 auto;
    width: 50%;
  }

  .col-md-8 {
    flex: 0 0 auto;
    width: 66.666667%;
  }
}

@media (min-width: 992px) {
  .col-lg-2 {
    flex: 0 0 auto;
    width: 16.666667%;
  }

  .col-lg-3 {
    flex: 0 0 auto;
    width: 25%;
  }

  .col-lg-4 {
    flex: 0 0 auto;
    width: 33.333333%;
  }

  .col-lg-6 {
    flex: 0 0 auto;
    width: 50%;
  }

  .col-lg-8 {
    flex: 0 0 auto;
    width: 66.666667%;
  }
}

/* ====================== Height Utilities ====================== */
.h-100 {
  height: 100% !important;
}

.w-100 {
  width: 100% !important;
}

.min-vh-100 {
  min-height: 100vh !important;
}

.flex-grow-1 {
  flex-grow: 1 !important;
}

/* ====================== Badge Component ====================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.375rem;
}

.bg-primary {
  background-color: #4A6CF7 !important;
}

.bg-success {
  background-color: #198754 !important;
}

.bg-opacity-10 {
  --bs-bg-opacity: 0.1;
}

.text-primary {
  color: #4A6CF7 !important;
}

.text-success {
  color: #198754 !important;
}

.text-white {
  color: #fff !important;
}

.text-light {
  color: rgba(255, 255, 255, 0.85) !important;
}

.text-muted {
  color: #6c757d !important;
}

.text-dark {
  color: #212529 !important;
}

/* ====================== Button Base ====================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  transition: all 0.15s ease-in-out;
}

.btn:hover {
  opacity: 0.9;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1.125rem;
}

.btn-primary {
  color: #fff;
  background-color: #4A6CF7;
  border-color: #4A6CF7;
}

.btn-outline-primary {
  color: #4A6CF7;
  border-color: #4A6CF7;
  background-color: transparent;
}

.btn-outline-primary:hover {
  color: #fff;
  background-color: #4A6CF7;
}

.btn-light {
  color: #212529;
  background-color: #f8f9fa;
  border-color: #f8f9fa;
}

/* ====================== Card Component ====================== */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-color: #fff;
  background-clip: border-box;
  border: 1px solid rgba(0, 0, 0, 0.125);
  border-radius: 0.5rem;
}

/* ====================== Navbar Toggler for Bootstrap ====================== */
.navbar-toggler-icon {
  display: inline-block;
  width: 1.5em;
  height: 1.5em;
  vertical-align: middle;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100%;
}

body.dark .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ====================== Form Controls ====================== */
.form-control {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  color: #212529;
  background-color: #fff;
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-label {
  margin-bottom: 0.5rem;
  display: inline-block;
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

/* ====================== Input Group ====================== */
.input-group {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  width: 100%;
}

.input-group>.form-control {
  position: relative;
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
}

.input-group .btn {
  position: relative;
  z-index: 2;
}

/* ====================== List Utilities ====================== */
.list-unstyled {
  padding-left: 0;
  list-style: none;
}

/* ====================== Visibility ====================== */
.invisible {
  visibility: hidden !important;
}

.visible {
  visibility: visible !important;
}

/* ====================== Overflow ====================== */
.overflow-hidden {
  overflow: hidden !important;
}

/* ====================== Position ====================== */
.position-relative {
  position: relative !important;
}

.position-absolute {
  position: absolute !important;
}

.position-fixed {
  position: fixed !important;
}

/* ====================== Border Radius ====================== */
.rounded {
  border-radius: 0.375rem !important;
}

.rounded-3 {
  border-radius: 0.5rem !important;
}

.rounded-4 {
  border-radius: 0.75rem !important;
}

.rounded-circle {
  border-radius: 50% !important;
}

/* ====================== Shadow ====================== */
.shadow-sm {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.shadow {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.shadow-lg {
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}

/* ====================== Alert Custom ====================== */
.custom-alert {
  background: linear-gradient(135deg, #4A6CF7 0%, #7B61FF 100%);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.5s ease;
}

.custom-alert.hide {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.custom-alert.error {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

/* ====================== Navbar Collapse ====================== */
.navbar-collapse {
  flex-basis: 100%;
  flex-grow: 1;
  align-items: center;
}

@media (max-width: 991.98px) {
  .navbar-collapse {
    display: none;
    padding: 1rem 0;
  }

  .navbar-collapse.show {
    display: block;
    background: inherit;
  }

  .navbar-nav {
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
  }

  .navbar-nav .nav-item {
    margin-bottom: 0.5rem;
  }

  .navbar-nav .nav-link {
    padding: 0.5rem 0;
  }
}

@media (min-width: 992px) {
  .navbar-expand-lg .navbar-collapse {
    display: flex !important;
    flex-basis: auto;
  }

  .navbar-expand-lg .navbar-nav {
    flex-direction: row;
  }

  .navbar-expand-lg .nav-link {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }
}

/* Nav Link */
.nav-link {
  display: block;
  padding: 0.5rem 1rem;
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease-in-out;
}

.nav-item {
  list-style: none;
}

.navbar-nav {
  display: flex;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
}

/* ====================== CTA Box ====================== */
.cta-box {
  position: relative;
  overflow: hidden;
}

.cta-box::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

/* ====================== Order Utilities ====================== */
.order-0 {
  order: 0 !important;
}

.order-1 {
  order: 1 !important;
}

.order-2 {
  order: 2 !important;
}

@media (min-width: 992px) {
  .order-lg-1 {
    order: 1 !important;
  }

  .order-lg-2 {
    order: 2 !important;
  }
}

/* ====================== Flex Row Reverse ====================== */
.flex-row-reverse {
  flex-direction: row-reverse !important;
}

@media (min-width: 992px) {
  .flex-lg-row-reverse {
    flex-direction: row-reverse !important;
  }
}

/* ====================== Auto Margins ====================== */
.mx-auto {
  margin-left: auto !important;
  margin-right: auto !important;
}

.ms-auto {
  margin-left: auto !important;
}

.me-auto {
  margin-right: auto !important;
}

.mt-auto {
  margin-top: auto !important;
}

[dir="rtl"] .ms-auto {
  margin-left: 0 !important;
  margin-right: auto !important;
}

[dir="rtl"] .me-auto {
  margin-right: 0 !important;
  margin-left: auto !important;
}

/* ====================== Align Items ====================== */
.align-items-start {
  align-items: flex-start !important;
}

.align-items-stretch {
  align-items: stretch !important;
}

.justify-content-end {
  justify-content: flex-end !important;
}