/* Personal routes page styles */
@import url('poi_recommendation_system.css');

/* Page-local overrides or additions can go below if needed */

/* Intent discovery */
.intent-discovery-section {
  margin-bottom: 28px;
  padding: 24px;
  background: #ffffff;
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
}

.intent-discovery-copy {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.intent-discovery-copy .section-title {
  margin: 0;
  white-space: nowrap;
}

.intent-discovery-copy p {
  max-width: 620px;
  margin: 0;
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: right;
}

.intent-chip-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.intent-chip {
  min-height: 74px;
  padding: 12px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #f8fafc;
  color: #1e293b;
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-areas:
    "icon main"
    "icon meta";
  column-gap: 10px;
  align-items: center;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
  touch-action: manipulation;
}

.intent-chip i {
  grid-area: icon;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #e0f2fe;
  color: #0369a1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.intent-chip-main {
  grid-area: main;
  font-weight: 750;
  line-height: 1.15;
}

.intent-chip-meta {
  grid-area: meta;
  color: #64748b;
  font-size: 0.76rem;
  line-height: 1.2;
}

.intent-chip:hover,
.intent-chip.active {
  transform: translateY(-1px);
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
}

.intent-chip.is-estimated i {
  background: #fef3c7;
  color: #92400e;
}

.intent-chip.is-estimated.active,
.intent-chip.is-estimated:hover {
  border-color: #d97706;
  background: #fffbeb;
  box-shadow: 0 8px 20px rgba(217, 119, 6, 0.12);
}

/* Quick Selection Buttons Enhancement */
.quick-selection-section {
  margin-top: 30px;
  padding: 25px;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 16px;
  border: 1px solid #cbd5e0;
}

.quick-selection-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.quick-selection-title i {
  color: #4299e1;
  font-size: 1.1rem;
}

.quick-selection-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  max-width: 100%;
}

.quick-btn {
  background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #4a5568;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  min-height: 56px;
}

.quick-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-color: #4299e1;
  background: linear-gradient(135deg, #ffffff 0%, #ebf8ff 100%);
}

.quick-btn:active {
  transform: translateY(0);
  transition: transform 0.1s;
}

.quick-btn.active {
  background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
  color: white;
  border-color: #3182ce;
  box-shadow: 0 8px 25px rgba(66, 153, 225, 0.4);
  animation: quickBtnPulse 0.6s ease-out;
}

.quick-btn.active::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: quickBtnRipple 0.6s ease-out;
}

@keyframes quickBtnPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes quickBtnRipple {
  0% {
    width: 0;
    height: 0;
    opacity: 1;
  }
  100% {
    width: 200px;
    height: 200px;
    opacity: 0;
  }
}

.quick-btn i {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.quick-btn:hover i {
  transform: scale(1.1);
}

.quick-btn.active i {
  animation: quickBtnIconBounce 0.6s ease-out;
}

@keyframes quickBtnIconBounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0) scale(1);
  }
  40% {
    transform: translateY(-3px) scale(1.1);
  }
  60% {
    transform: translateY(-1px) scale(1.05);
  }
}

/* Slider Animation Enhancement */
.preference-slider-container.updating {
  animation: sliderUpdate 0.3s ease-out;
}

@keyframes sliderUpdate {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

.preference-slider-container.updating .preference-slider {
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.3);
}

.preference-keyword-hint {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 4px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .intent-discovery-section {
    padding: 18px;
    margin-bottom: 22px;
  }

  .intent-discovery-copy {
    display: block;
  }

  .intent-discovery-copy .section-title {
    white-space: normal;
    margin-bottom: 8px;
  }

  .intent-discovery-copy p {
    max-width: none;
    text-align: left;
    font-size: 0.9rem;
  }

  .intent-chip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .intent-chip {
    min-height: 68px;
  }

  .quick-selection-buttons {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  
  .quick-btn {
    padding: 14px 16px;
    font-size: 0.9rem;
    min-height: 52px;
  }
  
  .quick-selection-section {
    padding: 20px;
    margin-top: 25px;
  }
}

@media (max-width: 480px) {
  .intent-chip-grid {
    grid-template-columns: 1fr;
  }

  .quick-selection-buttons {
    grid-template-columns: 1fr;
  }
}

/* Action Buttons Section */
.action-buttons-section {
  display: flex;
  gap: 20px;
  margin: 30px 0;
  justify-content: center;
  flex-wrap: wrap;
}

/* Explore Button Styles */
.explore-btn {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  border: none;
  border-radius: 16px;
  padding: 20px 32px;
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 200px;
  box-shadow: 0 8px 25px rgba(72, 187, 120, 0.3);
  position: relative;
  overflow: hidden;
}

.explore-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(72, 187, 120, 0.4);
  background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

.explore-btn:active {
  transform: translateY(-1px);
  transition: transform 0.1s;
}

.explore-btn .btn-icon {
  font-size: 1.5rem;
  animation: exploreIconSpin 3s linear infinite;
}

.explore-btn .btn-text {
  font-size: 1.1rem;
  font-weight: 600;
}

.explore-btn .btn-subtitle {
  font-size: 0.85rem;
  opacity: 0.9;
  font-weight: 400;
}

.explore-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.explore-btn:hover::before {
  left: 100%;
}

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

/* Update recommend button to match */
.recommend-btn {
  min-width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Loading state for explore button */
.explore-btn.loading {
  background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
  cursor: not-allowed;
  pointer-events: none;
}

.explore-btn.loading .btn-icon {
  animation: exploreIconSpin 1s linear infinite;
}

.explore-btn.loading .btn-text::after {
  content: '...';
  animation: loadingDots 1.5s infinite;
}

body.personal-routes-map-fullscreen .explore-bottom-section {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body:has(#mapContainer.fullscreen) .explore-bottom-section,
body:has(#mapContainer:fullscreen) .explore-bottom-section,
body:has(#mapContainer:-webkit-full-screen) .explore-bottom-section,
body:has(.leaflet-fullscreen-on) .explore-bottom-section,
body:has(.leaflet-pseudo-fullscreen) .explore-bottom-section {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@keyframes loadingDots {
  0%, 20% {
    content: '';
  }
  40% {
    content: '.';
  }
  60% {
    content: '..';
  }
  80%, 100% {
    content: '...';
  }
}

/* Mobile responsive for action buttons */
@media (max-width: 768px) {
  .action-buttons-section {
    flex-direction: column;
    align-items: center;
    gap: 15px;

    /* Make the "Önerilerimi Getir" CTA always reachable on mobile so the user
       doesn't have to scroll past 10 sliders before they can act. */
    position: sticky;
    bottom: 0;
    z-index: 90;
    margin: 0 -16px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)) 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.0) 0%, rgba(255,255,255,0.95) 30%, #ffffff 100%);
    backdrop-filter: blur(6px);
    box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.06);
  }

  .explore-btn,
  .recommend-btn {
    min-width: 250px;
    width: 100%;
    max-width: 300px;
  }

  /* Hide the sticky CTA when map is fullscreen so it doesn't cover the map */
  body.personal-routes-map-fullscreen .action-buttons-section,
  body:has(#mapContainer.fullscreen) .action-buttons-section,
  body:has(#mapContainer:fullscreen) .action-buttons-section,
  body:has(.leaflet-fullscreen-on) .action-buttons-section,
  body:has(.leaflet-pseudo-fullscreen) .action-buttons-section {
    display: none !important;
  }
}

/* Exploration Mode Styles */
.exploration-header {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  color: white;
  padding: 25px;
  border-radius: 16px;
  margin-bottom: 25px;
  text-align: center;
}

.exploration-header h3 {
  margin: 0 0 10px 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.exploration-header p {
  margin: 0 0 15px 0;
  font-size: 1rem;
  opacity: 0.95;
}

.exploration-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 15px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 12px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.stat-item i {
  font-size: 0.8rem;
}

/* Error Message Styles */
.error-message {
  text-align: center;
  padding: 40px 20px;
  background: #fed7d7;
  border: 1px solid #feb2b2;
  border-radius: 16px;
  color: #c53030;
}

.error-message i {
  font-size: 3rem;
  margin-bottom: 15px;
  opacity: 0.7;
}

.error-message h3 {
  margin: 0 0 10px 0;
  font-size: 1.3rem;
}

.error-message p {
  margin: 0 0 20px 0;
  opacity: 0.8;
}

.retry-btn {
  background: #c53030;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s ease;
}

.retry-btn:hover {
  background: #9c2626;
}

/* Mobile responsive for exploration */
@media (max-width: 768px) {
  .exploration-stats {
    gap: 10px;
  }
  
  .stat-item {
    font-size: 0.8rem;
    padding: 6px 10px;
  }
  
  .exploration-header {
    padding: 20px;
  }
  
  .exploration-header h3 {
    font-size: 1.3rem;
  }
}
