/* ============================================
   Modern Reserve Modal Design
   Clean, professional booking form
   ============================================ */

/* Modal Backdrop */
#reserve {
  border: none;
  border-radius: var(--radius-2xl);
  padding: 0;
  max-width: 900px;
  width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  margin: auto;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -30%);
}

#reserve::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

#reserve[open] {
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 20px)) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Modal Container */
#reserve article {
  margin: 0;
  padding: 0;
  background: var(--white);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

/* Header */
#reserve header {
  background: linear-gradient(135deg, var(--brand-primary), var(--accent));
  color: var(--white);
  padding: var(--space-xl) var(--space-2xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: none;
  flex-shrink: 0;
}

#reserve header h3 {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--white);
}

#reserve header button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: var(--white);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: var(--text-xl);
  padding: 0;
}

#reserve header button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* Form Container */
#reserve form {
  padding: var(--space-2xl);
  overflow-y: auto;
  flex: 1;
}

/* Tour Info Banner */
.reserve-tour-info {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border-left: 4px solid var(--brand-primary);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.reserve-tour-icon {
  width: 48px;
  height: 48px;
  background: var(--brand-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: var(--text-xl);
  flex-shrink: 0;
}

.reserve-tour-details h4 {
  margin: 0 0 var(--space-xs) 0;
  color: var(--text-secondary);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
}

.reserve-tour-details p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

/* Form Sections */
.form-section {
  margin-bottom: var(--space-xl);
}

.form-section-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.form-section-title svg {
  color: var(--brand-primary);
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.form-grid.full {
  grid-template-columns: 1fr;
}

/* Form Fields */
.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-field label {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.form-field label .required {
  color: #ef4444;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: var(--space-md);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  font-family: inherit;
  transition: all var(--transition-fast);
  background: var(--white);
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(69, 194, 212, 0.1);
}

.form-field input[readonly] {
  background: var(--gray-50);
  color: var(--text-secondary);
  cursor: not-allowed;
}

.form-field textarea {
  min-height: 100px;
  resize: vertical;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--text-tertiary);
}

/* Input Icons */
.input-with-icon {
  position: relative;
}

.input-with-icon svg {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.input-with-icon input {
  padding-left: calc(var(--space-md) * 2 + 20px);
}

/* Helper Text */
.form-helper {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: var(--space-xs);
}

/* Footer */
#reserve footer {
  background: var(--gray-50);
  padding: var(--space-xl) var(--space-2xl);
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.footer-note {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.footer-note svg {
  color: var(--brand-primary);
  flex-shrink: 0;
}

.footer-actions {
  display: flex;
  gap: var(--space-sm);
}

/* Buttons */
.btn-reserve-submit,
.btn-reserve-whatsapp {
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  cursor: pointer;
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  border: none;
  font-family: inherit;
}

.btn-reserve-submit {
  background: var(--brand-primary);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(69, 194, 212, 0.3);
}

.btn-reserve-submit:hover {
  background: var(--brand-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(69, 194, 212, 0.4);
}

.btn-reserve-whatsapp {
  background: #25D366;
  color: var(--white);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-reserve-whatsapp:hover {
  background: #20BA5A;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
  color: var(--white);
}

/* Loading State */
.btn-reserve-submit:disabled,
.btn-reserve-whatsapp:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Responsive */
@media (max-width: 640px) {
  #reserve {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  
  #reserve article {
    border-radius: 0;
    max-height: 100vh;
  }
  
  #reserve header {
    padding: var(--space-lg) var(--space-xl);
  }
  
  #reserve form {
    padding: var(--space-xl);
  }
  
  #reserve footer {
    padding: var(--space-lg) var(--space-xl);
    flex-direction: column;
    align-items: stretch;
  }
  
  .footer-actions {
    flex-direction: column;
  }
  
  .btn-reserve-submit,
  .btn-reserve-whatsapp {
    width: 100%;
    justify-content: center;
  }
}

/* Success/Error Messages */
.form-message {
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.form-message.success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.form-message.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  #reserve[open] {
    animation: none;
  }
  
  #reserve header button:hover {
    transform: none;
  }
  
  .btn-reserve-submit:hover,
  .btn-reserve-whatsapp:hover {
    transform: none;
  }
}

/* Dark Mode Support */
[data-theme="dark"] #reserve article {
  background: var(--gray-900);
}

[data-theme="dark"] #reserve form {
  background: var(--gray-900);
}

[data-theme="dark"] .form-field input,
[data-theme="dark"] .form-field textarea,
[data-theme="dark"] .form-field select {
  background: var(--gray-800);
  border-color: var(--gray-700);
  color: var(--gray-100);
}

[data-theme="dark"] #reserve footer {
  background: var(--gray-800);
  border-color: var(--gray-700);
}
