/* Mobile-specific styles - Old mobile menu styles removed */
.touch-device .card,
.touch-device .btn {
  -webkit-tap-highlight-color: rgba(59, 130, 246, 0.2);
  tap-highlight-color: rgba(59, 130, 246, 0.2);
}

.touch-device .card.touch-active,
.touch-device .btn.touch-active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

/* Focused form elements */
.field.focused input,
.field.focused textarea,
.field.focused select {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Scrolled header */
.header.scrolled {
  background: rgba(11, 14, 20, 0.95);
  backdrop-filter: blur(15px);
}

/* Lazy loading images */
img.lazy {
  opacity: 0;
  transition: opacity 0.3s ease;
}

img.lazy.loaded {
  opacity: 1;
}

/* Mobile device classes */
.mobile-device .container {
  padding: 0 16px;
}

.small-mobile .container {
  padding: 0 12px;
}

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

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

/* Improved mobile navigation */
.mobile-device .nav a {
  -webkit-tap-highlight-color: rgba(59, 130, 246, 0.3);
  tap-highlight-color: rgba(59, 130, 246, 0.3);
}

.mobile-device .mobile-menu-btn {
  -webkit-tap-highlight-color: rgba(59, 130, 246, 0.3);
  tap-highlight-color: rgba(59, 130, 246, 0.3);
}

/* Better mobile forms */
.mobile-device input,
.mobile-device textarea,
.mobile-device select {
  -webkit-appearance: none;
  appearance: none;
  border-radius: 12px;
}

.mobile-device input:focus,
.mobile-device textarea:focus,
.mobile-device select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Mobile-specific button improvements */
.mobile-device .btn {
  -webkit-tap-highlight-color: rgba(59, 130, 246, 0.3);
  tap-highlight-color: rgba(59, 130, 246, 0.3);
  user-select: none;
  -webkit-user-select: none;
}

.mobile-device .btn:active {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

/* Improved mobile cards */
.mobile-device .card {
  -webkit-tap-highlight-color: rgba(59, 130, 246, 0.1);
  tap-highlight-color: rgba(59, 130, 246, 0.1);
}

.mobile-device .card:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

/* Better mobile scrolling */
.mobile-device {
  -webkit-overflow-scrolling: touch;
  overflow-scrolling: touch;
}

.mobile-device .nav {
  -webkit-overflow-scrolling: touch;
  overflow-scrolling: touch;
}

/* Mobile-specific animations */
@media (prefers-reduced-motion: no-preference) {
  .mobile-device .card,
  .mobile-device .btn {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
  .mobile-device input,
  .mobile-device textarea {
    font-size: 16px; /* Prevent zoom */
  }
  
  .mobile-device .btn {
    -webkit-touch-callout: none;
  }
}

/* Mobile-First Enhancements for Sharif Education Site */

/* Touch-friendly improvements */
@media (max-width: 960px) {
  /* Ensure all interactive elements are touch-friendly */
  .btn,
  .nav a,
  .nav__drop-trigger,
  .mobile-menu-btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Improve touch targets */
  .card {
    cursor: pointer;
    transition: transform 0.2s ease;
  }
  
  .card:active {
    transform: scale(0.98);
  }
  
  /* Better spacing for mobile */
  .section {
    padding: 40px 0;
  }
  
  .container {
    padding: 0 16px;
  }
  
  /* Improve form elements */
  input,
  textarea,
  select {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 12px 14px;
    min-height: 44px;
  }
  
  /* Better button spacing */
  .btn {
    margin: 4px 0;
  }
  
  /* Improve sticky button */
  .sticky {
    padding: 0 16px;
  }
  
  .sticky .btn {
    width: 100%;
    max-width: 300px;
    padding: 14px 20px;
    font-size: 1rem;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }
  
  .section {
    padding: 32px 0;
  }
  
  .hero {
    padding: 24px 0 16px;
  }
  
  /* Single column layouts */
  .grid--4,
  .grid--3,
  .grid--2 {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  /* Better typography for small screens */
  h1 {
    font-size: 1.8rem;
    line-height: 1.2;
  }
  
  h2 {
    font-size: 1.5rem;
    line-height: 1.3;
  }
  
  h3 {
    font-size: 1.2rem;
    line-height: 1.4;
  }
  
  p {
    font-size: 0.9rem;
    line-height: 1.5;
  }
  
  /* Improve card layouts */
  .card {
    padding: 16px;
    margin-bottom: 16px;
  }
  
  /* Better button layouts */
  .action-buttons {
    flex-direction: column;
    gap: 12px;
  }
  
  .action-buttons .btn {
    width: 100%;
    padding: 14px 18px;
  }
  
  /* Improve form layouts */
  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .form-group {
    margin-bottom: 16px;
  }
  
  /* Better file upload area */
  .file-upload {
    padding: 20px 16px;
    text-align: center;
  }
  
  .file-upload-icon {
    font-size: 2rem;
    margin-bottom: 12px;
  }
  
  /* Improve contact form */
  .contact__form {
    gap: 16px;
  }
  
  .contact__form input,
  .contact__form textarea {
    padding: 14px 16px;
    font-size: 16px;
  }
  
  /* Better footer */
  .footer__content {
    text-align: center;
    gap: 24px;
  }
  
  .footer__content > div {
    margin-bottom: 20px;
  }
}

/* Landscape mobile orientation */
@media (max-width: 960px) and (orientation: landscape) {
  .hero {
    padding: 20px 0;
  }
  
  .section {
    padding: 24px 0;
  }
  
  .hero__content {
    gap: 16px;
  }
  
  .hero__text h1 {
    font-size: 1.6rem;
  }
  
  .hero__text p {
    font-size: 0.9rem;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .brand__logo,
  .logo img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Dark mode improvements for mobile */
@media (prefers-color-scheme: dark) {
  .mobile-overlay {
    background: rgba(0, 0, 0, 0.7);
  }
  
  .nav {
    background: rgba(11, 18, 32, 0.98);
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .btn:hover,
  .card:hover {
    transform: none;
  }
}

/* Additional mobile improvements */
@media (max-width: 960px) {
  .header {
    padding: 12px 16px;
  }
  
  .header__brand h1 {
    font-size: 1.2rem;
  }
  
  .header__brand p {
    font-size: 0.8rem;
  }
  
  .nav {
    position: fixed;
    top: 64px;
    right: -100%;
    width: 280px;
    height: calc(100vh - 64px);
    background: var(--card);
    flex-direction: column;
    padding: 20px;
    transition: right 0.3s ease;
    z-index: 999;
    border-left: 1px solid var(--border);
    box-shadow: -5px 0 15px rgba(0,0,0,0.3);
  }
  
  .nav.open {
    right: 0;
  }
  
  .nav a {
    padding: 12px 16px;
    margin: 4px 0;
    border-radius: 8px;
    transition: all 0.3s ease;
  }
  
  .nav a:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--brand);
  }
}

/* Print styles */
@media print {
  .mobile-menu-btn,
  .nav,
  .sticky,
  .mobile-overlay {
    display: none !important;
  }
  
  .container {
    max-width: none;
    padding: 0;
  }
  
  .section {
    padding: 20px 0;
    page-break-inside: avoid;
  }
  
  .card {
    border: 1px solid #ccc;
    box-shadow: none;
    page-break-inside: avoid;
  }
}
