/* --- PAGE SPECIFIC OVERRIDES --- */

/* Ensure buttons and wrappers use flex to align icon and text nicely */
.modal-btn,
.google-btn,
.plus-btn,
.countdown-wrapper a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Apply Montserrat to button titles and section headers */
.section-title,
.section-title-small,
.site-subtitle,
.btn-title {
  font-family: Montserrat, sans-serif;
}

/* Prevent button text from wrapping to the next line */
.btn-title {
  white-space: nowrap;
}

/* Align widths of auth inputs and button groups for all devices */
.auth-combined-form,
.auth-input,
.auth-btn-group,
.google-btn,
.w-80 {
  width: 95% !important;
  max-width: 400px !important;
  box-sizing: border-box !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.auth-input {
  display: block;
}

/* Uniform size for My Account dropdown buttons */
#logged-in-ui .modal-btn {
  width: 95% !important;
  max-width: 400px !important;
  box-sizing: border-box !important;
  margin: 0 auto 10px !important;
  min-height: 60px !important;
}

/* Reduce extra whitespace around the OR divider */
.auth-divider {
  margin: 10px 0 !important;
  padding: 0 !important;
}

.google-btn {
  margin-top: 5px !important;
}

/* Upgrade to Plus Button Styling */
.plus-btn {
  background-color: #e1a63c !important;
  border-color: #e1a63c !important;
}

.plus-btn .btn-title,
.plus-btn .btn-desc {
  color: #1b2032 !important;
}

/* Countdown timer rendering fixes */
.timer-display {
  display: flex;
  gap: 5px;
  width: 100%;
  margin-top: 15px;
  justify-content: center;
}

.timer-display div {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 2px;
  background: #e1a63c;
  color: #1b2032;
  border-radius: 6px;
  flex: 1;
  min-width: 0;
  font-weight: bold;
}

.timer-header {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  margin-bottom: 10px;
}

.timer-controls {
  display: flex;
  gap: 8px;
  position: absolute;
  right: 0;
}

/* Deal Finder Dialog Styling */
.config-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  width: 95%;
  margin: 0 auto;
  text-align: left;
}

.grid-full {
  grid-column: span 2;
}

.config-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.config-group label {
  font-family: Montserrat, sans-serif;
  font-weight: 600;
  font-size: 0.9em;
  color: #1b2032;
  margin-left: 2px;
}

.config-group input,
.config-group select {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-family: Montserrat, sans-serif;
  background-color: #fff;
  width: 100%;
  box-sizing: border-box;
}

.checkbox-list-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: #fefefe;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #ddd;
  max-height: 300px;
  overflow-y: auto;
}

/* Grid flow to keep toggle in bottom right */
#df-hotel-list {
  grid-template-rows: repeat(6, auto);
  grid-auto-flow: column;
}

#df-day-list {
  grid-template-rows: repeat(4, auto);
  grid-auto-flow: column;
}

.checkbox-item,
.checkbox-toggle-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85em;
  font-family: Montserrat, sans-serif;
  color: #444;
  min-height: 24px;
}

.checkbox-item input[type="checkbox"] {
  width: 20px !important;
  height: 20px !important;
  cursor: pointer;
  margin: 0;
}

.checkbox-item label {
  cursor: pointer;
  display: flex;
  align-items: center;
}

.checkbox-toggle-item {
  justify-content: flex-end;
  padding-right: 5px;
  font-weight: 600;
  color: #e1a63c;
  font-size: 0.75em;
}

.toggle-link {
  cursor: pointer;
}

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

/* Deal Finder Results Table and Scrolling */
.df-results-scroll-container {
  max-height: 400px;
  overflow-y: auto;
  width: 100%;
  border-radius: 0 0 10px 10px;
  border: 1px solid #eee;
}

.df-table {
  width: 100%;
  border-collapse: collapse;
  font-family: Montserrat, sans-serif;
  font-size: 0.85em;
}

.df-table thead th {
  background-color: #f8f8f8;
  color: #1b2032;
  font-weight: 600;
  text-align: left;
  padding: 12px 10px;
  border-bottom: 2px solid #e1a63c;
  cursor: pointer;
  user-select: none;
  position: sticky;
  top: 0;
  z-index: 10;
}

.df-table th:hover {
  background-color: #f0f0f0;
}

.df-table td {
  padding: 10px;
  border-bottom: 1px solid #eee;
  color: #444;
  text-align: left;
}

.df-results-loading {
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

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

  100% {
    transform: rotate(360deg);
  }
}

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

/* Rethemed Toast Notifications Overrides */
.toast {
  white-space: normal !important;
  overflow-wrap: break-word !important;
  height: auto !important;
  line-height: 1.4;
  text-align: left;
}

/* Remove dotted border from plus locked buttons */
.plus-overlay {
  border: none !important;
}

/* Plus badge tweaks for text color and new icon */
.plus-badge {
  color: #e1a63c !important;
}

.plus-badge img {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Dark Mode overrides for index.html specifics */
body.dark-mode .config-group input,
body.dark-mode .config-group select,
body.dark-mode .checkbox-list-container {
  background-color: var(--deep-midnight);
  color: var(--bright-sky);
  border: 1px solid var(--golden-hour);
}

body.dark-mode .config-group label,
body.dark-mode .checkbox-item,
body.dark-mode .df-table td {
  color: var(--bright-sky);
}

body.dark-mode .df-table thead th {
  background-color: var(--deep-midnight);
  color: var(--bright-sky);
  border-bottom: 2px solid var(--golden-hour);
}

body.dark-mode .df-table th:hover {
  background-color: #2a314d;
}

body.dark-mode .df-results-scroll-container {
  border: 1px solid var(--golden-hour);
}

body.dark-mode .auth-combined-form {
  background-color: var(--deep-midnight);
}

body.dark-mode .auth-input-combined {
  color: var(--bright-sky);
}

@media (width <= 600px) {
  .config-form-grid {
    grid-template-columns: 1fr;
  }

  .grid-full {
    grid-column: span 1;
  }

  .checkbox-list-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =========================================
   EXTRACTED INLINE STYLES
   ========================================= */

/* Extracted from <header> */
.header-relative {
  position: relative;
}

/* Extracted from #plus-status-indicator */
#plus-status-indicator {
  color: #6a1b82;
  font-weight: bold;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 15px;
}

#plus-status-indicator img {
  width: 20px;
  height: 20px;
}

/* Extracted from #custom-date */
#custom-date {
  background-color: white;
}

/* Extracted from config group labels */
.config-group-label {
  font-family: Montserrat, sans-serif;
  font-weight: 600;
  font-size: 0.9em;
  color: inherit;
  margin-left: 2px;
  margin-bottom: 8px;
  display: block;
}

.btn-icon-combined {
  height: 24px;
  width: auto;
}

/* --- Upgrade Highlight Logic --- */
.highlight-auth {
  animation: pulse-highlight 1.25s ease-in-out forwards;
}

/* Target the specific twinkle icon within the magic link button during highlight */
.highlight-auth #btn-magic-link .btn-icon,
.highlight-auth #btn-magic-link .btn-icon-combined {
  animation: icon-twinkle 4s ease-in-out forwards;
}

@keyframes pulse-highlight {
  0% {
    box-shadow: inset 0 0 0 0 rgb(225 166 60 / 0%);
  }

  25% {
    box-shadow: inset 0 0 12px 6px rgb(225 166 60 / 70%);
  }

  50% {
    box-shadow: inset 0 0 0 0 rgb(225 166 60 / 0%);
  }

  75% {
    box-shadow: inset 0 0 12px 6px rgb(225 166 60 / 70%);
  }

  100% {
    box-shadow: inset 0 0 0 0 rgb(225 166 60 / 0%);
  }
}

@keyframes icon-twinkle {
  0%,
  50%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }

  25%,
  75% {
    transform: scale(1.4);
    filter: brightness(1.8);
  }
}

/* --- Combined Auth Form Styling --- */
.auth-combined-form {
  display: flex;
  align-items: stretch;
  margin-bottom: 15px !important;
  border: 1px solid var(--golden-hour);
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--bright-sky);
}

.auth-input-combined {
  flex: 1;
  border: none;
  background-color: transparent;
  color: var(--deep-midnight);
  padding: 12px 15px;
  font-family: Montserrat, sans-serif;
  font-size: 1rem;
  outline: none;
  min-width: 0;
}

.auth-input-combined:focus-visible {
  box-shadow: inset 0 0 0 2px rgb(225 166 60 / 90%);
}

.auth-combined-form:focus-within {
  border-color: #f0c56d;
  box-shadow: 0 0 0 3px rgb(225 166 60 / 35%);
}

.auth-input-combined::placeholder {
  color: #888;
}

.btn-magic-combined {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #e1a63c;
  color: #1b2032;
  border: none;
  padding: 0 20px;
  font-family: Montserrat, sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: filter 0.2s;
}

.btn-magic-combined:hover {
  filter: brightness(1.1);
}
