/* Modern Polymer-style Design System */
:root {
  /* Color palette inspired by Material Design */
  --primary-color: #1976d2;
  --primary-variant: #1565c0;
  --secondary-color: #03a9f4;
  --surface-color: #ffffff;
  --background-color: #fafafa;
  --error-color: #f44336;
  --on-primary: #ffffff;
  --on-secondary: #ffffff;
  --on-surface: #212121;
  --on-background: #212121;
  
  /* Typography */
  --font-family-primary: 'Roboto', 'Arial', sans-serif;
  --font-family-display: 'Roboto Slab', serif;
  
  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-xxl: 48px;
  
  /* Elevation/Shadows */
  --elevation-1: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
  --elevation-2: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
  --elevation-3: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
  --elevation-4: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
  
  /* Border radius */
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;

  /* Transitions */
  --transition-fast: 0.2s ease-in-out;
  --transition-medium: 0.4s ease-in-out;
  --transition-slow: 0.6s ease-in-out;
}

/* Make top navbar 3mm (≈11.34px) wider */
.navbar-elix {
  min-height: 121px;
  height: 121px;
}

.navbar-elix-content {
  min-height: 121px;
  height: 121px;
}

/* RTL Support */
.rtl {
  direction: rtl;
  text-align: right;
}

.rtl .navbar-elix-content {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  direction: ltr; /* Override RTL for navbar content */
}

.rtl .language-switcher {
  order: 0;
  margin-left: 16px; /* flipped for RTL */
  direction: ltr;
}

.rtl .navbar-elix-brand {
  order: 0;
  text-align: left;
  direction: ltr;
}

.rtl .navbar-elix-nav {
  order: 0;
  flex: 1;
  justify-content: center;
  direction: ltr;
}

.rtl .navbar-elix-actions {
  order: 0;
  direction: ltr;
}

/* Only apply RTL to content areas, not navigation */
.rtl .hero-content,
.rtl .card-body,
.rtl .footer-polymer {
  direction: rtl;
  text-align: right;
}

.rtl .carousel-container,
.rtl .carousel-cube,
.rtl .carousel-slide {
  direction: ltr; /* Keep carousel mechanics LTR */
}

.rtl .slide-content {
  direction: rtl; /* Content inside slides should be RTL */
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color var(--transition-fast);
}

.mobile-menu-toggle:hover {
  background-color: #f7fafc;
}

.mobile-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: #4a5568;
  border-radius: 1px;
  transition: all var(--transition-fast);
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile nav */
.mobile-nav {
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out;
}

.mobile-nav.show {
  max-height: 300px;
}

.mobile-nav-list {
  list-style: none;
  margin: 0;
  padding: 16px 0;
}

.mobile-nav-link {
  display: block;
  color: #4a5568;
  text-decoration: none;
  font-weight: 500;
  padding: 12px 0;
  border-bottom: 1px solid #f7fafc;
  transition: color var(--transition-fast);
}

.mobile-nav-link:hover {
  color: var(--primary-color);
}

/* Center nav links horizontally in the navbar */
.navbar-elix-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding: 0;
  flex: 1;
}

.nav-list {
  display: flex;
  flex-direction: row;
  gap: 2.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: center;
  width: 100%;
}

/* Make navbar links black and blue on hover */
.nav-link-elix {
  color: #111 !important;
  background: none;
  border: none;
  outline: none;
  transition: color 0.2s;
}

/* Ensure scale effect works on nav-link-elix */
.nav-link-elix {
  display: inline-block;
}

/* Smooth scale-up effect on hover for nav links and social icons */
.nav-link-elix,
.nav-link-elix:visited,
.nav-link-elix:active,
.nav-link-elix:focus {
  transition: color 0.2s, transform 0.25s cubic-bezier(0.4,0,0.2,1);
}

.nav-link-elix:hover,
.nav-link-elix:focus {
  transform: scale(1.12) !important;
}

/* Remove underline from all nav links in the top bar */
.nav-link-elix,
.nav-link-elix:visited,
.nav-link-elix:active,
.nav-link-elix:focus {
  text-decoration: none !important;
  box-shadow: none !important;
}

/* Remove underline from nav links */
.nav-link-elix::after {
  display: none !important;
}

.nav-link-elix:hover,
.nav-link-elix:focus {
  color: #1976d2 !important;
}

/* Social icons in the top bar */
.navbar-elix-actions a img,
.navbar-elix-actions a:visited img,
.navbar-elix-actions a:active img,
.navbar-elix-actions a:focus img {
  transition: box-shadow 0.2s, transform 0.25s cubic-bezier(0.4,0,0.2,1);
}

.navbar-elix-actions a:hover img,
.navbar-elix-actions a:focus img {
  transform: scale(1.18);
  box-shadow: 0 4px 16px rgba(25, 118, 210, 0.18);
}

/* Responsive behavior */
@media (min-width: 768px) {
  .navbar-elix-nav {
    display: flex;
  }
  
  .navbar-elix-actions {
    display: flex;
  }
  
  .mobile-menu-toggle {
    display: none;
  }
}

/* Navbar brand */
.navbar-brand {
  font-family: var(--font-family-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 1px;
}

/* Nav link */
.nav-link {
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
}

.nav-link::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--secondary-color);
  transition: all var(--transition-fast);
  transform: translateX(-50%);
}

.nav-link:hover::before {
  width: 80%;
}

/* Focus styles for accessibility */
.btn-polymer:focus,
.nav-link:focus {
  outline: 2px solid var(--secondary-color);
  outline-offset: 4px;
}

/* Hero Carousel with Ultra-Smooth Horizontal Slide Effect */
.hero-carousel {
  position: relative;
  height: 70vh;
  min-height: 500px;
  overflow: hidden;
  background: #000;
}

.carousel-container {
  position: relative;
  width: 100%;
  height: 100%;
  will-change: transform;
}

/* Carousel Slide Container */
.carousel-cube {
  position: relative;
  width: 300%;
  height: 100%;
  display: flex;
  transition: transform 1.2s cubic-bezier(0.23, 1, 0.32, 1);
  transform: translateX(0);
  will-change: transform;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.carousel-slide {
  position: relative;
  width: 33.333%;
  height: 100%;
  flex-shrink: 0;
  overflow: hidden;
}

/* Slide States - Left to Right Movement */
.carousel-cube.slide-1 {
  transform: translateX(0) translateZ(0);
}

.carousel-cube.slide-2 {
  transform: translateX(-33.333%) translateZ(0);
}

.carousel-cube.slide-3 {
  transform: translateX(-66.666%) translateZ(0);
}

.slide-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
  backface-visibility: hidden;
}

.carousel-slide:hover .slide-background {
  transform: scale(1.02) translateZ(0);
}

.carousel-cube::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, 
    rgba(0,0,0,0.1) 0%, 
    rgba(0,0,0,0) 15%, 
    rgba(0,0,0,0) 85%, 
    rgba(0,0,0,0.1) 100%);
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

/* Smooth slide content animations */
.slide-content {
  opacity: 1;
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: opacity;
}

.slide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
  z-index: 1;
}

.slide-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: center;
  color: white;
}

/* Enhanced Navigation Dots */
.carousel-dots {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  z-index: 10;
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 25px;
  backdrop-filter: blur(10px);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  background: transparent;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
}

.dot::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: white;
  border-radius: 50%;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: translate(-50%, -50%);
}

.dot.active::before,
.dot:hover::before {
  width: 100%;
  height: 100%;
}

.dot.active,
.dot:hover {
  border-color: white;
  transform: scale(1.3);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

/* Ultra-Smooth Navigation Arrows */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(15px);
  will-change: transform;
}

.carousel-arrow::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255,255,255,0.1), rgba(255,255,255,0.3));
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.carousel-arrow:hover::before {
  opacity: 1;
}

.carousel-arrow:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.8);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.carousel-arrow:active {
  transform: translateY(-50%) scale(0.95);
}

.carousel-arrow-prev {
  left: 30px;
}

.carousel-arrow-next {
  right: 30px;
}

/* Hero content */
.hero-title {
  font-family: var(--font-family-display);
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 900;
  letter-spacing: 2px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  margin-bottom: var(--spacing-md);
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 300;
  opacity: 0.9;
  margin-bottom: var(--spacing-xl);
}

/* Polymer-style buttons */
.btn-polymer {
  background: var(--primary-color);
  color: var(--on-primary);
  border: none;
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-md) var(--spacing-xl);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: var(--elevation-2);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  will-change: transform, box-shadow;
}

.btn-polymer::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transition: all var(--transition-medium);
  transform: translate(-50%, -50%);
}

.btn-polymer:hover {
  transform: translateY(-2px);
  box-shadow: var(--elevation-3);
}

.btn-polymer:hover::before {
  width: 300px;
  height: 300px;
}

.btn-polymer:active {
  transform: translateY(0);
  box-shadow: var(--elevation-1);
}

/* Polymer-style cards */
.card-polymer {
  background: var(--surface-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--elevation-1);
  transition: all var(--transition-fast);
  overflow: hidden;
  border: none;
  will-change: transform, box-shadow;
}

.card-polymer:hover {
  transform: translateY(-4px);
  box-shadow: var(--elevation-3);
}

/* Footer styling */
.footer-polymer {
  background: linear-gradient(135deg, #2c3e50, #34495e);
  color: white;
  padding: var(--spacing-xl) 0;
  margin-top: var(--spacing-xxl);
}

/* Modern, pretty language switcher */
.language-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f3f6fa;
  border-radius: 18px;
  padding: 4px 10px;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.07);
  border: 1px solid #e3eaf2;
}

.lang-btn {
  background: none;
  border: none;
  color: #1976d2;
  font-family: 'Vazirmatn', 'Roboto', 'Arial', sans-serif;
  font-weight: 700;
  font-size: 1.08rem;
  padding: 6px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  outline: none;
  box-shadow: none;
}

.lang-btn.active,
.lang-btn:hover,
.lang-btn:focus {
  background: linear-gradient(90deg, #1976d2 0%, #03a9f4 100%);
  color: #fff;
  transform: scale(1.08);
}

/* Responsive design */
@media (max-width: 768px) {
  .hero-carousel {
    height: 60vh;
    min-height: 400px;
  }
  
  .carousel-arrow {
    width: 40px;
    height: 40px;
  }
  
  .carousel-arrow-prev {
    left: 15px;
  }
  
  .carousel-arrow-next {
    right: 15px;
  }
  
  .carousel-dots {
    bottom: 20px;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .btn-polymer {
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 0.9rem;
  }
}
