/**
 * Copyright 2026 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */

/* --- THEME SETTINGS --- */
:root {
  --gold: #d4af37;
  --dark-gold: #b4941f;
  --black: #1a1a1a;
  --cream: #f9f7f2;
  --error: #c0392b;
}

/* --- General Page Styles --- */
body {
  font-family: 'Playfair Display', 'Georgia', serif;
  background-image: radial-gradient(var(--cream) 1px, var(--gold) 0);
  background-size: 40px 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  color: var(--black);
}

/* --- Form Container --- */
.booking-container {
  background-color: var(--cream);
  padding: 50px;
  border: 2px solid var(--gold);
  border-radius: 4px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  width: 100%;
  max-width: 550px;
  position: relative;
}

/* --- Decorative Inner Border --- */
.booking-container::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  border: 1px solid var(--gold);
  pointer-events: none;
}

/* --- Header --- */
.booking-container h2 {
  text-align: center;
  color: var(--black);
  font-size: 2.8em;
  margin-bottom: 5px;
  margin-top: 0;
  font-weight: 400;
  letter-spacing: 1px;
}

.subtitle {
  text-align: center;
  display: block;
  color: var(--gold);
  font-family: 'Segoe UI', sans-serif;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.8em;
  margin-bottom: 40px;
}

form {
  padding: 30px;
}

/* --- Form Elements --- */
.form-group {
  margin-bottom: 25px;
  position: relative;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--black);
  font-family: 'Segoe UI', sans-serif;
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 15px;
  background-color: transparent;
  border: none;
  border-bottom: 2px solid #ccc; /* Default grey underline */
  border-radius: 0;
  box-sizing: border-box;
  font-family: 'Playfair Display', serif;
  font-size: 1.1em;
  color: var(--black);
  transition: all 0.3s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-bottom-color: var(--gold); /* Gold underline on focus */
  background-color: rgba(212, 175, 55, 0.05); /* Very light gold tint */
}

/* Error state styling */
input.invalid,
select.invalid {
  border-bottom-color: var(--error);
  background-color: rgba(192, 57, 43, 0.05);
}

.error-msg {
  color: var(--error);
  font-size: 0.8em;
  font-family: 'Segoe UI', sans-serif;
  margin-top: 6px;
  display: none;
}

/* --- Layout --- */
.row {
  display: flex;
  gap: 25px;
}

.col {
  flex: 1;
}

/* --- Button --- */
button.submit-btn {
  width: 100%;
  padding: 18px;
  background-color: var(--black);
  color: var(--gold);
  border: 1px solid var(--gold);
  font-family: 'Segoe UI', sans-serif;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.4s;
  margin-top: 20px;
}

button.submit-btn:hover {
  background-color: var(--gold);
  color: var(--black);
  box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
}

/* --- ACTIVE STATE ANIMATIONS (Motion-Safe) --- */

@keyframes gold-light-pulse {
  0% {
    background-color: var(--gold);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
  }
  50% {
    background-color: #fdd860; /* Brighter gold (highlight) */
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.8); /* Strong outer glow */
  }
  100% {
    background-color: var(--gold);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
  }
}

/* --- ACTIVE CLASSES --- */

/* Class to apply to the .booking-container */
*:tool-form-active {
  outline: none; /* Removes default blue browser focus rings */
}

/* --- 1. The Shimmer Animation (Light reflection moving across) --- */
@keyframes gold-shimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

/* --- 2. The Floating Badge Animation (Gentle bobbing) --- */
@keyframes badge-float {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* --- THE BUTTON STYLES --- */
*:tool-submit-active {
  /* Base Button Overrides */
  color: var(--black) !important;
  font-weight: 800 !important;
  border: none !important;
  cursor: pointer;
  position: relative; /* Needed for the badge to sit correctly */

  /* The "Luxury Shimmer" Gradient */
  /* This creates a gold base with a passing white highlight */
  background: linear-gradient(110deg, #d4af37 30%, #fff8db 50%, #d4af37 70%) !important;
  background-size: 200% 100% !important;

  /* Apply the animation */
  animation: gold-shimmer 3s infinite linear;

  /* Add a "Focus" Ring to show technical necessity */
  box-shadow:
    0 0 0 4px var(--cream),
    0 0 0 6px var(--gold);
}

/* --- THE "REVIEW THIS" BADGE --- */
/* This creates a text bubble appearing above the button */
*:tool-submit-active::after {
  content: '⚠ Please Review & Confirm';

  /* Positioning */
  position: absolute;
  bottom: 125%; /* Sits above the button */
  left: 50%;

  /* Visuals */
  background-color: var(--black);
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  font-family: 'Segoe UI', sans-serif;
  font-size: 0.75em;
  font-weight: normal;
  letter-spacing: 1px;
  white-space: nowrap;
  pointer-events: none; /* Let clicks pass through if it overlaps anything */

  /* Gold accent */
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);

  /* Animation */
  animation: badge-float 2s infinite ease-in-out;
}

/* --- THE BADGE ARROW (Triangle) --- */
*:tool-submit-active::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-left: -6px; /* Half of the width to center it */

  /* Create a CSS Triangle */
  border-width: 6px;
  border-style: solid;
  border-color: var(--black) transparent transparent transparent;

  /* Sync animation with the badge */
  animation: badge-float 2s infinite ease-in-out;
}

/* --- DIALOG (MODAL) STYLES --- */
dialog {
  border: 4px double var(--gold); /* Fancy double border */
  background-color: var(--cream);
  padding: 50px;
  width: 90%;
  max-width: 450px;
  text-align: center;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);

  /* Animation */
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease,
    display 0.4s allow-discrete;
}

dialog[open] {
  opacity: 1;
  transform: translateY(0);
}

dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.2em;
  color: var(--black);
  margin-bottom: 5px;
  margin-top: 0;
}

.modal-details {
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
  padding: 20px 0;
  margin: 25px 0;
  text-align: left;
  font-family: 'Playfair Display', serif;
  font-size: 1.1em;
  line-height: 1.8;
  color: #444;
}

.modal-details strong {
  color: var(--black);
  font-weight: 700;
}

.close-modal-btn {
  background-color: transparent;
  color: var(--black);
  border: 1px solid var(--black);
  padding: 12px 35px;
  font-family: 'Segoe UI', sans-serif;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.8em;
  cursor: pointer;
  transition: 0.3s;
}

.close-modal-btn:hover {
  background-color: var(--black);
  color: var(--gold);
}
