/* LKKT Payment - Mobile-First Styles */

/* Alpine.js cloak */
[x-cloak] { display: none !important; }

/* CSS Custom Properties */
:root {
  --primary-color: #1e40af;
  --primary-hover: #1d4ed8;
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Base mobile optimizations */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

/* Touch-friendly sizing */
.touch-target {
  min-height: 44px; /* Apple HIG minimum touch target */
  min-width: 44px;
}

/* Enhanced input styling for mobile */
input[type="text"], input[type="email"], input[type="number"], select, textarea {
  font-size: 16px; /* Prevents zoom on iOS */
  border-radius: 8px;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

input[type="text"]:focus, input[type="email"]:focus, input[type="number"]:focus,
select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
  transform: translateY(-1px);
}

/* Registration input specific styling */
#registration {
  letter-spacing: 1px;
  font-weight: 500;
  text-align: center;
}

#registration::placeholder {
  color: var(--gray-400);
  letter-spacing: normal;
  text-align: center;
}

/* Button enhancements */
button {
  font-size: 16px; /* Prevents zoom on iOS */
  border-radius: 8px;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

button:active {
  transform: scale(0.98);
}

button:disabled {
  pointer-events: none;
}

/* Loading states */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Modal and overlay styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 9999;
  transition: transform 0.3s ease;
}

.modal.active {
  transform: translate(-50%, -50%) scale(1);
}

/* Toast notifications */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: white;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  min-width: 300px;
  max-width: 90vw;
  transition: transform 0.3s ease;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  background: var(--error-color);
  color: white;
}

.toast.success {
  background: var(--success-color);
  color: white;
}

.toast.warning {
  background: var(--warning-color);
  color: white;
}

/* Card hover effects */
.card-hover {
  transition: all 0.2s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Registration format indicator */
.registration-valid {
  border-color: var(--success-color) !important;
  background-color: rgba(16, 185, 129, 0.05);
}

.registration-invalid {
  border-color: var(--error-color) !important;
  background-color: rgba(239, 68, 68, 0.05);
}

/* Flight list styling */
.flight-item {
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.flight-item:hover {
  border-color: var(--primary-color);
  background-color: rgba(30, 64, 175, 0.02);
}

.flight-item.selected {
  border-color: var(--primary-color);
  background-color: rgba(30, 64, 175, 0.05);
}

/* Payment method icons */
.payment-method {
  transition: all 0.2s ease;
  cursor: pointer;
}

.payment-method:hover {
  background-color: var(--gray-50);
}

.payment-method.selected {
  background-color: rgba(30, 64, 175, 0.05);
  border-color: var(--primary-color);
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .modal {
    margin: 20px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
  }
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
  input[type="text"], input[type="email"], input[type="number"] {
    font-size: 16px;
    transform: translateZ(0);
  }

  /* Fix iOS Safari input zoom */
  input:focus {
    font-size: 16px;
  }
}

/* Android specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) and (min-resolution: .001dpcm) {
  input, select, textarea {
    font-size: 16px;
  }
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }

  body {
    background: white !important;
  }

  .bg-gradient-to-br {
    background: white !important;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus indicators */
.focus-visible:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Czech language specific styling */
.cs-currency::after {
  content: ' CZK';
  font-weight: normal;
  opacity: 0.7;
}
