/* Responsive Design - M3 Touch-friendly Optimizations
 * Based on M3 guidelines for mobile and touch devices
 */

/* Mobile Touch Targets - M3 recommends min 48x48dp */
@media (max-width: 640px) {
  .btn {
    min-height: 48px;
    padding: 12px 24px;
  }
  
  .form-input {
    min-height: 48px;
    font-size: 16px; /* Prevents zoom on iOS Safari */
  }
}

/* Landscape Orientation on Mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .timer-time {
    font-size: 48px;
  }
  
  .timer-controls {
    flex-direction: row;
    gap: 12px;
  }
}

/* High DPI / Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* Print Styles */
@media print {
  .app-header,
  .timer-controls,
  .btn {
    display: none !important;
  }
  
  .timer-display {
    margin: 0;
  }
  
  .timer-time {
    font-size: 48px;
    color: #000 !important;
  }
  
  .card {
    box-shadow: none !important;
  }
}

/* Safe Area Insets for Notched Devices */
@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
  
  .app-header {
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
    padding-top: max(16px, env(safe-area-inset-top));
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .btn:hover {
    box-shadow: var(--md-sys-elevation-1);
    transform: none;
  }
  
  .card:hover {
    box-shadow: var(--md-sys-elevation-1);
    transform: none;
  }
  
  .workout-btn:hover {
    transform: none;
  }
  
  /* Better touch feedback */
  .btn:active {
    transform: scale(0.95);
    transition: transform 0.1s;
  }
  
  .workout-btn:active {
    transform: scale(0.97);
  }
  
  /* Minimum tap targets for accessibility */
  .btn {
    min-height: 48px;
    padding: 12px 20px;
  }
  
  .workout-btn {
    min-height: 48px;
  }
  
  /* Prevent text selection on buttons */
  .btn,
  .workout-btn,
  .intervals-list-title {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
}
