/* Enhanced Responsive Styles for Mobile Devices */

/* Mobile-first approach */
@media (max-width: 1024px) {
  /* Tablet landscape adjustments */
  .modal-content {
    max-width: 80vw;
    width: 80vw;
  }
  
  .btn-google,
  .btn-facebook {
    padding: 14px 16px;
    font-size: 15px;
  }
}

@media (max-width: 768px) {
  /* Tablet portrait and mobile landscape */
  .modal-content {
    max-width: 90vw;
    width: 90vw;
    max-height: 95vh;
  }
  
  .modal-header h2 {
    font-size: 20px;
  }
  
  .input-group {
    margin-bottom: 14px;
  }
  
  .btn-google,
  .btn-facebook {
    padding: 14px 16px;
    font-size: 14px;
    min-height: 50px;
  }
  
  .social-login {
    gap: 10px;
  }
  
  /* Reduce spacing for smaller screens */
  .pricing h3 {
    font-size: 17px;
    margin-bottom: 12px;
  }
  
  .subscription-options label {
    padding: 10px 12px;
    font-size: 14px;
  }
}

@media (max-width: 640px) {
  /* Large mobile devices */
  .modal-content {
    max-width: 95vw;
    width: 95vw;
    margin: 0;
    border-radius: 15px;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 18px;
    padding-right: 18px;
  }
  
  .modal-header {
    padding-top: 18px;
    padding-bottom: 12px;
  }
  
  .modal-body {
    padding-top: 12px;
    padding-bottom: 12px;
  }
  
  .modal-footer {
    padding-top: 12px;
    padding-bottom: 18px;
  }
}

@media (max-width: 480px) {
  /* Small mobile devices */
  .modal-content {
    max-width: 98vw;
    width: 98vw;
    max-height: 98vh;
    border-radius: 12px;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  
  .modal-header {
    padding-top: 16px;
    padding-bottom: 10px;
  }
  
  .modal-body {
    padding-top: 10px;
    padding-bottom: 10px;
  }
  
  .modal-footer {
    padding-top: 10px;
    padding-bottom: 16px;
  }
  
  .modal-header h2 {
    font-size: 18px;
  }
  
  .input-group {
    margin-bottom: 12px;
  }
  
  .input-group label {
    font-size: 13px;
    margin-bottom: 5px;
  }
  
  .input-group input {
    padding: 11px 14px;
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  .btn-primary {
    padding: 12px 18px;
    font-size: 15px;
    margin: 12px 0;
  }
  
  .btn-google,
  .btn-facebook {
    padding: 12px 14px;
    font-size: 14px;
    min-height: 48px;
    gap: 8px;
  }
  
  .btn-google svg,
  .btn-facebook svg {
    width: 20px;
    height: 20px;
  }
  
  .pricing h3 {
    font-size: 16px;
    margin-bottom: 10px;
  }
  
  .subscription-options {
    margin-bottom: 15px;
  }
  
  .subscription-options label {
    padding: 8px 10px;
    font-size: 13px;
    margin-bottom: 8px;
  }
  
  .close-modal {
    width: 30px;
    height: 30px;
    font-size: 24px;
    top: 12px;
    left: 12px;
  }
  
  .divider {
    margin: 15px 0 12px 0;
    font-size: 13px;
  }
  
  .modal-footer p {
    font-size: 13px;
  }
}

@media (max-width: 360px) {
  /* Very small mobile devices */
  .modal-content {
    border-radius: 10px;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 14px;
    padding-right: 14px;
  }
  
  .modal-header h2 {
    font-size: 17px;
  }
  
  .input-group input {
    padding: 10px 12px;
    font-size: 16px;
  }
  
  .btn-primary {
    padding: 11px 16px;
    font-size: 14px;
  }
  
  .btn-google,
  .btn-facebook {
    padding: 10px 12px;
    font-size: 13px;
    min-height: 44px;
    gap: 6px;
  }
  
  .btn-google svg,
  .btn-facebook svg {
    width: 18px;
    height: 18px;
  }
  
  .pricing h3 {
    font-size: 15px;
  }
  
  .subscription-options label {
    padding: 7px 8px;
    font-size: 12px;
  }
  
  .close-modal {
    width: 28px;
    height: 28px;
    font-size: 22px;
    top: 10px;
    left: 10px;
  }
  
  .input-group {
    margin-bottom: 10px;
  }
  
  .input-group label {
    font-size: 12px;
  }
}

/* Landscape orientation adjustments for mobile */
@media (max-height: 600px) and (orientation: landscape) {
  .modal-content {
    max-height: 95vh;
    width: min(90vw, 600px);
  }
  
  .modal-header {
    padding-top: 12px;
    padding-bottom: 8px;
  }
  
  .modal-body {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  
  .modal-footer {
    padding-top: 8px;
    padding-bottom: 12px;
  }
  
  .modal-header h2 {
    font-size: 17px;
  }
  
  .input-group {
    margin-bottom: 8px;
  }
  
  .input-group input {
    padding: 8px 12px;
  }
  
  .btn-primary {
    padding: 10px 16px;
    margin: 8px 0;
  }
  
  .btn-google,
  .btn-facebook {
    padding: 8px 12px;
    min-height: 40px;
  }
  
  .pricing h3 {
    font-size: 15px;
    margin-bottom: 8px;
  }
  
  .subscription-options {
    margin-bottom: 10px;
  }
  
  .subscription-options label {
    padding: 6px 8px;
    margin-bottom: 6px;
  }
  
  .divider {
    margin: 10px 0 8px 0;
  }
}

/* High DPI display adjustments */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .btn-google svg,
  .btn-facebook svg {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .btn-google,
  .btn-facebook,
  .btn-primary {
    min-height: 44px; /* iOS accessibility guidelines */
  }
  
  .close-modal {
    min-width: 44px;
    min-height: 44px;
  }
  
  .input-group input {
    min-height: 44px;
    font-size: 16px; /* Prevent zoom on iOS */
  }
}

/* Accessibility improvements for small screens */
@media (max-width: 480px) {
  /* Ensure all interactive elements meet minimum touch target size */
  .btn-google,
  .btn-facebook,
  .btn-primary,
  .close-modal,
  .subscription-options label {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Improve readability */
  .input-group label,
  .pricing h3,
  .modal-footer p {
    line-height: 1.4;
  }
  
  /* Better focus indicators for keyboard navigation */
  .btn-google:focus,
  .btn-facebook:focus,
  .btn-primary:focus,
  .input-group input:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
  }
}

/* iPhone X and newer safe area adjustments */
@supports (padding: max(0px)) {
  @media (max-width: 480px) {
    .modal-content {
      padding-left: max(10px, env(safe-area-inset-left));
      padding-right: max(10px, env(safe-area-inset-right));
    }
  }
}

/* Dark mode preference support */
@media (prefers-color-scheme: dark) {
  .modal-content {
    border-color: #d3a77b;
  }
  
  .btn-google,
  .btn-facebook {
    border-width: 2px;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .modal,
  .modal-content,
  .btn-google,
  .btn-facebook,
  .btn-primary {
    animation: none;
    transition: none;
  }
  
  .btn-google:hover,
  .btn-facebook:hover,
  .btn-primary:hover {
    transform: none;
  }
}
