/* ============================================
   PARALLAX RESPONSIVE STYLES
   Mobile-first responsive design fixes
   ============================================ */

/* ============================================
   TABLET STYLES (768px - 1024px)
   ============================================ */
@media (max-width: 1024px) {
  /* Navigation adjustments */
  nav {
    width: calc(100% - 40px);
  }
  
  /* Slogan section - tablet */
  .slogan-section {
    padding-top: 32px !important; /* Reduced by 10% from 35px */
    padding-bottom: 32px !important;
    margin-top: 54px !important; /* Reduced by 10% from 60px */
  }
  
  /* Category buttons - tablet */
  .category-buttons-section {
    padding-top: 35px !important;
    padding-bottom: 0 !important;
  }

  /* Section cards */
  .section-card {
    /* margin and padding handled by width-consistency-fix.css */
    /* padding: 60px 40px; removed */
  }

  /* Calculator box */
  .calculator-box-section {
    /* margin handled by width-consistency-fix.css */
  }

  /* Hero section */
  .hero-section {
    /* margin and height handled by width-consistency-fix.css */
  }

  /* Service cards grid */
  .services-grid {
    grid-template-columns: repeat(2, 1fr); /* Keep 2 columns on tablet */
    gap: var(--space-md);
  }

  .service-card {
    min-height: 300px;
  }

  /* FAQ responsive */
  .faq-category {
    padding: 20px 28px; /* Reduced vertical padding, kept horizontal */
  }

  .faq-category-title {
    font-size: var(--font-heading-3); /* Uses responsive variable */
  }

  .faq-question {
    font-size: var(--font-heading-5); /* Uses responsive variable */
    padding: var(--space-md) 0;
  }

  /* Timeline adjustments */
  .timeline-item {
    margin-bottom: 60px; /* Proper spacing on tablet */
  }

  .timeline-item:last-child {
    margin-bottom: 0;
  }

  .timeline-item.left,
  .timeline-item.right {
    padding-left: 60px;
    padding-right: 0;
    justify-content: flex-start;
    align-items: flex-start;
  }

  .timeline-line {
    left: 20px;
  }

  .timeline-dot {
    left: 20px;
    top: 3px; /* Center of dot (8px) aligns with center of h3 text (~11px) */
  }

  /* Adjust connector line for single column - REMOVED */
  .timeline-content::before {
    display: none !important; /* Hide horizontal connector lines on mobile */
  }

  /* Contact section tablet */
  .contact-grid {
    gap: var(--space-2xl);
  }

  .expert-photo {
    width: 180px;
    height: 180px;
  }
}

/* ============================================
   MOBILE STYLES (480px - 768px)
   ============================================ */
@media (max-width: 768px) {
  /* Navigation */
  nav {
    width: calc(100% - 32px);
    padding: 12px 20px;
    top: 10px;
    gap: 24px;
  }
  
  .nav-right {
    gap: 8px;
  }

  .nav-center {
    display: none;
  }

  .hamburger {
    display: none; /* Hide hamburger button on mobile */
  }

  .info-btn {
    display: none; /* Hide info button on mobile */
  }

  .social-btn,
  .theme-toggle,
  .language-toggle {
    width: 38px;
    height: 38px;
  }

  .logo-img {
    height: 28px; /* Slightly smaller on tablets */
  }

  /* Typography scale down */
  .section-title {
    font-size: var(--font-heading-1); /* Uses responsive variable */
  }

  .slogan-title {
    font-size: var(--font-display-1); /* Uses responsive variable: 32px on mobile */
  }
  
  .slogan-section {
    padding-top: 27px !important; /* Reduced by 10% from 30px */
    padding-bottom: 27px !important;
    margin-top: 36px !important; /* Reduced by 10% from 40px */
  }
  
  /* Category buttons - mobile */
  .category-buttons-section {
    padding-top: 30px !important;
    padding-bottom: 0 !important;
  }
  
  .slogan-subtitle {
    font-size: clamp(13px, 1.6vw, 16px);
  }

  /* Section cards */
  .section-card {
    /* margin and padding handled by width-consistency-fix.css */
    border-radius: var(--radius-xl);
  }

  /* Calculator box */
  .calculator-box-section {
    /* margin handled by width-consistency-fix.css */
  }

  /* Hero section */
  .hero-section {
    /* margin and height handled by width-consistency-fix.css */
    border-radius: var(--radius-xl);
  }

  /* CRITICAL FIX: Service cards mobile centering */
  .services-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: var(--space-md);
    padding: 0 var(--space-md);
  }

  .service-card {
    width: 100%;
    max-width: 400px;
    margin: 0 auto; /* Centers the card */
    padding: var(--space-lg);
    min-height: 280px;
  }

  .service-content h3 {
    font-size: var(--font-heading-3); /* Uses responsive variable */
  }

  .service-content p {
    font-size: var(--font-body-base); /* Uses responsive variable */
  }

  /* FAQ mobile */
  .faq-container {
    gap: var(--space-xl);
  }

  .faq-category {
    padding: 16px 24px; /* Reduced vertical padding, kept horizontal */
  }

  .faq-category-title {
    font-size: var(--font-heading-3); /* Uses responsive variable */
    margin-bottom: 16px; /* Reduced spacing */
  }

  .faq-question {
    font-size: var(--font-heading-5); /* Uses responsive variable */
    padding: var(--space-sm) 0;
  }

  .faq-icon {
    width: 18px;
    height: 18px;
  }

  .faq-answer p {
    font-size: var(--font-body-base); /* Uses responsive variable */
  }

  /* Category buttons */
  .category-buttons {
    justify-content: center;
    padding: 0 var(--space-md);
    gap: var(--space-sm);
  }

  .category-btn {
    padding: 9px 16px;
    font-size: var(--font-sm);
    min-width: 100px;
  }
  
  .category-buttons-section {
    padding-top: 30px;
    padding-bottom: 0;
  }

  /* Timeline mobile layout */
  .timeline-container {
    padding: var(--space-xl) 0;
  }

  .timeline-line {
    left: 16px;
  }

  .timeline-item {
    margin-bottom: 50px; /* Proper spacing on mobile */
  }

  .timeline-item:last-child {
    margin-bottom: 0;
  }

  .timeline-item.left,
  .timeline-item.right {
    padding-left: 50px;
    padding-right: var(--space-md);
    align-items: flex-start;
  }

  .timeline-content {
    max-width: 100%;
  }

  /* Mobile connector line - REMOVED */
  .timeline-content::before {
    display: none !important; /* Hide horizontal connector lines on mobile */
  }

  .timeline-dot {
    left: 16px;
    top: 3px; /* Center of dot (8px) aligns with center of h3 text (~11px) */
  }

  .timeline-number {
    display: none;
  }

  .timeline-number {
    font-size: var(--font-heading-4); /* Uses responsive variable */
  }

  .timeline-content h3 {
    font-size: var(--font-heading-3); /* Uses responsive variable */
  }

  .timeline-content p {
    font-size: var(--font-body-base); /* Uses responsive variable */
  }

  /* Contact section mobile */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .contact-content {
    text-align: center;
  }

  .phone-number {
    font-size: var(--font-xl);
    display: block;
  }

  .contact-buttons {
    justify-content: center;
  }

  .contact-btn {
    min-width: 200px;
  }

  .contact-card {
    padding: var(--space-xl);
  }

  .expert-photo {
    width: 180px;
    height: 180px;
  }

  /* Flags section */
  .flags-box {
    padding: 20px 0;
  }

  .flag-item {
    width: 60px;
    height: 45px;
  }

  /* Buttons mobile */
  .btn-primary,
  .btn-secondary,
  .btn-outline {
    width: 100%;
    justify-content: center;
    padding: 12px 24px;
    font-size: var(--font-sm);
  }

  /* Footer */
  footer {
    /* margin and padding handled by width-consistency-fix.css */
    border-radius: var(--radius-xl);
  }
  
  .footer-main {
    flex-direction: column;
    gap: 20px;
    align-items: center;
    text-align: center;
  }
  
  .footer-brand {
    margin-bottom: 4px;
    align-items: center;
  }
  
  .footer-logo {
    height: 32px;
    margin-bottom: 6px;
  }
  
  .footer-tagline {
    font-size: 13px;
    line-height: 1.4;
  }
  
  .footer-contact {
    gap: 20px;
    width: 100%;
    flex-direction: column;
    align-items: center;
  }
  
  .footer-info-group {
    gap: 6px;
    align-items: center;
    text-align: center;
  }
  
  .footer-info-group h4 {
    font-size: 12px;
    margin-bottom: 6px;
    letter-spacing: 1px;
  }
  
  .footer-info-group a,
  .footer-info-group p {
    font-size: 14px;
    line-height: 1.6;
  }
  
  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding-top: 16px;
  }
  
  .footer-bottom p {
    font-size: 12px;
    line-height: 1.5;
  }

  /* Utility overrides */
  .container {
    padding: 0 var(--space-md);
  }

  .section {
    padding: var(--space-2xl) 0;
  }
}

/* ============================================
   SMALL MOBILE STYLES (< 480px)
   ============================================ */
@media (max-width: 480px) {
  /* Navigation */
  nav {
    width: calc(100% - 24px);
    padding: 10px 16px;
    gap: 20px;
  }
  
  .nav-right {
    gap: 6px;
  }

  .logo {
    font-size: 14px; /* Reduced from var(--font-base) */
  }

  .logo-img {
    height: 24px; /* Reduced from 28px */
  }
  
  .social-btn,
  .theme-toggle,
  .language-toggle {
    width: 36px;
    height: 36px;
  }

  /* Typography */
  .section-title {
    font-size: var(--font-heading-1); /* Uses responsive variable: 22px on small mobile */
  }

  .slogan-title {
    font-size: var(--font-display-1); /* Uses responsive variable: 28px on small mobile */
  }
  
  .slogan-section {
    padding-top: 23px !important; /* Reduced by 10% from 25px */
    padding-bottom: 23px !important;
    margin-top: 32px !important; /* Reduced by 10% from 35px */
  }
  
  /* Category buttons - small mobile */
  .category-buttons-section {
    padding-top: 25px !important;
    padding-bottom: 0 !important;
  }

  .slogan-subtitle {
    font-size: var(--font-base);
  }

  /* Section cards */
  .section-card {
    margin: 24px 12px; /* Proportional to desktop spacing */
    padding: 32px 20px;
    border-radius: var(--radius-lg);
  }

  /* Calculator box */
  .calculator-box-section {
    margin: 24px 12px;
  }

  /* Hero section */
  .hero-section {
    margin: 24px 12px;
    height: 440px;
    border-radius: var(--radius-lg);
  }

  /* CRITICAL FIX: Service cards small mobile */
  .services-grid {
    padding: 0 var(--space-sm);
  }

  .service-card {
    padding: var(--space-md);
    max-width: 100%;
    min-height: 260px;
  }

  .service-icons {
    flex-wrap: wrap;
  }

  .icon-badge,
  .country-flag {
    font-size: 20px;
    padding: 6px 10px;
  }

  /* Category buttons */
  .category-buttons {
    gap: var(--space-sm);
  }

  .category-btn {
    padding: 8px 14px;
    font-size: 12px;
    min-width: 90px;
  }

  /* Visa Pricing Mobile */
  .visa-item {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .visa-info {
    flex: 0 0 100%;
  }

  .visa-price {
    font-size: var(--font-price-base);
    align-self: center;
  }

  .visa-region-title {
    font-size: var(--font-heading-3); /* Uses responsive variable */
    padding: var(--space-sm) var(--space-md);
  }

  /* Timeline */
  .timeline-item {
    margin-bottom: 40px; /* Proper compact spacing for small screens */
  }

  .timeline-item:last-child {
    margin-bottom: 0;
  }

  .timeline-item.left,
  .timeline-item.right {
    padding-left: 40px;
    padding-right: var(--space-sm);
  }

  .timeline-content {
    padding: 0;
  }

  .timeline-content::before {
    display: none !important; /* Hide horizontal connector lines on small mobile */
  }

  .timeline-dot {
    top: 3px; /* Center of dot (8px) aligns with center of h3 text (~11px) */
  }

  .timeline-number {
    display: none;
  }

  .timeline-content h3 {
    font-size: var(--font-heading-3); /* Uses responsive variable */
  }

  .timeline-content p {
    font-size: var(--font-body-base); /* Uses responsive variable */
  }

  /* Contact section */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .contact-content > p {
    font-size: var(--font-base);
  }

  .phone-number {
    font-size: var(--font-xl);
  }

  .contact-buttons {
    flex-direction: column;
  }

  .contact-btn {
    width: 100%;
  }

  .expert-photo {
    width: 150px;
    height: 150px;
    border-width: 4px;
  }

  /* Buttons */
  .btn-primary,
  .btn-secondary,
  .btn-outline {
    padding: 10px 20px;
    font-size: 13px;
  }

  /* Footer */
  footer {
    /* margin and padding handled by width-consistency-fix.css */
    border-radius: var(--radius-lg);
  }
  
  .footer-main {
    gap: 18px;
  }
  
  .footer-brand {
    margin-bottom: 2px;
  }
  
  .footer-logo {
    height: 28px;
    margin-bottom: 4px;
  }
  
  .footer-tagline {
    font-size: 12px;
  }
  
  .footer-contact {
    gap: 18px;
  }
  
  .footer-info-group {
    gap: 5px;
  }
  
  .footer-info-group h4 {
    font-size: 11px;
    margin-bottom: 5px;
  }
  
  .footer-info-group a,
  .footer-info-group p {
    font-size: 13px;
  }
  
  .footer-bottom {
    padding-top: 14px;
    gap: 5px;
  }
  
  .footer-bottom p {
    font-size: 11px;
    line-height: 1.4;
  }
}

/* ============================================
   CARD CENTERING FIXES FOR ALL BREAKPOINTS
   ============================================ */
@media (max-width: 768px) {
  /* Ensure all cards are centered on mobile */
  .service-card,
  .pricing-card,
  .why-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    margin-left: auto;
    margin-right: auto;
  }

  /* Center card content */
  .service-content,
  .pricing-content,
  .why-content {
    width: 100%;
  }

  /* Pricing cards specific */
  .pricing-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    padding: 0 var(--space-md);
  }

  .pricing-card {
    max-width: 400px;
    margin: 0 auto;
  }

  /* Why us cards */
  .why-us-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    padding: 0 var(--space-md);
  }

  .why-card {
    max-width: 400px;
    margin: 0 auto;
  }
}

/* ============================================
   LANDSCAPE MOBILE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) and (orientation: landscape) {
  .hero-section {
    height: 350px;
  }

  .section-card {
    padding: 30px 40px;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .service-card {
    max-width: 100%;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  nav,
  .hamburger,
  .theme-toggle,
  .social-btn,
  footer {
    display: none;
  }

  .section-card {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }

  body {
    background: white;
    color: black;
  }
}

/* ============================================
   HIGH DPI SCREENS
   ============================================ */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
  /* Sharper borders and shadows for retina */
  .section-card,
  .service-card,
  .pricing-card,
  .why-card {
    border-width: 0.5px;
  }
}

/* ============================================
   MOTION PREFERENCES
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================
   DARK MODE PREFERENCES
   ============================================ */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg-primary: #0a0a14;
    --color-bg-secondary: #0f0f1a;
    --color-bg-tertiary: #14141f;
    --color-text-primary: #ffffff;
    --color-text-secondary: rgba(255, 255, 255, 0.7);
    --color-text-muted: rgba(255, 255, 255, 0.5);
  }
}
