/**
 * Mobile Custom Styles
 * تعديلات مخصصة لشاشات الموبايل
 */

/* إعادة ترتيب Navbar على الموبايل */
@media (max-width: 1199.98px) {
  /* إخفاء عناصر الديسكتوب */
  .header .desktop-controls {
    display: none !important;
  }

  /* إعادة ترتيب العناصر */
  .header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  /* اللوغو في الزاوية اليمنى (start) */
  .header .logo {
    order: 1;
    margin-right: 0 !important;
    margin-left: 0 !important;
  }

  /* القائمة مخفية على الموبايل (ستظهر عند الضغط على الأيقونة) */
  .header .navmenu {
    order: 2;
  }

  /* عناصر التحكم (اللغة + القائمة) في الزاوية اليسرى (end) */
  .header .mobile-controls {
    order: 3;
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
  }

  /* تنسيق أيقونة القائمة في mobile-controls */
  .header .mobile-controls .mobile-nav-toggle {
    font-size: 1.5rem;
    cursor: pointer;
    color: #212529;
    transition: color 0.3s ease;
  }

  .header .mobile-controls .mobile-nav-toggle:hover {
    color: #0d6efd;
  }
}

/* توسيط محتوى قسم Hero على الموبايل */
@media (max-width: 991.98px) {
  .hero .row.align-items-center > .col-lg-6:first-child {
    text-align: center;
  }

  .hero .hero-title {
    text-align: center;
  }

  .hero .hero-description {
    text-align: center;
  }

  .hero .cta-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .hero .hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

/* توسيط محتوى قسم Services على الموبايل */
@media (max-width: 991.98px) {
  .services .section-title {
    text-align: center;
  }

  .services .section-title h2 {
    text-align: center;
  }

  .services .section-title p {
    text-align: center;
  }

  .services .service-item {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .services .service-icon {
    margin-bottom: 1rem;
  }

  .services .service-content {
    text-align: center;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .services .service-content h3 {
    text-align: center;
  }

  .services .service-content p {
    text-align: center;
  }
}

/* زر تبديل اللغة */
.lang-switcher {
  display: flex;
  align-items: center;
}

.lang-link {
  color: #212529;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  transition: all 0.3s ease;
}

.lang-link:hover {
  color: #0d6efd;
  background-color: rgba(13, 110, 253, 0.1);
}

/* تنسيق زر اللغة على الموبايل */
@media (max-width: 1199.98px) {
  .header .mobile-controls .lang-switcher {
    margin: 0;
  }
  
  .header .mobile-controls .lang-link {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }
}

/* تحسين تصميم القائمة المنسدلة على الموبايل */
@media (max-width: 1199.98px) {
  /* تحسين الخلفية مع backdrop blur */
  .mobile-nav-active .navmenu {
    background: rgba(33, 37, 41, 0.95) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  /* تحسين تصميم القائمة */
  .mobile-nav-active .navmenu > ul {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 2rem 0;
    margin: 80px 20px 20px 20px;
    animation: slideInDown 0.3s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.2);
  }

  /* Animation للقائمة */
  @keyframes slideInDown {
    from {
      opacity: 0;
      transform: translateY(-20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* تحسين الروابط */
  .mobile-nav-active .navmenu a,
  .mobile-nav-active .navmenu a:focus {
    padding: 1rem 1.5rem;
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    border-radius: 12px;
    margin: 0.25rem 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
  }

  /* تأثير hover عصري */
  .mobile-nav-active .navmenu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #5d57f4 0%, #7c78f6 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
    border-radius: 0 4px 4px 0;
  }

  .mobile-nav-active .navmenu a:hover::before,
  .mobile-nav-active .navmenu .active::before {
    transform: scaleY(1);
  }

  .mobile-nav-active .navmenu a:hover {
    background: linear-gradient(90deg, rgba(93, 87, 244, 0.08) 0%, rgba(93, 87, 244, 0.02) 100%);
    color: #5d57f4;
    transform: translateX(5px);
    padding-right: 2rem;
  }

  .mobile-nav-active .navmenu .active,
  .mobile-nav-active .navmenu .active:focus {
    background: linear-gradient(90deg, rgba(93, 87, 244, 0.12) 0%, rgba(93, 87, 244, 0.04) 100%);
    color: #5d57f4;
    font-weight: 700;
  }

  /* تحسين الأيقونات */
  .mobile-nav-active .navmenu a i {
    background: linear-gradient(135deg, #5d57f4 0%, #7c78f6 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(93, 87, 244, 0.3);
    transition: all 0.3s ease;
  }

  .mobile-nav-active .navmenu a:hover i {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 16px rgba(93, 87, 244, 0.4);
  }

  /* تحسين أيقونة الإغلاق */
  .mobile-nav-active .mobile-nav-toggle {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }

  .mobile-nav-active .mobile-nav-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
  }

  /* تحسين التباعد بين العناصر */
  .mobile-nav-active .navmenu li {
    margin-bottom: 0.5rem;
  }

  /* إضافة divider بين العناصر */
  .mobile-nav-active .navmenu li:not(:last-child)::after {
    content: '';
    display: block;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.1) 50%, transparent 100%);
    margin: 0.5rem 1.5rem;
  }

  /* تنسيق اللوغو في القائمة المنسدلة */
  .mobile-nav-active .navmenu .mobile-menu-logo {
    margin-bottom: 1rem;
    padding: 0 1rem;
  }

  .mobile-nav-active .navmenu .mobile-menu-logo a {
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border-radius: 0 !important;
    transform: none !important;
  }

  .mobile-nav-active .navmenu .mobile-menu-logo a::before {
    display: none !important;
  }

  .mobile-nav-active .navmenu .mobile-menu-logo a:hover {
    background: none !important;
    transform: none !important;
    padding: 0 !important;
  }

  .mobile-nav-active .navmenu .mobile-menu-logo img {
    transition: transform 0.3s ease;
  }

  .mobile-nav-active .navmenu .mobile-menu-logo a:hover img {
    transform: scale(1.05);
  }

  /* إخفاء اللوغو على الديسكتوب */
  .navmenu .mobile-menu-logo {
    display: none;
  }

  @media (max-width: 1199.98px) {
    .navmenu .mobile-menu-logo {
      display: block;
    }
  }
}

/* Cookie Consent Banner */
.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  padding: 1.5rem;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
  border-top: 3px solid #5d57f4;
}

.cookie-consent-banner.show {
  transform: translateY(0);
}

.cookie-consent-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.cookie-consent-text {
  flex: 1;
  min-width: 250px;
}

.cookie-consent-text p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #212529;
}

.cookie-privacy-link {
  color: #5d57f4;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.cookie-privacy-link:hover {
  color: #4a45d4;
  text-decoration: underline;
}

.cookie-accept-btn {
  background: linear-gradient(135deg, #5d57f4 0%, #7c78f6 100%);
  color: #ffffff;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(93, 87, 244, 0.3);
  white-space: nowrap;
}

.cookie-accept-btn:hover {
  background: linear-gradient(135deg, #4a45d4 0%, #6b66e5 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(93, 87, 244, 0.4);
}

.cookie-accept-btn:active {
  transform: translateY(0);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .cookie-consent-banner {
    padding: 1.25rem;
  }

  .cookie-consent-content {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .cookie-consent-text {
    text-align: center;
  }

  .cookie-accept-btn {
    width: 100%;
    padding: 0.875rem 2rem;
  }
}

/* Auth Pages Styles - نفس نمط صفحة الهبوط */
.auth-section {
  padding: 120px 0 80px;
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
}

.auth-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 20px;
  padding: 3rem;
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-header {
  margin-bottom: 2rem;
}

.auth-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--heading-color, #32353a);
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  color: var(--default-color, #023047);
  font-size: 1rem;
  opacity: 0.8;
}

.auth-form .form-group {
  margin-bottom: 1.5rem;
}

.auth-form .form-label {
  font-weight: 600;
  color: var(--heading-color, #32353a);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.auth-form .form-control {
  padding: 0.875rem 1.25rem;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background-color: #ffffff;
}

.auth-form .form-control:focus {
  border-color: #5d57f4;
  box-shadow: 0 0 0 0.2rem rgba(93, 87, 244, 0.15);
  outline: none;
}

.auth-form .form-control::placeholder {
  color: #adb5bd;
  opacity: 0.7;
}

.auth-form .form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-form .form-check-input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  cursor: pointer;
  border: 2px solid #e9ecef;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.auth-form .form-check-input:checked {
  background-color: #5d57f4;
  border-color: #5d57f4;
}

.auth-form .form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(93, 87, 244, 0.15);
  border-color: #5d57f4;
}

.auth-form .form-check-label {
  font-size: 0.95rem;
  color: var(--default-color, #023047);
  cursor: pointer;
  margin: 0;
  font-weight: 500;
}

/* Tom Select styling to match form controls */
.auth-form .ts-wrapper {
  padding: 0 !important;
}

.auth-form .ts-control {
  padding: 0.875rem 1.25rem !important;
  border: 2px solid #e9ecef !important;
  border-radius: 12px !important;
  font-size: 1rem !important;
  min-height: auto !important;
  height: auto !important;
  line-height: 1.5 !important;
  background-color: #ffffff !important;
  transition: all 0.3s ease !important;
}

.auth-form .ts-control:focus,
.auth-form .ts-control.focus {
  border-color: #5d57f4 !important;
  box-shadow: 0 0 0 0.2rem rgba(93, 87, 244, 0.15) !important;
  outline: none !important;
}

.auth-form .ts-control input {
  padding: 0 !important;
  margin: 0 !important;
  font-size: 1rem !important;
  line-height: 1.5 !important;
  height: auto !important;
}

.auth-form .ts-control .item {
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1.5 !important;
}

.auth-form .ts-dropdown {
  border: 2px solid #e9ecef !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
  margin-top: 0.25rem !important;
}

.auth-form .ts-dropdown .option {
  padding: 0.75rem 1.25rem !important;
  font-size: 1rem !important;
}

.auth-form .ts-dropdown .option.active {
  background-color: rgba(93, 87, 244, 0.1) !important;
  color: #5d57f4 !important;
}

.auth-form .ts-dropdown .option:hover {
  background-color: rgba(93, 87, 244, 0.05) !important;
}

.auth-form .form-control.is-invalid {
  border-color: #dc3545;
}

.auth-form .form-control.is-valid {
  border-color: #28a745;
}

.auth-form .invalid-feedback {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #dc3545;
}

.auth-form .valid-feedback {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #28a745;
}

.auth-form .btn-primary {
  background: linear-gradient(135deg, #5d57f4 0%, #7c78f6 100%);
  border: none;
  padding: 0.875rem 2rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: none;
}

.auth-form .btn-primary:hover {
  background: linear-gradient(135deg, #4a45d4 0%, #6b66e5 100%);
  transform: translateY(-2px);
  box-shadow: none;
}

.auth-form .btn-primary:active {
  transform: translateY(0);
}

.auth-footer {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e9ecef;
}

.auth-link {
  color: #5d57f4;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.auth-link:hover {
  color: #4a45d4;
  text-decoration: underline;
}

.alert {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border: none;
}

.alert-success {
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(40, 167, 69, 0.05) 100%);
  color: #155724;
  border-left: 4px solid #28a745;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .auth-section {
    padding: 100px 0 60px;
  }

  .auth-card {
    padding: 2rem 1.5rem;
    border-radius: 16px;
  }

  .auth-title {
    font-size: 1.75rem;
  }

  .auth-subtitle {
    font-size: 0.9rem;
  }
}

/* Page Content Styles */
.page-section {
  padding: 100px 0 80px;
  min-height: calc(100vh - 200px);
}

.page-header {
  margin-bottom: 3rem;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--heading-color, #32353a);
  margin-bottom: 1rem;
}

.page-subtitle {
  color: var(--default-color, #023047);
  font-size: 1rem;
  opacity: 0.7;
}

.page-body {
  color: var(--default-color, #023047);
  line-height: 1.8;
  font-size: 1.05rem;
}

.page-body h2,
.page-body h3,
.page-body h4 {
  color: var(--heading-color, #32353a);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.page-body h2 {
  font-size: 1.75rem;
}

.page-body h3 {
  font-size: 1.5rem;
}

.page-body h4 {
  font-size: 1.25rem;
}

.page-body p {
  margin-bottom: 1.25rem;
}

.page-body ul,
.page-body ol {
  margin-bottom: 1.25rem;
  padding-left: 2rem;
}

.page-body li {
  margin-bottom: 0.5rem;
}

.page-body a {
  color: #5d57f4;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.page-body a:hover {
  color: #4a45d4;
  text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .page-section {
    padding: 80px 0 60px;
  }

  .page-title {
    font-size: 2rem;
  }

  .page-body {
    font-size: 1rem;
  }

  .page-body h2 {
    font-size: 1.5rem;
  }

  .page-body h3 {
    font-size: 1.25rem;
  }
}
