/* Custom styles for Feasible Digits Properties */

/* Arabic Font Support */
@import url('https://fonts.googleapis.com/css2?family=Noto+Kufi+Arabic:wght@100;200;300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap');

/* Root Variables */
:root {
  --primary-color: #3B82F6;
  --secondary-color: #1E40AF;
  --text-dark: #1F2937;
  --text-light: #6B7280;
  --bg-light: #F9FAFB;
  --border-color: #E5E7EB;
  --success-color: #10B981;
  --warning-color: #F59E0B;
  --error-color: #EF4444;
}

/* Base Styles */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
}

/* Arabic RTL Support */
html[dir="rtl"] {
  font-family: 'Noto Kufi Arabic', 'Inter', sans-serif;
}

html[dir="rtl"] body {
  font-family: 'Noto Kufi Arabic', 'Inter', sans-serif;
  text-align: right;
}

/* Language Toggle Styles */
.language-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 25px;
  padding: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.language-toggle button {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.language-toggle button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.language-toggle button.active {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-dark);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Mobile Language Toggle */
@media (max-width: 768px) {
  .language-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }
  
  html[dir="rtl"] .language-toggle {
    right: auto;
    left: 1rem;
  }
  
  .language-toggle button {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
  }
}

/* Enhanced Mobile Navigation */
@media (max-width: 1024px) {
  .navbar {
    padding: 0.75rem 0;
  }
  
  .navbarOpen {
    z-index: 1001;
  }
  
  .menu-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  html[dir="rtl"] .menu-wrapper {
    transform: translateX(100%);
  }
  
  .menu-wrapper.active {
    transform: translateX(0);
  }
  
  .menu-wrapper nav ul {
    flex-direction: column;
    gap: 2rem;
    text-align: center;
  }
  
  .menu-wrapper nav ul li a {
    font-size: 1.25rem;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: 12px;
    transition: all 0.3s ease;
  }
  
  .menu-wrapper nav ul li a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
  }
}

/* RTL Specific Adjustments */
html[dir="rtl"] .ud-text-left {
  text-align: right !important;
}

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

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

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

/* Service Cards Enhancement */
.service-card {
  transition: all 0.3s ease;
  border-radius: 16px;
  overflow: hidden;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.service-card .service-icon {
  transition: all 0.3s ease;
}

.service-card:hover .service-icon {
  transform: scale(1.1);
}

/* Order Button Enhancement */
.order-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s ease;
  margin-top: 0.75rem;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.order-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
  text-decoration: none;
  color: white;
}

.coming-soon-badge {
  background: linear-gradient(135deg, var(--warning-color), #F97316);
  color: white;
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
  margin-top: 0.5rem;
}

/* Hero Section Mobile Optimization */
@media (max-width: 768px) {
  .hero-section {
    padding-top: 8rem !important;
    padding-bottom: 4rem !important;
  }
  
  .hero-title {
    font-size: 2rem !important;
    line-height: 1.2 !important;
    margin-bottom: 1rem !important;
  }
  
  .hero-subtitle {
    font-size: 1rem !important;
    margin-bottom: 1rem !important;
  }
  
  .hero-description {
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
  }
}

/* Services Section Mobile Optimization */
@media (max-width: 768px) {
  .services-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
  
  .service-card {
    max-width: 100% !important;
    margin: 0 auto !important;
  }
  
  .services-title {
    font-size: 2rem !important;
    line-height: 1.3 !important;
  }
  
  .services-description {
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
  }
}

/* Contact Section Enhancement */
.contact-info {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(30, 64, 175, 0.05));
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid rgba(59, 130, 246, 0.1);
}

/* Legacy contact styles removed - using new contact-grid styles below */

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus States */
button:focus,
a:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Loading State */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Dark Mode Enhancements */
.dark .language-toggle {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.1);
}

.dark .language-toggle button.active {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-dark);
}

/* Old dark mode contact styles removed - using new contact-grid dark mode styles */

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

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

.slide-in-right {
  animation: slideInRight 0.6s ease forwards;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

html[dir="rtl"] .slide-in-right {
  animation: slideInLeft 0.6s ease forwards;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Contact Section Styles */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.contact-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.contact-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.95);
}

.contact-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  margin-top: 0.25rem;
}

.contact-content {
  flex: 1;
  line-height: 1.4;
  font-size: 0.95rem;
}

.contact-content strong {
  font-weight: 600;
  color: var(--text-dark);
  display: block;
  margin-bottom: 0.25rem;
}

.contact-content span {
  color: var(--text-light);
  font-weight: 500;
}

/* RTL Support for Contact Section */
html[dir="rtl"] .contact-card {
  flex-direction: row-reverse;
}

html[dir="rtl"] .contact-content {
  text-align: right;
}

/* RTL Support for About Section */
html[dir="rtl"] #about .ud-flex.ud-items-start.ud-space-x-4,
html[dir="rtl"] .ud-flex.ud-items-start.ud-space-x-4 {
  flex-direction: row-reverse !important;
  gap: 1rem;
}

html[dir="rtl"] #about .ud-space-x-4 > * + *,
html[dir="rtl"] .ud-space-x-4 > * + * {
  margin-left: 0 !important;
  margin-right: 1rem !important;
}

html[dir="rtl"] #about .ud-text-base.ud-text-body,
html[dir="rtl"] .ud-text-base.ud-text-body {
  text-align: right !important;
}

/* More specific RTL selectors for About section */
html[dir="rtl"] section#about .ud-space-y-4 .ud-flex {
  flex-direction: row-reverse !important;
}

html[dir="rtl"] section#about p {
  text-align: right !important;
  direction: rtl;
}

/* Force RTL layout for About section - Override Tailwind */
html[dir="rtl"] section#about div.ud-flex.ud-items-start {
  flex-direction: row-reverse !important;
}

html[dir="rtl"] section#about div.ud-space-y-4 > div {
  flex-direction: row-reverse !important;
}

/* Ensure checkmark icons are on the right in RTL */
html[dir="rtl"] section#about .ud-flex-shrink-0 {
  order: 2;
}

html[dir="rtl"] section#about .ud-text-base {
  order: 1;
  text-align: right !important;
  flex: 1;
}

/* Specific RTL styles for about-features */
html[dir="rtl"] .about-features .ud-flex {
  flex-direction: row-reverse !important;
}

html[dir="rtl"] .about-features .ud-flex-shrink-0 {
  margin-left: 1rem !important;
  margin-right: 0 !important;
}

html[dir="rtl"] .about-features p {
  text-align: right !important;
  direction: rtl !important;
}

/* Override any conflicting Tailwind spacing */
html[dir="rtl"] .about-features .ud-space-x-4 > :not([hidden]) ~ :not([hidden]) {
  margin-right: 1rem !important;
  margin-left: 0 !important;
}

/* RTL Support for Navigation Menu */
html[dir="rtl"] .menu-item {
  margin-left: 0 !important;
  margin-right: 2rem !important;
}

html[dir="rtl"] .menu-item:last-child {
  margin-right: 0 !important;
}

html[dir="rtl"] nav ul {
  flex-direction: row-reverse;
}

html[dir="rtl"] nav ul li {
  margin-left: 0;
  margin-right: 2rem;
}

html[dir="rtl"] nav ul li:first-child {
  margin-right: 0;
}

/* Ensure proper spacing between nav items in RTL */
html[dir="rtl"] .menu-item + .menu-item {
  margin-right: 2rem !important;
  margin-left: 0 !important;
}

/* Ensure proper spacing in RTL for about section */
html[dir="rtl"] .ud-space-y-4 > * + * {
  margin-top: 1rem;
}

/* RTL Support for Services Section */
html[dir="rtl"] #Services .ud-text-center {
  text-align: right;
}

html[dir="rtl"] #Services h3 {
  text-align: right;
}

html[dir="rtl"] #Services p {
  text-align: right;
}

html[dir="rtl"] #Services .ud-text-base.ud-text-body {
  text-align: right;
  direction: rtl;
}

html[dir="rtl"] #Services .order-btn {
  float: left;
  margin-left: 0;
  margin-right: 0.5rem;
}

/* RTL Support for Service Cards */
html[dir="rtl"] .service-card {
  text-align: right;
}

html[dir="rtl"] .service-card h3 {
  text-align: right;
}

html[dir="rtl"] .service-card p {
  text-align: right;
  direction: rtl;
}

/* RTL Support for Coming Soon badges */
html[dir="rtl"] .coming-soon-badge {
  float: left;
  margin-left: 0;
  margin-right: 0.5rem;
}

/* General RTL Layout Improvements */
html[dir="rtl"] .order-btn {
  float: left;
  clear: left;
  margin-top: 0.5rem;
}

html[dir="rtl"] .ud-text-body span {
  display: block;
  margin-bottom: 0.5rem;
}

/* RTL Support for Service Descriptions */
html[dir="rtl"] [data-translate*="service_"] {
  text-align: right;
  direction: rtl;
}

/* Ensure proper line breaks in RTL */
html[dir="rtl"] .service-card p {
  line-height: 1.6;
  word-wrap: break-word;
}

/* RTL Support for main sections */
html[dir="rtl"] main {
  direction: rtl;
}

html[dir="rtl"] section {
  direction: rtl;
}

/* Dark Mode Support */
.dark .contact-card {
  background: rgba(31, 41, 55, 0.9);
  border-color: #4b5563;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dark .contact-card:hover {
  background: rgba(31, 41, 55, 0.95);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.dark .contact-content strong {
  color: #ffffff !important;
  font-weight: 600;
}

.dark .contact-content span {
  color: #e5e7eb !important;
  font-weight: 500;
}

/* Ensure dark mode text is always visible */
.dark #Contact .contact-content strong,
.dark #Contact .contact-content span {
  color: #ffffff !important;
}

.dark #Contact h3 {
  color: #ffffff !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .contact-card {
    padding: 1.25rem;
  }
  
  .contact-icon {
    width: 35px;
    height: 35px;
    font-size: 1.25rem;
  }
  
  .contact-content {
    font-size: 0.9rem;
  }
}
