/* Variables for light and dark themes */
:root {
  /* Light theme (default) */
  --bg-color: #f8f9fa;
  --bg-card: #ffffff;
  --text-color: #212529;
  --text-secondary: #6c757d;
  --primary-color: #3c7eff;
  --secondary-color: #6f42c1;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --border-color: #dee2e6;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --hover-color: #f1f3f5;
  --input-bg: #ffffff;
  --code-bg: #f5f5f5;
}

/* Dark theme */
.dark-theme {
  --bg-color: #212529;
  --bg-card: #343a40;
  --text-color: #f8f9fa;
  --text-secondary: #adb5bd;
  --primary-color: #4d8bff;
  --secondary-color: #8250df;
  --success-color: #2fbe4e;
  --warning-color: #ffd43b;
  --danger-color: #fa5252;
  --border-color: #495057;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  --hover-color: #2c3237;
  --input-bg: #2c3237;
  --code-bg: #343a40;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

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

a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  margin-bottom: 1rem;
  line-height: 1.2;
}

/* Header styles */
header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  box-shadow: var(--shadow);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo h1 {
  font-size: 1.5rem;
  margin-bottom: 0;
}

.logo svg {
  color: var(--primary-color);
}

.theme-toggle button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-color);
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

.theme-toggle button:hover {
  background-color: var(--hover-color);
}

/* Main content */
main {
  padding: 2rem 0;
}

/* Hero section */
.hero {
  text-align: center;
  padding: 3rem 0;
  margin-bottom: 2rem;
  background-color: var(--bg-card);
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
}

.hero h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 0.25rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}

.btn.primary {
  background-color: var(--primary-color);
  color: white;
  border: none;
}

.btn.primary:hover {
  background-color: var(--primary-color);
  opacity: 0.9;
}

.btn.secondary {
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn.secondary:hover {
  background-color: var(--primary-color);
  color: white;
}

/* Section styles */
section {
  margin-bottom: 4rem;
}

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

.section-header h2 {
  font-size: 2rem;
}

.section-header p {
  color: var(--text-secondary);
}

/* Search section */
.search-container {
  background-color: var(--bg-card);
  border-radius: 0.5rem;
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.form-tabs {
  display: flex;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.tab-btn {
  background: none;
  border: none;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 3px solid transparent;
  transition: color 0.3s, border-color 0.3s;
}

.tab-btn:hover {
  color: var(--primary-color);
}

.tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  background-color: var(--input-bg);
  color: var(--text-color);
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Results container */
.results-container {
  min-height: 200px;
}

.loading, .error, .no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background-color: var(--bg-card);
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.loading svg {
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

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

.error svg {
  color: var(--danger-color);
  margin-bottom: 1rem;
}

.no-results svg {
  color: var(--warning-color);
  margin-bottom: 1rem;
}

/* Results list */
.results-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.result-card {
  background-color: var(--bg-card);
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s;
}

.result-card:hover {
  transform: translateY(-5px);
}

.flight-header, .airport-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.flight-header h3, .airport-header h3 {
  margin-bottom: 0;
}

.status {
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status.active {
  background-color: var(--success-color);
  color: white;
}

.status.scheduled {
  background-color: var(--primary-color);
  color: white;
}

.status.landed {
  background-color: var(--secondary-color);
  color: white;
}

.status.cancelled {
  background-color: var(--danger-color);
  color: white;
}

.status.delayed {
  background-color: var(--warning-color);
  color: black;
}

.airport-code {
  font-size: 0.75rem;
  font-weight: 600;
  background-color: var(--hover-color);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
}

.flight-route {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.departure, .arrival {
  flex: 1;
}

.airport-code {
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.airport-name {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.time {
  font-weight: 600;
}

.terminal, .gate {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.flight-path {
  padding: 0 1rem;
  color: var(--text-secondary);
}

.flight-details, .airport-details {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.detail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.detail svg {
  width: 16px;
  height: 16px;
}

/* MCP Tools section */
.mcp-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.tool-card {
  background-color: var(--bg-card);
  border-radius: 0.5rem;
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.3s;
}

.tool-card:hover {
  transform: translateY(-5px);
}

.tool-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--hover-color);
  border-radius: 50%;
  color: var(--primary-color);
}

.tool-icon svg {
  width: 24px;
  height: 24px;
}

.tool-card h3 {
  margin-bottom: 0.5rem;
}

.tool-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.integration-guide {
  background-color: var(--bg-card);
  border-radius: 0.5rem;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.code-block {
  background-color: var(--code-bg);
  border-radius: 0.25rem;
  padding: 1rem;
  margin-top: 1rem;
  overflow-x: auto;
}

.code-block pre {
  margin: 0;
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9rem;
}

/* Footer */
footer {
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  text-align: center;
  margin-top: 4rem;
}

footer p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

/* Responsive styles */
@media (max-width: 768px) {
  .hero h2 {
    font-size: 2rem;
  }

  .form-tabs {
    flex-wrap: wrap;
  }

  .buttons {
    flex-direction: column;
  }

  .results-list {
    grid-template-columns: 1fr;
  }

  .mcp-tools-grid {
    grid-template-columns: 1fr;
  }
}
