/* Mobile Slider Optimizations - Enhanced Touch Experience */

/* Mobile-specific variables */
:root {
  --mobile-touch-target: 48px;
  --mobile-transition-duration: 0.3s;
  --mobile-animation-duration: 0.4s;
  --mobile-swipe-threshold: 40px;
  --mobile-progress-height: 4px;
  --mobile-indicator-size: 36px;
  --mobile-indicator-spacing: 10px;
}

/* Mobile slider container optimizations - ONLY for mobile */
@media (max-width: 768px) {
  .mobile-slider {
    touch-action: pan-y pinch-zoom;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    position: relative;
  }

  /* Mobile slide optimizations */
  .mobile-slide {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
    padding: 0.75rem !important;
    align-items: center !important;
    justify-items: center;
    padding-top: 8rem !important;
  }

  /* First slide special styling for mobile */
  .mobile-slide:first-child {
    padding: 0.75rem !important;
    gap: 0.75rem !important;
    padding-top: 6rem !important;
  }

  .mobile-slide:first-child .mobile-card {
    padding: 1rem !important;
    max-width: 90% !important; /* افزایش عرض برای موبایل */
  }

  .mobile-slide:first-child .mobile-card h2 {
    font-size: clamp(18px, 4.5vw, 24px) !important; /* افزایش اندازه فونت */
    margin-bottom: 0.5rem !important;
    line-height: 1.2 !important;
  }

  .mobile-slide:first-child .mobile-card .subtitle {
    font-size: clamp(14px, 3.5vw, 18px) !important; /* افزایش اندازه subtitle */
    margin-bottom: 0.75rem !important;
    line-height: 1.3 !important;
  }

  .mobile-slide:first-child .mobile-card p {
    font-size: clamp(13px, 3vw, 15px) !important; /* افزایش اندازه متن */
    margin-bottom: 0.5rem !important;
    line-height: 1.5 !important;
  }
  
  .mobile-slide:first-child .mobile-card .service-description > p {
    font-size: clamp(14px, 3.5vw, 16px) !important;
    line-height: 1.6 !important;
    margin-bottom: 0.75rem !important;
  }
  
  .mobile-slide:first-child .mobile-card .contact-info {
    margin-top: 1.5rem !important;
    gap: 0.75rem !important;
  }
  
  .mobile-slide:first-child .mobile-card .contact-card {
    padding: 0.75rem !important;
  }
  
  .mobile-slide:first-child .mobile-card .contact-card h4 {
    font-size: 0.9rem !important;
    margin-bottom: 0.3rem !important;
  }
  
  .mobile-slide:first-child .mobile-card .contact-card p {
    font-size: 0.8rem !important;
    margin-bottom: 0.2rem !important;
  }

  /* Mobile card optimizations */
  .mobile-card {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 1rem !important;
    border-radius: 12px !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .mobile-card h2 {
    font-size: clamp(18px, 4.5vw, 24px) !important;
    line-height: 1.2 !important;
    margin-bottom: 0.5rem !important;
  }

  .mobile-card .subtitle {
    font-size: clamp(14px, 3.5vw, 18px) !important;
    margin-bottom: 0.75rem !important;
    opacity: 0.9;
  }

  .mobile-card p {
    font-size: clamp(13px, 3vw, 15px) !important;
    line-height: 1.5 !important;
    margin-bottom: 0.5rem !important;
  }

  /* Mobile media optimizations */
  .mobile-media-wrap {
    min-height: 200px !important;
    max-height: 35vh !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin-top: 1rem !important;
  }

  .mobile-media {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 8px !important;
  }

  /* Mobile navigation buttons */
  .mobile-nav-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all var(--mobile-transition-duration) ease !important;
    position: absolute !important;
    bottom: 1rem !important;
    top: auto !important;
    transform: none !important;
  }

  .mobile-nav-btn.prev {
    left: 1rem !important;
    right: auto !important;
  }

  .mobile-nav-btn.next {
    right: 1rem !important;
    left: auto !important;
  }

  .mobile-nav-btn:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: scale(1.05) !important;
  }

  .mobile-nav-btn:active {
    transform: scale(0.95) !important;
    background: rgba(255, 255, 255, 0.3) !important;
  }

  /* Mobile indicators */
  .mobile-indicators {
    position: absolute !important;
    bottom: 1rem !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    gap: var(--mobile-indicator-spacing) !important;
    z-index: 100 !important;
    padding: 0.5rem !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border-radius: 16px !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .mobile-indicator {
    width: var(--mobile-indicator-size) !important;
    height: var(--mobile-indicator-size) !important;
    min-width: 36px !important;
    min-height: 36px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.3) !important;
    border: none !important;
    cursor: pointer !important;
    transition: all var(--mobile-transition-duration) ease !important;
    padding: 6px !important;
    margin: 3px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    touch-action: manipulation !important;
  }

  .mobile-indicator.active {
    background: rgba(255, 255, 255, 0.8) !important;
    transform: scale(1.2) !important;
  }

  .mobile-indicator:hover {
    background: rgba(255, 255, 255, 0.5) !important;
    transform: scale(1.1) !important;
  }

  /* Mobile progress bar */
  .mobile-progress-container {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: var(--mobile-progress-height) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    z-index: 1000 !important;
  }

  .mobile-progress-bar {
    height: 100% !important;
    background: linear-gradient(90deg, var(--accent), var(--accent-2)) !important;
    width: 0% !important;
    transition: width 0.1s linear !important;
  }

  /* Mobile contact info styling */
  .contact-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    margin-top: 1rem !important;
  }

  .contact-card {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    padding: 0.75rem !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
  }

  .contact-card h4 {
    font-size: 0.8rem !important;
    margin-bottom: 0.2rem !important;
    color: var(--accent) !important;
    font-weight: 600 !important;
  }

  .contact-card p {
    font-size: 0.7rem !important;
    margin-bottom: 0.1rem !important;
    line-height: 1.2 !important;
    color: #e5efff !important;
  }

  /* Mobile service descriptions - larger text boxes */
  .service-description,
  .treatment-description,
  .ultrasound-description,
  .elastography-description,
  .fna-description,
  .rf-description,
  .non-surgical-description {
    margin-bottom: 1.5rem !important;
  }

  .service-description > p {
    font-size: clamp(16px, 4vw, 18px) !important;
    line-height: 1.6 !important;
    margin-bottom: 0.5rem !important;
  }
}

/* Mobile responsive breakpoints */
@media (max-width: 480px) {
  .mobile-slide {
    padding: 0.75rem !important;
    padding-top: 6rem !important;
  }
  
  .mobile-card {
    padding: 1rem !important;
  }
  
  .mobile-media-wrap {
    min-height: 200px !important;
    max-height: 35vh !important;
  }
  
  .mobile-nav-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    bottom: 0.75rem !important;
  }
  
  .mobile-nav-btn.prev {
    left: 0.75rem !important;
  }
  
  .mobile-nav-btn.next {
    right: 0.75rem !important;
  }
  
  .mobile-indicators {
    bottom: 0.75rem !important;
  }
}

@media (max-width: 360px) {
  .mobile-slide {
    padding: 0.5rem !important;
    padding-top: 4rem !important;
  }
  
  .mobile-card {
    padding: 0.75rem !important;
  }
  
  .mobile-card h2 {
    font-size: clamp(18px, 6vw, 24px) !important;
  }
  
  .mobile-card .subtitle {
    font-size: clamp(14px, 4.5vw, 18px) !important;
  }
  
  .mobile-card p {
    font-size: clamp(13px, 4vw, 15px) !important;
  }
  
  .mobile-nav-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    bottom: 0.5rem !important;
  }
  
  .mobile-nav-btn.prev {
    left: 0.5rem !important;
  }
  
  .mobile-nav-btn.next {
    right: 0.5rem !important;
  }
}

/* Landscape mobile optimizations */
@media (max-height: 500px) and (orientation: landscape) {
  .mobile-slide {
    grid-template-columns: 1fr 1fr !important;
    gap: 1rem !important;
    padding: 0.75rem !important;
    padding-top: 4rem !important;
  }
  
  .mobile-card {
    padding: 1rem !important;
  }
  
  .mobile-card h2 {
    font-size: clamp(16px, 4vw, 20px) !important;
  }
  
  .mobile-card .subtitle {
    font-size: clamp(14px, 3.5vw, 16px) !important;
  }
  
  .mobile-card p {
    font-size: clamp(12px, 3vw, 14px) !important;
  }
  
  .mobile-media-wrap {
    min-height: 150px !important;
    max-height: 80vh !important;
  }
  
  .mobile-indicators {
    bottom: 0.5rem !important;
  }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
  .tablet-slider .mobile-slide {
    grid-template-columns: 1fr 1fr !important;
    gap: 1.5rem !important;
    padding: 1.5rem !important;
  }
  
  .tablet-slider .mobile-card {
    padding: 1.5rem !important;
  }
  
  .tablet-slider .mobile-card h2 {
    font-size: clamp(24px, 4vw, 32px) !important;
  }
  
  .tablet-slider .mobile-card .subtitle {
    font-size: clamp(18px, 3vw, 22px) !important;
  }
  
  .tablet-slider .mobile-card p {
    font-size: clamp(16px, 2.5vw, 18px) !important;
  }
  
  .tablet-slider .mobile-media-wrap {
    min-height: 300px !important;
    max-height: 50vh !important;
  }
}

/* High DPI mobile displays */
@media (-webkit-min-device-pixel-ratio: 2) and (max-width: 768px) {
  .mobile-card {
    border-width: 0.5px !important;
  }
  
  .mobile-nav-btn {
    border-width: 0.5px !important;
  }
  
  .mobile-indicator {
    border-width: 0.5px !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    padding: 8px !important;
    margin: 4px !important;
    touch-action: manipulation !important;
  }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .mobile-slider * {
    transition: none !important;
    animation: none !important;
  }
  
  .mobile-progress-bar {
    transition: none !important;
  }
}

/* Dark mode optimizations for mobile */
@media (prefers-color-scheme: dark) {
  .mobile-card {
    background: rgba(0, 0, 0, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
  }
  
  .mobile-nav-btn {
    background: rgba(0, 0, 0, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
  }
  
  .mobile-indicator {
    background: rgba(255, 255, 255, 0.2) !important;
  }
  
  .mobile-indicator.active {
    background: rgba(255, 255, 255, 0.6) !important;
  }
}

/* Desktop overrides - ensure mobile styles don't affect desktop */
@media (min-width: 769px) {
  .mobile-slide {
    grid-template-columns: 1fr 1fr !important;
    gap: 3rem !important;
    padding: clamp(16px, 4vw, 48px) !important;
    padding-top: 0 !important;
    align-items: center !important;
    justify-items: stretch !important;
  }
  
  .mobile-card {
    max-width: 100% !important;
    margin: 0 !important;
    padding: clamp(16px, 2.5vw, 28px) !important;
    border-radius: 24px !important;
  }
  
  .mobile-card h2 {
    font-size: clamp(22px, 3.2vw, 40px) !important;
    line-height: 1.3 !important;
    margin-bottom: 1rem !important;
  }
  
  .mobile-card .subtitle {
    font-size: clamp(18px, 2.5vw, 24px) !important;
    margin-bottom: 1rem !important;
  }
  
  .mobile-card p {
    font-size: clamp(16px, 1.5vw, 18px) !important;
    line-height: 1.8 !important;
    margin-bottom: 1rem !important;
  }
  
  .mobile-media-wrap {
    min-height: 400px !important;
    max-height: 80vh !important;
    margin-top: 0 !important;
  }
  
  .mobile-media {
    max-height: 80vh !important;
    border-radius: 20px !important;
  }
  
  .mobile-nav-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    position: absolute !important;
  }
  
  .mobile-nav-btn.prev {
    right: 14px !important;
    left: auto !important;
  }
  
  .mobile-nav-btn.next {
    left: 14px !important;
    right: auto !important;
  }
  
  .mobile-indicators {
    display: none !important;
  }
  
  .mobile-progress-container {
    display: none !important;
  }
}
