/**
 * FridgeDoor Booking App Styles
 * Mobile-first responsive design
 */

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

[x-cloak] {
  display: none !important;
}

/* Description Section */
.description-section {
  text-align: start;
  padding: 20px;
  background-color: #fff;
  margin-bottom: 15px;
}

.description-title {
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin-bottom: 10px;
}

.description-datetime {
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  color: #666;
  margin-bottom: 10px;
}

.description-short {
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  color: #555;
  font-style: italic;
  display: block;
  margin-bottom: 10px;
}

.description-long {
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  color: #333;
  line-height: 1.6;
  margin-top: 10px;
  white-space: pre-line;
}

.description-long br {
  display: block;
  content: "";
  margin-bottom: 1em;
}

.description-long p {
  margin-bottom: 1em;
}

.description-long p:last-child {
  margin-bottom: 0;
}

/* Loading State */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  color: #666;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #d63c3c;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Error State */
.error-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 40px 20px;
  background-color: #f5f5f5;
}

.error-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 500px;
  padding: 40px 20px;
}

.error-emoji {
  font-size: 80px;
  margin-bottom: 20px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.error-container h2 {
  color: #333;
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 15px;
}

.error-container p {
  color: #666;
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 15px;
}

.error-hint {
  font-size: 14px !important;
  color: #999 !important;
  font-style: italic;
}

/* Header */
.header {
  background-color: #d63c3c;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: white;
  padding: 40px 20px 30px;
  text-align: center;
  position: relative;
}

.logo-container {
  margin-bottom: 20px;
}

.logo {
  max-width: 200px;
  max-height: 150px;
  width: auto;
  height: auto;
  background: white;
  padding: 20px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.merchant-name {
  font-size: 32px;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Content Section */
.content {
  max-width: 600px;
  margin: 0 auto;
  background-color: white;
}

/* Content Message */
.content-message {
  padding: 30px 20px;
  border-bottom: 1px solid #eee;
}

.content-message p {
  font-size: 16px;
  line-height: 1.6;
  color: #333;
}

/* Appointment Card */
.appointment-card {
  margin: 30px 20px;
  padding: 30px;
  background-color: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.appointment-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 15px;
  text-align: center;
  color: #333;
}

.appointment-details {
  font-size: 16px;
  line-height: 1.8;
  color: #555;
  text-align: center;
}

.appointment-details span {
  font-weight: 600;
  color: #333;
}

/* Booking Message */
.booking-message {
  padding: 20px;
  margin: 20px;
  background-color: #f9f9f9;
  border-radius: 6px;
}

.booking-message p {
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Booking Form */
.booking-form {
  padding: 30px 20px;
}

.booking-form h2 {
  font-size: 22px;
  margin-bottom: 25px;
  color: #333;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #555;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background-color: white;
  transition: border-color 0.3s;
  font-family: inherit;
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--theme-color, #d63c3c);
}

.form-group select:disabled {
  background-color: #f5f5f5;
  cursor: not-allowed;
}

/* Buttons */
.btn {
  padding: 14px 30px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background-color: #d63c3c;
  color: white;
  width: 100%;
  padding: 16px;
  font-size: 18px;
  margin-top: 10px;
}

.btn-action {
  background-color: #d63c3c;
  color: white;
  flex: 1;
  min-width: 0;
  padding: 16px 24px;
}

.btn-icon {
  width: 20px;
  height: 20px;
}

/* Action Buttons Container */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  padding: 30px 20px;
  justify-content: center;
}

.btn-call-me {
  flex: 1 1 100%;
}

/* Map Section */
.map-section {
  margin: 30px 20px;
}

.map-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s;
}

.map-link:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.map-wrapper {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
}

.static-map {
  width: 100%;
  height: 200px;
  display: block;
  object-fit: cover;
  cursor: pointer;
}

.map-address-banner {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.23);
  backdrop-filter: blur(8px);
  color: white;
  padding: 12px 15px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  pointer-events: none;
  z-index: 1000;
}

.map-address-banner span {
  display: block;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Footer */
.footer {
  text-align: center;
  padding: 40px 20px;
  background-color: transparent;
  border-top: 1px solid #eee;
}

.footer-logo {
  margin-bottom: 15px;
}

.footer-logo a {
  display: inline-block;
  transition: opacity 0.3s;
}

.footer-logo a:hover {
  opacity: 0.8;
}

.fridgedoor-logo {
  width: auto;
  height: 100px;
  margin: 0 auto;
  display: block;
}

.footer-text {
  font-size: 14px;
  color: #666;
}

.footer-link {
  color: #d63c3c;
  text-decoration: none;
  font-weight: 500;
}

.footer-link:hover {
  text-decoration: underline;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 0; /* No padding on mobile for full-screen */
}

/* Modal Content */
.modal-content {
  background: white;
  border-radius: 0; /* No border radius on mobile for full-screen */
  max-width: 100%;
  width: 100%;
  height: 100vh; /* Full screen height on mobile */
  max-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: none; /* No shadow on mobile */
  animation: modalSlideIn 0.3s ease-out;
}

/* Desktop: Centered modal with padding */
@media (min-width: 641px) {
  .modal-overlay {
    padding: 20px;
  }

  .modal-content {
    border-radius: 12px;
    max-width: 500px;
    height: auto;
    max-height: 90vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  }
}

/* Message Modal - Compact centered dialog */
.modal-content-compact {
  height: auto !important;
  max-height: 80vh !important;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
}

.modal-content-compact .modal-body {
  flex: 0 1 auto;
  overflow-y: auto;
  min-height: auto;
}

.modal-content-compact textarea {
  min-height: 120px;
  font-size: 16px;
  resize: vertical;
}

/* Desktop: Message modal */
@media (min-width: 641px) {
  .modal-content-compact {
    width: 500px;
  }

  .modal-content-compact textarea {
    min-height: 150px;
  }
}

/* Message modal error text */
.error-text {
  color: #d63c3c;
  font-size: 14px;
  margin-top: 5px;
}

/* Custom Alert Modal - Compact centered dialog */
.alert-modal {
  height: auto !important;
  max-height: none !important;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
  overflow: visible;
}

.alert-modal-body {
  flex: 0 1 auto;
  padding: 30px 25px;
  text-align: center;
  min-height: auto;
  overflow-y: visible;
}

.alert-modal-body p {
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  margin: 0;
}

.alert-modal-footer {
  justify-content: center;
  padding: 15px 25px 25px;
  border-top: none;
}

.alert-modal-btn {
  min-width: 120px;
  flex: 0 0 auto !important;
}

/* Desktop: Alert modal */
@media (min-width: 641px) {
  .alert-modal {
    width: 400px;
  }

  .alert-modal-body {
    padding: 35px 30px;
  }

  .alert-modal-body p {
    font-size: 17px;
  }

  .alert-modal-footer {
    padding: 15px 30px 30px;
  }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Callback Modal - Smaller and centered */
.callback-modal {
  max-width: 400px !important;
  height: auto !important;
}

.callback-modal .modal-body {
  min-height: auto;
}

/* Modal Header */
.modal-header {
  background-color: #d63c3c;
  color: white;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.modal-close {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.modal-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.modal-close-icon {
  width: 24px;
  height: 24px;
}

/* Modal Body */
.modal-body {
  padding: 25px 20px;
  overflow-y: auto;
  flex: 1;
}

/* Modal Footer */
.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.modal-footer .btn {
  flex: 1;
  padding: 12px 20px !important;
  font-size: 14px !important;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  width: auto !important;
  margin-top: 0 !important;
}

@media (min-width: 641px) {
  .modal-footer .btn {
    padding: 14px 24px !important;
    font-size: 16px !important;
  }
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #5a6268;
}

.modal-footer .btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Flatpickr Customization */
.flatpickr-calendar {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1001 !important;
}

.flatpickr-day.selected {
  background: #d63c3c !important;
  border-color: #d63c3c !important;
}

.flatpickr-day.selected:hover {
  background: #c02a2a !important;
  border-color: #c02a2a !important;
}

/* Responsive Design */
@media (max-width: 640px) {
  .merchant-name {
    font-size: 24px;
  }

  .logo {
    max-width: 160px;
    padding: 15px;
  }

  .appointment-card {
    margin: 20px 15px;
    padding: 20px;
  }

  .appointment-title {
    font-size: 20px;
  }

  .appointment-details {
    font-size: 15px;
  }

  .action-buttons {
    flex-direction: column;
    gap: 12px;
  }

  .booking-form {
    padding: 20px 15px;
  }
}

/* Print Styles */
@media print {
  .action-buttons,
  .booking-form {
    display: none;
  }

  .header {
    background-color: #d63c3c !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
