/* iOS-specific styles for StayNow Web App */

/* iOS Safari optimizations */
body {
  -webkit-overflow-scrolling: touch;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

/* Remove iOS default styling */
input, textarea, button {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border-radius: 0;
}

/* iOS button styling */
button, .btn {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  cursor: pointer;
  border: none;
  outline: none;
}

/* iOS input styling */
input[type="text"], 
input[type="email"], 
input[type="password"], 
input[type="tel"], 
textarea {
  -webkit-appearance: none;
  -webkit-border-radius: 8px;
  border-radius: 8px;
  border: 1px solid #ddd;
  padding: 12px 16px;
  font-size: 16px; /* Prevents zoom on iOS */
  background-color: white;
}

input:focus, textarea:focus {
  outline: none;
  border-color: #0175C2;
  box-shadow: 0 0 0 2px rgba(1, 117, 194, 0.2);
}

/* iOS safe area support */
@supports (padding: max(0px)) {
  .safe-area-top {
    padding-top: env(safe-area-inset-top);
  }
  
  .safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom);
  }
  
  .safe-area-left {
    padding-left: env(safe-area-inset-left);
  }
  
  .safe-area-right {
    padding-right: env(safe-area-inset-right);
  }
  
  .safe-area-all {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* iOS viewport height fix */
.full-height {
  height: 100vh;
  height: -webkit-fill-available;
}

/* iOS scroll behavior */
.scroll-container {
  -webkit-overflow-scrolling: touch;
  overflow-y: auto;
}

/* iOS touch feedback */
.touchable {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* iOS card styling */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin: 8px;
  overflow: hidden;
}

/* iOS navigation bar */
.nav-bar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* iOS bottom navigation */
.bottom-nav {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

/* iOS modal styling */
.modal {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-content {
  background: white;
  border-radius: 16px 16px 0 0;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* iOS loading spinner */
.ios-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #0175C2;
  border-radius: 50%;
  animation: ios-spin 1s linear infinite;
}

@keyframes ios-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* iOS typography */
.ios-title {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  font-size: 20px;
  line-height: 1.2;
}

.ios-body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.4;
}

.ios-caption {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.3;
  color: #666;
}

/* iOS button variants */
.ios-button-primary {
  background: #0175C2;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.ios-button-primary:hover {
  background: #0056b3;
}

.ios-button-secondary {
  background: transparent;
  color: #0175C2;
  border: 1px solid #0175C2;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ios-button-secondary:hover {
  background: #0175C2;
  color: white;
}

/* iOS list styling */
.ios-list {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  margin: 16px;
}

.ios-list-item {
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  min-height: 44px; /* iOS minimum touch target */
}

.ios-list-item:last-child {
  border-bottom: none;
}

.ios-list-item:active {
  background: #f0f0f0;
}

/* iOS form styling */
.ios-form-group {
  margin-bottom: 16px;
}

.ios-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
}

.ios-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  background: white;
  box-sizing: border-box;
}

/* iOS responsive breakpoints */
@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
  
  .card {
    margin: 8px 0;
    border-radius: 0;
  }
  
  .modal-content {
    border-radius: 16px 16px 0 0;
    margin: 0;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .container {
    padding: 0 24px;
  }
}

@media (min-width: 769px) {
  .container {
    max-width: 768px;
    margin: 0 auto;
    padding: 0 32px;
  }
}

/* iOS dark mode support */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #000;
    color: #fff;
  }
  
  .card {
    background: #1c1c1e;
    border: 1px solid #38383a;
  }
  
  .nav-bar, .bottom-nav {
    background: rgba(28, 28, 30, 0.95);
    border-color: rgba(84, 84, 88, 0.6);
  }
  
  .ios-input {
    background: #1c1c1e;
    border-color: #38383a;
    color: #fff;
  }
  
  .ios-list {
    background: #1c1c1e;
  }
  
  .ios-list-item {
    border-color: #38383a;
  }
  
  .ios-list-item:active {
    background: #2c2c2e;
  }
}
