/* =====================================
   Enhanced Journey Results Design
   Beautiful Bangalore Metro Results
   ===================================== */

/* Results Section - Complete Redesign */
.results-section {
  margin: var(--space-2xl) 0;
  display: none;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.results-section.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Main Result Card */
.result-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  position: relative;
}

/* Journey Header */
.result-header {
  background: var(--garden-gradient);
  color: var(--white);
  padding: var(--space-xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.result-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 20px 20px;
  animation: float 15s linear infinite;
}

.result-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.result-header h3 i {
  font-size: 1.3rem;
}

/* Journey Route Visual */
.journey-route-visual {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  padding: var(--space-xl);
  border-bottom: 1px solid var(--border-light);
}

.route-timeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.route-station {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  flex: 1;
  min-width: 80px;
}

.station-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--garden-green);
  border: 4px solid var(--white);
  box-shadow: 0 0 0 2px var(--garden-green);
  margin-bottom: var(--space-sm);
  position: relative;
  z-index: 2;
  animation: pulse-dot 2s ease-in-out infinite;
}

.station-dot.origin {
  background: var(--tech-purple);
  box-shadow: 0 0 0 2px var(--tech-purple);
}

.station-dot.destination {
  background: var(--heritage-terracotta);
  box-shadow: 0 0 0 2px var(--heritage-terracotta);
}

.station-dot.interchange {
  background: var(--yellow-line);
  box-shadow: 0 0 0 2px var(--yellow-line);
  width: 24px;
  height: 24px;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.route-timeline .station-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-dark);
  max-width: 100px;
  line-height: 1.2;
}

.route-timeline .route-line {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--tech-purple) 0%, var(--garden-green) 50%, var(--heritage-terracotta) 100%);
  border-radius: 2px;
  z-index: 1;
}

/* Journey Step Cards - New Design */
.journey-segments {
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.journey-step-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-light);
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
}

.journey-step-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.journey-step-card.purple-line {
  border-left: 6px solid var(--purple-line);
}

.journey-step-card.green-line {
  border-left: 6px solid var(--green-line);
}

.journey-step-card.transfer-step {
  border-left: 6px solid var(--yellow-line);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.02) 0%, transparent 100%);
}

/* Step Header */
.step-header {
  display: flex;
  align-items: center;
  padding: var(--space-lg);
  background: var(--light-gray);
  border-bottom: 1px solid var(--border-light);
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--garden-green);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  margin-right: var(--space-lg);
  flex-shrink: 0;
}

.transfer-step .step-number {
  background: var(--yellow-line);
}

.step-info {
  flex: 1;
  margin-right: var(--space-lg);
}

.step-info h3 {
  margin: 0 0 var(--space-xs) 0;
  font-size: 1.2rem;
  color: var(--text-dark);
}

.line-badge {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.9rem;
  color: var(--text-light);
}

.line-badge.purple {
  color: var(--purple-line);
}

.line-badge.green {
  color: var(--green-line);
}

.line-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.transfer-badge {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.9rem;
  color: var(--yellow-line);
  font-weight: 500;
}

.step-duration {
  text-align: right;
  flex-shrink: 0;
}

.duration-main {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1;
}

.duration-sub {
  display: block;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 2px;
}

/* Step Content */
.step-content {
  padding: var(--space-lg);
}

/* Journey Route Visualization */
.journey-route {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-lg);
  position: relative;
}

.route-point {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  z-index: 2;
  position: relative;
}

.route-point.start .route-dot {
  background: var(--tech-purple);
  border: 3px solid var(--white);
  box-shadow: 0 0 0 2px var(--tech-purple);
}

.route-point.end .route-dot {
  background: var(--heritage-terracotta);
  border: 3px solid var(--white);
  box-shadow: 0 0 0 2px var(--heritage-terracotta);
}

.route-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--garden-green);
  flex-shrink: 0;
}

.route-station {
  display: flex;
  flex-direction: column;
}

.station-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-dark);
  margin-bottom: 2px;
}

.station-detail {
  font-size: 0.85rem;
  color: var(--text-light);
}

.route-line {
  flex: 1;
  height: 4px;
  margin: 0 var(--space-lg);
  position: relative;
  background: var(--border-light);
  border-radius: 2px;
}

.line-progress {
  height: 100%;
  border-radius: 2px;
  position: relative;
}

.line-progress.purple {
  background: linear-gradient(90deg, var(--purple-line), var(--tech-purple-light));
}

.line-progress.green {
  background: linear-gradient(90deg, var(--green-line), var(--garden-green-light));
}

.stations-count {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--white);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--text-light);
  border: 1px solid var(--border-light);
  white-space: nowrap;
}

/* Journey Details */
.journey-details {
  margin-top: var(--space-lg);
}

.detail-row {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.9rem;
  color: var(--text-light);
}

.detail-item i {
  color: var(--garden-green);
  width: 16px;
  text-align: center;
}

/* Transfer Step Specific Styles */
.transfer-station {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
  padding: var(--space-lg);
  background: var(--light-gray);
  border-radius: var(--radius-md);
}

.station-icon {
  width: 50px;
  height: 50px;
  background: var(--yellow-line);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.station-info h4 {
  margin: 0 0 var(--space-xs) 0;
  font-size: 1.1rem;
  color: var(--text-dark);
}

.station-info p {
  margin: 0;
  color: var(--text-light);
  font-size: 0.9rem;
}

.transfer-steps {
  margin-bottom: var(--space-lg);
}

.transfer-step-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.step-dot {
  width: 24px;
  height: 24px;
  background: var(--yellow-line);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

.transfer-step-item span {
  line-height: 1.5;
  color: var(--text-dark);
}

.transfer-tips {
  background: var(--light-gray);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--yellow-line);
}

.transfer-tips h5 {
  margin: 0 0 var(--space-md) 0;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.transfer-tips ul {
  margin: 0;
  padding-left: var(--space-lg);
  list-style-type: disc;
}

.transfer-tips li {
  margin-bottom: var(--space-sm);
  color: var(--text-light);
  line-height: 1.5;
}

/* Journey Summary Card - New Design */
.journey-summary-card {
  background: linear-gradient(135deg, var(--garden-green) 0%, var(--garden-green-light) 100%);
  color: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin-top: var(--space-lg);
  position: relative;
  overflow: hidden;
}

.journey-summary-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 30%, transparent 70%);
  border-radius: 50%;
}

.summary-header {
  margin-bottom: var(--space-xl);
  position: relative;
  z-index: 2;
}

.summary-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.summary-title h3 {
  margin: 0;
  font-size: 1.3rem;
}

.summary-route {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  font-size: 1rem;
  opacity: 0.9;
}

.route-origin,
.route-destination {
  font-weight: 600;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  position: relative;
  z-index: 2;
}

.stat-card {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition);
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

.stat-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 2px;
}

.stat-label {
  font-size: 0.85rem;
  opacity: 0.8;
}

.fare-details {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  z-index: 2;
}

.fare-details h4 {
  margin: 0 0 var(--space-md) 0;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.fare-breakdown {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.fare-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
}

.fare-option.smart-card {
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.fare-option span {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.discount {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.fare-single {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-size: 1.1rem;
}

/* Action Buttons */
.result-actions {
  padding: var(--space-xl);
  background: var(--light-gray);
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.action-button {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  border: 2px solid transparent;
}

.action-button.primary {
  background: var(--tech-gradient);
  color: var(--white);
}

.action-button.primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.action-button.secondary {
  background: var(--white);
  color: var(--garden-green);
  border-color: var(--garden-green);
}

.action-button.secondary:hover {
  background: var(--garden-green);
  color: var(--white);
}

/* Journey Note */
.journey-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-xl);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(59, 130, 246, 0.02) 100%);
  border-left: 4px solid #3b82f6;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  margin: 0;
}

.journey-note i {
  color: #3b82f6;
  font-size: 1.2rem;
  margin-top: 2px;
  flex-shrink: 0;
}

.journey-note-content {
  flex: 1;
}

.journey-note-content strong {
  color: var(--text-dark);
  display: block;
  margin-bottom: var(--space-xs);
}

.journey-note-content p {
  margin: 0;
  color: var(--text-light);
  line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
  .route-timeline {
    flex-direction: column;
    gap: var(--space-lg);
  }
  
  .route-timeline .route-line {
    display: none;
  }
  
  .step-header {
    flex-direction: column;
    text-align: center;
    gap: var(--space-md);
  }
  
  .step-number {
    margin-right: 0;
  }
  
  .step-info {
    margin-right: 0;
  }
  
  .journey-route {
    flex-direction: column;
    gap: var(--space-lg);
    align-items: stretch;
  }
  
  .route-line {
    height: 40px;
    width: 4px;
    margin: 0 auto;
    align-self: center;
  }
  
  .line-progress {
    width: 100%;
  }
  
  .stations-count {
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
  }
  
  .summary-stats {
    grid-template-columns: 1fr;
  }
  
  .detail-row {
    flex-direction: column;
  }
  
  .result-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .action-button {
    width: 100%;
    justify-content: center;
    max-width: 300px;
  }
  
  .transfer-station {
    flex-direction: column;
    text-align: center;
    gap: var(--space-md);
  }
  
  .journey-note {
    padding: var(--space-lg);
  }
}

@media (max-width: 480px) {
  .result-header {
    padding: var(--space-lg);
  }
  
  .result-header h3 {
    font-size: 1.2rem;
    flex-direction: column;
    gap: var(--space-xs);
  }
  
  .journey-route-visual {
    padding: var(--space-lg);
  }
  
  .route-timeline .station-name {
    font-size: 0.8rem;
    max-width: 80px;
  }
  
  .journey-segments {
    padding: var(--space-lg);
  }
  
  .step-content {
    padding: var(--space-md);
  }
  
  .journey-summary-card {
    padding: var(--space-lg);
  }
  
  .stat-card {
    padding: var(--space-md);
  }
  
  .stat-value {
    font-size: 1.1rem;
  }
  
  .fare-option {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
}

/* Loading Animation for Results */
.results-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-2xl);
  text-align: center;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-light);
  border-top: 4px solid var(--garden-green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-text {
  color: var(--text-light);
  font-size: 1.1rem;
  font-weight: 500;
}

/* Error State */
.result-error {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--heritage-terracotta);
}

.result-error i {
  font-size: 3rem;
  margin-bottom: var(--space-lg);
  opacity: 0.7;
}

.result-error h3 {
  margin-bottom: var(--space-md);
  color: var(--heritage-terracotta);
}

.result-error p {
  color: var(--text-light);
  margin-bottom: var(--space-lg);
}