/*
 * Système de Réservation de Vélos - Styles de boutons
 * Fichier: button-styles.css
 * Description: Styles pour tous les types de boutons du site
 */

/* Base Button Styles */
button {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--transition-speed);
}

/* ======= 1. Styles du bouton principal ======= */
.primary-button {
  background-color: var(--primary-color);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.2);
  transition: all var(--transition-speed), box-shadow 0.5s ease;
  cursor: pointer !important;
  position: relative !important;
}

.primary-button:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(46, 125, 50, 0.25);
}

.primary-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.2);
}

/* Special styling for the "Show Bikes" button when all selections are complete */
#showBikes[data-selections-complete="true"], 
.ready-to-click {
  animation: subtle-glow 2s infinite alternate ease-in-out;
  box-shadow: 0 4px 15px rgba(46, 125, 50, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

#showBikes[data-selections-complete="true"]::after,
.ready-to-click::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 100%
  );
  transform: rotate(30deg);
  pointer-events: none;
  animation: shimmer 3s linear infinite;
}

#showBikes[data-selections-complete="true"]:hover,
.ready-to-click:hover {
  animation: none;
  background-color: var(--primary-dark);
  box-shadow: 0 6px 20px rgba(46, 125, 50, 0.5);
  transform: translateY(-3px);
}

/* Secondary Button */
.secondary-button {
  background-color: var(--surface-color-alt);
  color: var(--text-color);
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  border: 1px solid var(--border-color);
}

.secondary-button:hover {
  background-color: var(--surface-color);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* Disabled Button States */
.primary-button:disabled,
.secondary-button:disabled {
  background-color: #f5f5f5;
  color: #9e9e9e;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  border-color: #e0e0e0;
}

.primary-button:disabled:hover,
.secondary-button:disabled:hover {
  background-color: #f5f5f5;
  color: #9e9e9e;
  transform: none;
  box-shadow: none;
  border-color: #e0e0e0;
}

/* Text Button */
.text-button {
  color: var(--text-color-secondary);
  background: transparent;
  padding: 0.5rem;
  font-weight: 500;
}

.text-button:hover {
  color: var(--primary-color);
}

/* CTA Button */
.cta-button {
  display: inline-block;
  background-color: var(--primary-color);
  color: white;
  padding: 1rem 2rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  text-align: center;
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.2);
  transition: all var(--transition-speed);
}

.cta-button:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(46, 125, 50, 0.25);
}

/* Mic Button */
.mic-button {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  margin-left: 0.5rem;
  transition: background-color var(--transition-speed);
}

.mic-button:hover {
  background-color: var(--primary-dark);
}

/* ======= 2. Styles du tooltip de sélection ======= */
.selection-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background-color: white;
  color: #333;
  padding: 10px 15px;
  border-radius: 6px;
  box-shadow: 0 3px 15px rgba(0,0,0,0.2);
  font-size: 0.9rem;
  text-align: center;
  width: 300px;
  z-index: 100;
  animation: fadeInDown 0.3s ease-out;
  line-height: 1.5;
}

.selection-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -8px;
  border-width: 8px;
  border-style: solid;
  border-color: white transparent transparent transparent;
}

.selection-tooltip.show {
  display: block;
}

/* Style pour surligner les sections où des choix manquent */
.highlight-needed {
  animation: pulse-highlight 1s ease-in-out;
  border: 2px dashed var(--primary-color, #2e7d32) !important;
  background-color: rgba(46, 125, 50, 0.05) !important;
}

/* ======= 3. Styles des boutons de sélection ======= */
/* Date and Duration Options */
.date-option,
.duration-option {
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  background-color: var(--surface-color);
  color: var(--text-color);
  font-size: 0.875rem;
  border: 1px solid var(--border-color);
  transition: all var(--transition-speed);
  flex: 1;
  min-width: 70px;
  min-height: 44px; /* Ensure minimum touch target */
  text-align: center;
  cursor: pointer;
  position: relative;
  z-index: 1;
  pointer-events: auto; /* Ensure clicks work */
  user-select: none; /* Prevent text selection */
  display: flex;
  align-items: center;
  justify-content: center;
}

.date-option:hover,
.duration-option:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.date-option.active,
.duration-option.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Quantity Buttons */
.quantity-quick-select {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.quantity-option {
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius, 30px);
  background-color: var(--surface-color, white);
  color: var(--text-color, #333);
  font-size: 0.875rem;
  border: 1px solid var(--border-color, #ddd);
  transition: all var(--transition-speed, 0.2s);
  flex: 1;
  min-width: 70px;
  text-align: center;
}

.quantity-option:hover {
  border-color: var(--primary-color, #2e7d32);
  color: var(--primary-color, #2e7d32);
}

.quantity-option.active {
  background-color: var(--primary-color, #2e7d32);
  color: white;
  border-color: var(--primary-color, #2e7d32);
}

/* Bike Type Buttons */
.bike-type-select {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 12px !important;
  width: 100% !important;
  justify-content: space-between !important;
}

.bike-type-option {
  flex: 1 1 25% !important;  /* 4 boutons = 25% chacun */
  min-width: 100px !important;
  padding: 16px 10px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: var(--border-radius);
  background-color: var(--surface-color);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  transition: all var(--transition-speed);
}

/* Special styling for when bike type is alone in the selector row */
.selector-row:nth-child(2) .bike-type-option {
  min-height: 110px !important;
  padding: 24px 10px !important;
}

.selector-row:nth-child(2) .bike-type-option .icon {
  font-size: 2.2rem !important;
  margin-bottom: 12px !important;
}

.selector-row:nth-child(2) .bike-type-option span:not(.icon) {
  font-size: 1.1rem !important;
  font-weight: 500 !important;
}

.bike-type-option .icon,
.location-option .icon {
  font-size: 1.5rem !important;
  margin-bottom: 5px !important;
  display: block !important;
}

.bike-type-option span,
.location-option span {
  font-size: 0.875rem;
}

.bike-type-option:hover,
.location-option:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.bike-type-option.active,
.location-option.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  position: relative;
}

/* Add check mark indicator to active options */
.bike-type-option.active::after {
  content: "✓";
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: #4caf50;
  color: white;
  width: 20px;
  height: 20px;
  font-size: 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  animation: checkmark-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes checkmark-pop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* For specific option types */
.bike-type-option[data-value="electric"].active::after {
  background-color: #ff9800;
}

.bike-type-option[data-value="mountain"].active::after {
  background-color: #795548;
}

.bike-type-option[data-value="child"].active::after {
  background-color: #2196f3;
}

/* Style spécial pour le bouton Enfant */
.bike-type-option[data-value="child"] .icon {
  font-size: 1.3rem !important;
}

/* Add Extra Button */
.add-extra {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem;
  background-color: var(--surface-color-alt);
  color: var(--text-color);
  border-radius: var(--border-radius);
  font-weight: 500;
  transition: all var(--transition-speed);
}

.plus-icon {
  font-weight: 600;
  font-size: 1.25rem;
}

.add-extra:hover {
  background-color: var(--primary-color);
  color: white;
}

.add-extra.added {
  background-color: var(--primary-light);
  color: white;
}

.add-extra.added .plus-icon {
  content: '✓';
}

/* Express Checkout Button */
.express-checkout-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1.25rem 1.5rem;
  background-color: var(--primary-color);
  color: white;
  border-radius: var(--border-radius);
  font-weight: 700;
  font-size: 1.125rem;
  box-shadow: 0 6px 16px rgba(46, 125, 50, 0.25);
  transition: all var(--transition-speed);
}

.express-checkout-button:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}

.express-checkout-button:active {
  transform: translateY(0);
}

/* Share Buttons */
.share-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  font-size: 0.875rem;
  transition: all var(--transition-speed);
}

.share-button.facebook {
  background-color: #1877f2;
  color: white;
}

.share-button.twitter {
  background-color: #1da1f2;
  color: white;
}

.share-button.email {
  background-color: var(--surface-color-alt);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.share-button:hover {
  opacity: var(--hover-opacity);
}

/* Tab Buttons (Legal and Circuit) */
.legal-tab, .circuit-tab {
  background: none;
  border: none;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-color);
  cursor: pointer;
  position: relative;
  transition: all 0.3s;
}

.legal-tab:hover, .circuit-tab:hover {
  color: var(--primary-color);
}

.legal-tab.active, .circuit-tab.active {
  color: var(--primary-color);
}

.legal-tab.active::after, .circuit-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--primary-color);
}

/* Circuit Buttons */
.circuit-detail-button, 
.circuit-download-button,
.circuit-preview-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s;
}

.circuit-detail-button {
  background-color: var(--primary-color);
  color: white;
}

.circuit-detail-button:hover {
  background-color: var(--primary-dark);
  color: white;
  transform: translateY(-2px);
}

.circuit-download-button {
  background-color: var(--surface-color-alt);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.circuit-download-button:hover {
  background-color: var(--surface-color);
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
}

.circuit-preview-button {
  background-color: var(--surface-color);
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.circuit-preview-button:hover {
  background-color: var(--highlight-color);
  transform: translateY(-2px);
}

/* Calendar Button Styles */
.date-picker-header button {
  background: none;
  border: none;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.date-picker-header button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.calendar-days button {
  background: none;
  border: none;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  border-radius: 50%;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s;
}

.calendar-days button:hover {
  background-color: var(--highlight-color);
}

.calendar-days button.today {
  background-color: var(--primary-color);
  color: white;
  font-weight: bold;
}

.calendar-days button.selected {
  background-color: var(--primary-light);
  color: white;
  font-weight: bold;
}

.calendar-days button.prev-month-day,
.calendar-days button.next-month-day {
  color: var(--text-color-tertiary);
  opacity: 0.6;
}

.calendar-days button.past-day {
  color: var(--text-color-tertiary);
  opacity: 0.3;
  cursor: not-allowed;
  background-color: transparent;
}

/* Dropdown Option Button Styles */
.dropdown-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.dropdown-option:last-child {
  border-bottom: none;
}

.dropdown-option:hover {
  background-color: var(--highlight-color);
}

.dropdown-option.selected {
  background-color: var(--primary-light);
  color: white;
  font-weight: bold;
}

/* ======= 4. Styles du résumé de réservation ======= */
.summary-details {
  margin-top: 15px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.summary-item {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 8px 12px !important;
  background-color: var(--surface-color-alt, #f9f9f9) !important;
  border-radius: 8px !important;
  margin-bottom: 5px !important;
  min-height: 45px !important;  /* Hauteur suffisante pour le cas weekend */
}

/* Supprimer les styles qui pourraient entrer en conflit */
.summary-item::before {
  display: none !important;
}

.summary-label {
  font-weight: 600 !important;
  color: var(--text-color-secondary, #666) !important;
  font-size: 0.85rem !important;
  flex: 0 0 auto !important;
}

.summary-value {
  text-align: right !important;
  margin-left: 10px !important;
  font-size: 0.85rem !important;
  line-height: 1.4 !important;
  white-space: normal !important;
  word-break: normal !important;
  font-weight: 500 !important;
  color: var(--text-color, #333) !important;
}

/* Style spécial pour afficher les dates sur deux lignes quand nécessaire (weekend) */
#summaryDate {
  display: inline-block !important;
}

/* ======= 5. Animations ======= */
@keyframes shimmer {
  0% {
    transform: rotate(30deg) translateX(-100%);
  }
  100% {
    transform: rotate(30deg) translateX(100%);
  }
}

@keyframes subtle-glow {
  from {
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.4);
    filter: brightness(1);
  }
  to {
    box-shadow: 0 4px 20px rgba(46, 125, 50, 0.6), 0 0 5px rgba(255, 255, 255, 0.3);
    filter: brightness(1.07);
  }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes pulse-highlight {
  0% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(46, 125, 50, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0); }
}

/* Responsive Button Styles */
@media screen and (max-width: 768px) {
  /* Improve touch targets for mobile */
  button, a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  
  .legal-tab, .circuit-tab {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
  }
  
  .legal-tab.active::after, .circuit-tab.active::after {
    display: none;
  }
  
  .legal-tab.active, .circuit-tab.active {
    background-color: var(--primary-color);
    color: white;
  }
}

  /* Add check mark indicator to active options */
  .bike-type-option.active {
    position: relative;
  }

  .bike-type-option.active::after {
    content: "✓";
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #4caf50;
    color: white;
    width: 20px;
    height: 20px;
    font-size: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: checkmark-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  }

  @keyframes checkmark-pop {
    0% {
      transform: scale(0);
      opacity: 0;
    }
    100% {
      transform: scale(1);
      opacity: 1;
    }
  }

  /* For specific option types */
  .bike-type-option[data-value="electric"].active::after {
    background-color: #ff9800;
  }

  .bike-type-option[data-value="mountain"].active::after {
    background-color: #795548;
  }

  .bike-type-option[data-value="child"].active::after {
    background-color: #2196f3;
  }

/* ======= 6. Reset Mode Button Styling ======= */
.primary-button.reset-mode {
  background-color: #f44336;
  color: white;
  box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: none; /* Remove any glow animation */
}

.primary-button.reset-mode:hover {
  background-color: #d32f2f;
  box-shadow: 0 6px 20px rgba(244, 67, 54, 0.4);
  transform: translateY(-2px);
}

.primary-button.reset-mode:active {
  background-color: #c62828;
  transform: translateY(0);
}

/* Remove the shimmer effect for reset mode */
.primary-button.reset-mode::after {
  display: none;
}