/* Mobile optimizations for iPhone and other mobile devices */

/* Level 1 Heading (H1) Styling */
h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #27ae60;
  margin: 1.5rem 0 1rem 0;
  line-height: 1.2;
  border-bottom: 3px solid #2ecc71;
  padding-bottom: 0.5rem;
  text-align: left;
}

/* Table Header Styling */
th {
  background-color: #1e8449;
  color: white;
  font-weight: 600;
  padding: 0.75rem;
  text-align: left;
  border: 1px solid #27ae60;
}

/* Download Link Styling */
.download-link {
  display: inline-block;
  background-color: #27ae60;
  color: white !important;
  padding: 12px 24px;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  margin: 1rem 0;
  transition: background-color 0.3s ease;
  border: 2px solid #2ecc71;
}

.download-link:hover {
  background-color: #2ecc71;
  color: white !important;
  text-decoration: none;
}

.download-link:active {
  background-color: #1e8449;
  color: white !important;
}

/* Responsive images - 50% width on desktop, full width on mobile */
.responsive-image {
  max-width: 50%;
  height: auto;
  display: block;
  margin: 1rem 0;
}

/* Smaller responsive images - 25% width on desktop, 50% on mobile */
.responsive-image-small {
  max-width: 25%;
  height: auto;
  display: block;
  margin: 1rem 0;
}

@media screen and (max-width: 768px) {
  .responsive-image {
    max-width: 100%;
    width: 100%;
  }
  
  .responsive-image-small {
    max-width: 50%;
    width: 50%;
  }
}

/* iPhone-specific optimizations */
@media screen and (max-width: 768px) {
  /* Improve touch targets */
  .nav-link, .button, a {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Optimize text size for mobile */
  body {
    font-size: 16px; /* Prevent zoom on iOS */
    line-height: 1.6;
  }
  
  /* Improve table readability on mobile */
  table {
    font-size: 14px;
    overflow-x: auto;
    display: block;
    white-space: nowrap;
  }
  
  /* Optimize images for mobile */
  img {
    max-width: 100%;
    height: auto;
  }
  
  /* Improve form elements */
  input, textarea, select {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 12px;
    border-radius: 8px;
  }
  
  /* Optimize navigation for touch */
  .nav {
    padding: 1rem;
  }
  
  .nav-link {
    padding: 12px 16px;
    margin: 4px 0;
  }
  
  /* Improve content spacing */
  .content {
    padding: 1rem;
  }
  
  /* Optimize specs cards for mobile */
  .specs-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .spec-card {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  /* Improve heading sizes */
  h1 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    border-bottom: 2px solid #2ecc71;
    padding-bottom: 0.3rem;
  }
  
  h2 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
  }
  
  h3 {
    font-size: 1.2rem;
    margin-bottom: 0.6rem;
  }
}

/* iPhone specific optimizations */
@media screen and (max-width: 414px) {
  /* iPhone 11 Pro Max and smaller */
  .content {
    padding: 0.8rem;
  }
  
  .spec-card {
    padding: 0.8rem;
  }
  
  /* Optimize for portrait mode */
  .main {
    padding: 0.5rem;
  }
}

/* Landscape mode optimizations */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .nav {
    padding: 0.5rem;
  }
  
  .content {
    padding: 0.5rem;
  }
}

/* High DPI displays (Retina) */
@media screen and (-webkit-min-device-pixel-ratio: 2) {
  /* Optimize images for Retina displays */
  img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* Dark mode support for mobile */
@media (prefers-color-scheme: dark) {
  .spec-card {
    background: var(--dark);
    border-color: var(--bubble);
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .spec-card:hover {
    box-shadow: 0 0.5rem 2rem rgba(0,0,0,0.12);
  }
  
  /* Improve button feedback */
  .button:active, .nav-link:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
}
