/* ============================================
   DELHI METRO ROUTE FINDER - DARK THEME
   ============================================ */

/* CSS Variables */
:root {
  --bg-primary: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --bg-card: #242424;
  --bg-card-hover: #2a2a2a;
  --bg-input: #2d2d2d;
  --bg-button: #e8e8e8;
  --bg-button-hover: #ffffff;
  
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-muted: #707070;
  --text-button: #000000;
  
  --border-color: #3a3a3a;
  --border-radius: 16px;
  --border-radius-sm: 12px;
  --border-radius-lg: 20px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* App Container */
.app-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0;
}

/* ============================================
   HEADER
   ============================================ */
.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 24px 32px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-content {
  max-width: 100%;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  width: 56px;
  height: 56px;
  background: var(--text-primary);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-primary);
}

.header-text h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.5px;
}

.header-text p {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  padding: 32px;
}

/* ============================================
   PLANNER CARD
   ============================================ */
.planner-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.card-header svg {
  color: var(--text-secondary);
}

.card-header h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.3px;
}

/* ============================================
   JOURNEY INPUTS
   ============================================ */
.journey-inputs {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.input-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.input-label svg {
  width: 18px;
  height: 18px;
}

/* Select Wrapper */
.select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.station-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 18px 48px 18px 20px;
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.station-select:hover {
  background: var(--bg-card-hover);
  border-color: #4a4a4a;
}

.station-select:focus {
  outline: none;
  border-color: #5a5a5a;
  background: var(--bg-card-hover);
}

.station-select option {
  background: var(--bg-input);
  color: var(--text-primary);
  padding: 12px;
}

.dropdown-icon {
  position: absolute;
  right: 20px;
  pointer-events: none;
  color: var(--text-secondary);
  transition: var(--transition);
}

.select-wrapper:hover .dropdown-icon {
  color: var(--text-primary);
}

/* Swap Button */
.swap-btn {
  align-self: center;
  width: 56px;
  height: 56px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
  margin: 8px 0;
}

.swap-btn:hover {
  background: var(--bg-card-hover);
  border-color: #4a4a4a;
  color: var(--text-primary);
  transform: rotate(180deg);
}

.swap-btn:active {
  transform: rotate(180deg) scale(0.95);
}

/* Find Button */
.find-btn {
  background: var(--bg-button);
  color: var(--text-button);
  border: none;
  border-radius: var(--border-radius);
  padding: 18px 32px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.find-btn:hover {
  background: var(--bg-button-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.find-btn:active {
  transform: translateY(0);
}

.find-btn svg {
  width: 20px;
  height: 20px;
}

/* ============================================
   RESULT CONTAINER
   ============================================ */
.result-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.result-container:empty {
  display: none;
}

/* ============================================
   ROUTE DISPLAY
   ============================================ */
.route-timeline {
  padding: 0;
}

.station-row {
  display: flex;
  align-items: center;
  padding: 16px 28px;
  position: relative;
  transition: var(--transition);
}

.station-row:hover {
  background: var(--bg-card-hover);
}

.station-row::before {
  content: '';
  position: absolute;
  left: 39px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: currentColor;
  opacity: 0.15;
}

.station-row.first::before {
  top: 50%;
}

.station-row.last::before {
  bottom: 50%;
}

.dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-right: 20px;
  border: 4px solid var(--bg-card);
  box-shadow: 0 0 0 2px currentColor;
  flex-shrink: 0;
  z-index: 1;
}

.station-name {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
  letter-spacing: 0.5px;
}

/* ============================================
   INTERCHANGE CARD
   ============================================ */
.interchange-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 28px;
  margin: 8px 28px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 15px;
}

.interchange-card svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--text-secondary);
}

.interchange-card b {
  font-size: 16px;
  display: block;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.interchange-card small {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ============================================
   JOURNEY SUMMARY
   ============================================ */
.journey-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 20px;
  padding: 28px;
  margin: 20px 28px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
}

.summary-item {
  text-align: center;
}

.summary-item strong {
  display: block;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.summary-item span {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

/* ============================================
   LOADING STATE
   ============================================ */
.loading {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

.spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--text-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading span {
  font-size: 16px;
  font-weight: 500;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 80px 32px;
  color: var(--text-secondary);
}

.empty-state svg {
  margin-bottom: 20px;
  color: var(--text-muted);
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 10px;
  font-weight: 600;
}

.empty-state p {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 320px;
  margin: 0 auto;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
  .header {
    padding: 20px 24px;
  }
  
  .logo {
    width: 48px;
    height: 48px;
  }
  
  .header-text h1 {
    font-size: 24px;
  }
  
  .header-text p {
    font-size: 14px;
  }
  
  .main-content {
    padding: 24px 16px;
  }
  
  .planner-card {
    padding: 24px 20px;
  }
  
  .card-header h2 {
    font-size: 20px;
  }
  
  .journey-summary {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 20px;
    margin: 16px 20px;
  }
  
  .summary-item strong {
    font-size: 22px;
  }
  
  .station-row {
    padding: 14px 20px;
  }
  
  .interchange-card {
    margin: 8px 20px;
    padding: 16px 20px;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 16px 20px;
  }
  
  .logo-container {
    gap: 12px;
  }
  
  .logo {
    width: 44px;
    height: 44px;
  }
  
  .header-text h1 {
    font-size: 22px;
  }
  
  .planner-card {
    padding: 20px 16px;
  }
  
  .station-select {
    font-size: 16px;
    padding: 16px 44px 16px 16px;
  }
  
  .find-btn {
    font-size: 16px;
    padding: 16px 28px;
  }
  
  .swap-btn {
    width: 48px;
    height: 48px;
  }
  
  .journey-summary {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-input);
  border-radius: 6px;
  border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bg-card-hover);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-container > * {
  animation: fadeIn 0.4s ease-out;
}

.station-row {
  animation: fadeIn 0.3s ease-out backwards;
}

.station-row:nth-child(1) { animation-delay: 0.05s; }
.station-row:nth-child(2) { animation-delay: 0.1s; }
.station-row:nth-child(3) { animation-delay: 0.15s; }
.station-row:nth-child(4) { animation-delay: 0.2s; }
.station-row:nth-child(5) { animation-delay: 0.25s; }

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  body {
    background: white;
    color: black;
  }
  
  .header {
    border-bottom-color: #ddd;
  }
  
  .find-btn,
  .swap-btn {
    display: none;
  }
}
