@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Light theme */
  --primary-color: #2563eb;
  --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --secondary-color: #f8fafc;
  --accent-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;

  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;

  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary-color: #3b82f6;
    --primary-gradient: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    --secondary-color: #1e293b;
    --accent-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;

    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  font-weight: 400;
  min-height: 100vh;
  transition: all 0.3s ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.header {
  text-align: center;
  margin-bottom: 3rem;
}

.main-title {
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--primary-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.title-emoji {
  background: none;
  -webkit-text-fill-color: initial;
  font-size: 2.5rem;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 400;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
}

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

.card-header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title .emoji {
  font-size: 1.5rem;
}

.card-content {
  padding: 1.5rem;
}

.table-container {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: var(--bg-primary);
  table-layout: auto;
}

th {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 0.5rem;
  text-align: left;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

td {
  padding: 0.875rem 0.5rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-weight: 400;
  white-space: nowrap;
}

/* Specific column sizing for better mobile experience */
#currentPlanning th:nth-child(1),
#currentPlanning td:nth-child(1) {
  width: 20%;
  font-weight: 600;
}

#currentPlanning th:nth-child(2),
#currentPlanning td:nth-child(2) {
  width: 25%;
}

#currentPlanning th:nth-child(3),
#currentPlanning td:nth-child(3),
#currentPlanning th:nth-child(4),
#currentPlanning td:nth-child(4) {
  width: 27.5%;
}

/* Velib table optimizations */
#velib table th:nth-child(1),
#velib table td:nth-child(1) {
  width: 55%;
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.3;
}

#velib table th:nth-child(2),
#velib table td:nth-child(2),
#velib table th:nth-child(3),
#velib table td:nth-child(3),
#velib table th:nth-child(4),
#velib table td:nth-child(4) {
  width: 15%;
  text-align: center;
}

/* RER C table optimizations */
#listRerC th:nth-child(1),
#listRerC td:nth-child(1) {
  width: 20%;
}

#listRerC th:nth-child(2),
#listRerC td:nth-child(2) {
  width: 15%;
  text-align: center;
}

#listRerC th:nth-child(3),
#listRerC td:nth-child(3) {
  width: 20%;
}

#listRerC th:nth-child(4),
#listRerC td:nth-child(4) {
  width: 25%;
  white-space: normal;
  word-wrap: break-word;
}

#listRerC th:nth-child(5),
#listRerC td:nth-child(5) {
  width: 20%;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: all 0.2s ease;
}

tbody tr:hover {
  background: var(--bg-secondary);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.status-available {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-color);
}

.status-limited {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning-color);
}

.status-unavailable {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
}

.no-data-message {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
  font-style: italic;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin: 1rem 0;
}

.time-highlight {
  font-weight: 600;
  color: var(--primary-color);
}

.number-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 1.5rem;
  background: var(--primary-color);
  color: white;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .main-title {
    font-size: 2rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .card-header,
  .card-content {
    padding: 1rem;
  }

  th, td {
    padding: 0.5rem 0.25rem;
    font-size: 0.8rem;
  }

  /* More compact number badges on mobile */
  .number-badge {
    min-width: 1.5rem;
    height: 1.25rem;
    font-size: 0.7rem;
  }

  /* Smaller status badges on mobile */
  .status-badge {
    padding: 0.125rem 0.5rem;
    font-size: 0.65rem;
  }
}

@media (max-width: 480px) {
  .main-title {
    font-size: 1.75rem;
  }

  .title-emoji {
    font-size: 1.75rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  th, td {
    padding: 0.375rem 0.25rem;
    font-size: 0.75rem;
  }

  /* Stack shuttle times vertically on very small screens */
  #currentPlanning th:nth-child(1),
  #currentPlanning td:nth-child(1) {
    width: 25%;
  }

  #currentPlanning th:nth-child(2),
  #currentPlanning td:nth-child(2) {
    width: 25%;
  }

  #currentPlanning th:nth-child(3),
  #currentPlanning td:nth-child(3),
  #currentPlanning th:nth-child(4),
  #currentPlanning td:nth-child(4) {
    width: 25%;
  }

  /* Velib station names get more space on mobile */
  #velib table th:nth-child(1),
  #velib table td:nth-child(1) {
    width: 55%;
    font-size: 0.7rem;
  }

  #velib table th:nth-child(2),
  #velib table td:nth-child(2),
  #velib table th:nth-child(3),
  #velib table td:nth-child(3),
  #velib table th:nth-child(4),
  #velib table td:nth-child(4) {
    width: 15%;
  }
}

/* Loading animation */
.loading {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Fade in animation */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Footer Styles */
.footer {
  margin-top: 4rem;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-lg);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-section h3 {
  color: var(--text-primary);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-section h4 {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.footer-section p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section li {
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding: 0.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-time {
  font-weight: 500;
  color: var(--primary-color);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding: 1rem 2rem;
  text-align: center;
  background: var(--bg-secondary);
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0;
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
    text-align: center;
  }

  .footer-bottom {
    padding: 1rem;
  }

  .main-title {
    font-size: 2rem;
    flex-direction: column;
    gap: 0.25rem;
  }

  .title-emoji {
    font-size: 2rem;
  }
}
