/* ============================================
   BAZM-E-BME - Media Queries / Responsive
   ============================================ */

/* 
   RESPONSIVE BREAKPOINTS:
   - Extra Small (Mobile): 375px - 575px
   - Small (Large Mobile): 576px - 767px  
   - Medium (Tablet): 768px - 1023px
   - Large (Desktop): 1024px - 1199px
   - Extra Large (Wide Desktop): 1200px+
*/

/* Global overflow fix for all screen sizes */
html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  -webkit-overflow-scrolling: touch;
}

main {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

* {
  box-sizing: border-box;
}

/* Mobile Touch Improvements - Applied to all mobile sizes */
@media (max-width: 1024px) {
  /* Ensure all interactive elements have minimum tap target size */
  a, button, input, select, textarea, 
  .btn, .card, .nav-link, .mobile-nav-link,
  [role="button"], [onclick] {
    min-height: 44px;
    touch-action: manipulation;
  }
  
  /* Fix iOS Safari tap delay */
  * {
    -webkit-tap-highlight-color: transparent;
  }
  
  /* Ensure cards are clickable on mobile */
  .card {
    cursor: pointer;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
  
  /* Better button touch targets */
  .btn {
    min-height: 48px;
    padding: 14px 24px;
  }
  
  /* Header spacing for non-fullscreen hero sections */
  main > section:first-child:not([class*="hero"]):not([class*="100vh"]) {
    padding-top: 80px;
  }
}

/* Small screen header spacing fix */
@media (max-width: 768px) {
  /* Add padding to hero sections that aren't full height */
  .talents-hero-section,
  .contact-hero-section {
    padding-top: 100px;
  }
  
  /* Sections that start directly under header need extra top padding */
  main > section:first-child {
    scroll-margin-top: 70px;
  }
}

/* Extra small screens - more header padding */
@media (max-width: 576px) {
  .talents-hero-section {
    padding-top: 90px;
    min-height: 50vh;
  }
  
  .contact-hero-section {
    padding-top: 90px;
    min-height: 50vh;
  }
}

/* Very small screens */
@media (max-width: 374px) {
  .talents-hero-section,
  .contact-hero-section {
    padding-top: 80px;
    min-height: 45vh;
  }
}

/* Extra Large Desktops (1400px+) */
@media (min-width: 1400px) {
  .main,
  .container,
  .header-container,
  .footer-container {
    max-width: 1400px;
  }

  .hero-h1 {
    font-size: 4.2rem;
  }

  .section-head h2 {
    font-size: 3.2rem;
  }
}

/* Large Desktops (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
  .hero-section {
    padding: 120px 60px 100px;
  }
}

/* Medium Desktops / Laptops (992px - 1199px) */
@media (max-width: 1199px) {
  .hero-section {
    padding: 120px 40px 100px;
    gap: 40px;
  }

  .about-section {
    padding: 60px;
  }

  .cards-grid {
    gap: 24px;
  }

  .stats-bar {
    padding: 40px;
    gap: 24px;
  }
}

/* Tablets (768px - 991px) */
@media (max-width: 991px) {
  .section {
    padding: 80px 0;
  }

  /* Hero */
  .hero-section {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 100px 40px 120px;
    min-height: auto;
  }

  .hero-content {
    order: 1;
  }

  .hero-visual {
    order: 2;
    margin-top: 40px;
  }

  .hero-btns {
    justify-content: center;
  }

  .hero-p {
    margin: 0 auto 32px;
    max-width: 600px;
  }

  .medical-showcase {
    padding: 60px 100px;
  }

  /* Stats */
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    margin: -40px 24px 40px;
    padding: 36px;
  }

  .stat-number {
    font-size: 2.2rem;
  }

  /* About */
  .about-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-section {
    padding: 48px;
  }

  .about-text h2 {
    font-size: 2rem;
  }

  .about-image::before {
    top: -15px;
    right: -15px;
  }

  /* Cards */
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Large Phones / Small Tablets (576px - 767px) */
@media (max-width: 767px) {
  .main {
    padding: 0 16px;
  }

  .section {
    padding: 60px 0;
  }

  .section-head {
    margin-bottom: 40px;
  }

  .section-head h2 {
    font-size: 1.8rem;
  }

  .section-head p {
    font-size: 1rem;
  }

  /* Hero */
  .hero-section {
    padding: 80px 24px 100px;
  }

  .hero-h1 {
    font-size: 2rem;
  }

  .hero-p {
    font-size: 1rem;
  }

  .hero-badge {
    font-size: 0.75rem;
    padding: 6px 16px;
  }

  .main-image-container img {
    height: 300px;
  }

  .info-card {
    display: none;
  }

  .floating-elements {
    display: none;
  }

  /* Stats */
  .stats-bar {
    margin: -30px 16px 30px;
    padding: 28px;
    gap: 20px;
  }

  .stat-number {
    font-size: 1.8rem;
  }

  .stat-label {
    font-size: 0.8rem;
  }

  /* About */
  .about-section {
    padding: 32px;
    border-radius: 24px;
  }

  .about-text h2 {
    font-size: 1.8rem;
  }

  .about-text p {
    font-size: 1rem;
  }

  .about-image::before {
    display: none;
  }

  /* Cards */
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .card {
    border-radius: 20px;
  }

  .card-image {
    height: 200px;
  }

  .card-body {
    padding: 24px;
  }

  .card-body h3 {
    font-size: 1.2rem;
  }

  /* Buttons */
  .btn {
    padding: 12px 24px;
    font-size: 0.9rem;
  }

  .btn-container {
    margin-top: 32px;
  }
}

/* Small Phones (max-width: 575px) */
@media (max-width: 575px) {
  .main {
    padding: 0 12px;
  }

  /* Hero */
  .hero-section {
    padding: 70px 16px 80px;
  }

  .hero-h1 {
    font-size: 1.75rem;
    margin-bottom: 16px;
    line-height: 1.2;
  }

  .hero-p {
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.6;
  }

  .hero-btns {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  .hero-btns .btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  .main-image-container img {
    height: 250px;
  }

  /* Stats */
  .stats-bar {
    grid-template-columns: 1fr 1fr;
    margin: -25px 12px 25px;
    padding: 24px 20px;
    gap: 16px;
    border-radius: 20px;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  /* Section */
  .section {
    padding: 50px 0;
  }

  .section-head h2 {
    font-size: 1.6rem;
  }

  .section-tag {
    font-size: 0.7rem;
    padding: 5px 12px;
  }

  /* About */
  .about-section {
    padding: 24px;
    border-radius: 20px;
  }

  .about-text h2 {
    font-size: 1.5rem;
    margin-bottom: 16px;
  }

  /* Cards */
  .card-body {
    padding: 20px;
  }

  .card-body h3 {
    font-size: 1.1rem;
  }

  .card-meta {
    font-size: 0.8rem;
  }

  .card-body p {
    font-size: 0.9rem;
  }

  /* Forms - Mobile Friendly */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="url"],
  input[type="number"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px; /* Prevents zoom on iOS */
    min-height: 48px;
    padding: 12px 16px;
  }

  /* Ensure tap targets are large enough */
  button,
  .btn,
  a.btn {
    min-height: 48px;
    min-width: 48px;
    padding: 12px 20px;
  }
}

/* Extra Small Phones (max-width: 374px) */
@media (max-width: 374px) {
  .hero-h1 {
    font-size: 1.5rem;
  }

  .stats-bar {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .stat-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-200);
  }

  .stat-item:last-child {
    border-bottom: none;
  }
}

/* Landscape Mode for Phones */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-section {
    min-height: auto;
    padding: 60px 40px;
  }

  .hero-h1 {
    font-size: 1.8rem;
  }
}

/* High Resolution Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .main-image-container img,
  .about-image img,
  .card-image img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .dna-strand,
  .float-icon,
  .heartbeat-svg,
  .info-card {
    animation: none;
  }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
  /* Uncomment if you want automatic dark mode */
  /*
  :root {
    --gray-50: #0f172a;
    --gray-100: #1e293b;
    --white: #1e293b;
  }
  */
}

/* Print Styles */
@media print {
  .header,
  .footer,
  .hero-section,
  .dna-bg,
  .floating-elements,
  .heartbeat-line {
    display: none !important;
  }

  .section {
    padding: 20px 0;
  }

  .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
}