/* Modern CSS Design System for TF2 Price DB */
:root {
  --primary-color: #1e40af;
  --secondary-color: #3b82f6;
  --accent-color: #f59e0b;
  --background-color: #f8fafc;
  --surface-color: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --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);
}

/* Base styles */
* {
  font-family:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    sans-serif;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--background-color);
  min-height: 100vh;
  color: var(--text-primary);
}

/* Add padding to body for fixed navbar */
body {
  padding-top: 80px;
}

/* Navigation */
.navbar {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--primary-color) !important;
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #6b7280;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.status-badge.status-online {
  background: #10b981;
}

.status-badge.status-degraded {
  background: #f59e0b;
}

.status-badge.status-offline {
  background: #dc2626;
}

.status-badge.status-loading {
  background: #6b7280;
}

.status-badge:hover {
  transform: scale(1.05);
}

.status-badge.status-online:hover {
  background: #059669;
  color: white;
}

.status-badge.status-degraded:hover {
  background: #d97706;
  color: white;
}

.status-badge.status-offline:hover {
  background: #b91c1c;
  color: white;
}

.status-badge.status-loading:hover {
  background: #4b5563;
  color: white;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: currentColor;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Hero Section */
.hero-section {
  padding: 2rem 0;
  text-align: center;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-weight: 400;
}

/* Error Page Styles */
.error-section {
  padding: 2rem 0;
  text-align: center;
}

.error-title {
  font-size: 6rem;
  font-weight: 900;
  background: linear-gradient(135deg, #dc2626, #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  line-height: 1;
}

.error-subtitle {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.error-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Buttons */
.btn-primary {
  background: var(--primary-color);
  border: none;
  padding: 0.75rem 2rem;
  font-weight: 600;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md);
}

/* Ensure emojis in buttons maintain their natural colors */
.btn-primary::before,
.btn-outline-primary::before,
.btn::before {
  color: initial;
}

.btn span[style*='color'],
.btn-primary span[style*='color'],
.btn-outline-primary span[style*='color'] {
  color: initial !important;
}

/* Emoji specific styling to override button color inheritance */
.btn-primary,
.btn-outline-primary {
  font-family:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    sans-serif,
    'Apple Color Emoji',
    'Segoe UI Emoji',
    'Noto Color Emoji';
}

/* Force emoji color preservation in buttons */
.btn *,
.btn-primary *,
.btn-outline-primary * {
  color: inherit;
}

/* But preserve emoji colors specifically */
.btn:not(.btn-link) {
  font-family:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    sans-serif,
    'Apple Color Emoji',
    'Segoe UI Emoji',
    'Noto Color Emoji';
  text-rendering: optimizeLegibility;
  -webkit-font-feature-settings: 'liga';
  font-feature-settings: 'liga';
}

/* Emoji class to preserve natural colors in buttons */
.emoji {
  font-style: normal !important;
  font-variant: normal !important;
  text-rendering: auto !important;
  -webkit-font-smoothing: antialiased;
  filter: none !important;
  background: none !important;
}

/* Force emoji colors in buttons - most direct approach */
.btn .emoji,
.btn-primary .emoji,
.btn-outline-primary .emoji,
h1 .emoji,
h2 .emoji,
h3 .emoji,
h4 .emoji,
h5 .emoji,
h6 .emoji,
.hero-title .emoji {
  color: unset !important;
  -webkit-text-fill-color: unset !important;
  background: unset !important;
  text-shadow: unset !important;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji',
    'Segoe UI Symbol', sans-serif !important;
  font-size: inherit !important;
  line-height: inherit !important;
  filter: unset !important;
  font-style: normal !important;
  font-weight: normal !important;
  text-decoration: none !important;
}

/* Additional emoji preservation rules to override Bootstrap */
span.emoji {
  color: initial !important;
  background: none !important;
  text-shadow: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  -webkit-text-fill-color: initial !important;
  font-variant-emoji: emoji !important;
}

/* Ensure emoji font rendering */
.emoji,
span.emoji {
  font-family:
    'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Android Emoji', 'EmojiSymbols',
    'EmojiOne Mozilla', 'Twemoji Mozilla', 'Segoe UI Symbol', 'Noto Emoji' !important;
}

.btn-primary:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
  padding: 0.75rem 2rem;
  font-weight: 600;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
}

/* Feature Cards */
.feature-card {
  background: var(--surface-color);
  border: none;
  border-radius: 1rem;
  padding: 2rem;
  height: 100%;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

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

.feature-icon {
  width: 3rem;
  height: 3rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  margin-bottom: 1rem;
}

/* Chart Container */
.chart-container {
  background: var(--surface-color);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

.chart-frame {
  width: 100%;
  height: 400px;
  border: none;
  border-radius: 0.5rem;
  background: var(--background-color);
}

/* API Documentation Styles */
.api-header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 2rem 0;
  text-align: center;
  margin-bottom: 3rem;
  margin-top: -80px;
  padding-top: calc(2rem + 80px);
}

.api-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.api-subtitle {
  font-size: 1.25rem;
  opacity: 0.9;
  margin-bottom: 0;
}

.api-section {
  background: var(--surface-color);
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

.api-section h3 {
  color: var(--primary-color);
  font-weight: 700;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.endpoint {
  background: var(--surface-color);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}

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

.method-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.method-get {
  background: #10b981;
  color: white;
}

.method-post {
  background: #f59e0b;
  color: white;
}

.endpoint-path {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-color);
}

/* Code and Pre */
code,
pre {
  background: var(--background-color);
  border-radius: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  border: 1px solid var(--border-color);
}

pre {
  padding: 1rem;
  margin: 1rem 0;
  overflow-x: auto;
}

/* Tables */
table {
  border-collapse: collapse;
  margin-top: 1rem;
  width: 100%;
  background: var(--surface-color);
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

th,
td {
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  text-align: left;
}

th {
  background: var(--background-color);
  font-weight: 600;
  color: var(--text-primary);
}

/* Footer */
.footer {
  background: var(--surface-color);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--primary-color);
}

/* Legacy styles for compatibility */
.item-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  text-align: center;
}

.item-sku {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  text-align: center;
}

.random-btn {
  margin-top: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.random-btn:hover {
  background: #d97706;
  transform: translateY(-1px);
}

.fullwidth-btn {
  display: block;
  width: 100%;
  max-width: 900px;
  margin: 0 auto 2rem auto;
  box-sizing: border-box;
  text-align: left;
  padding: 1rem;
  background: var(--primary-color);
  color: #fff;
  border-radius: 0.75rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.2s ease;
  border: none;
  box-shadow: var(--shadow-md);
}

.fullwidth-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding-top: 70px;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .error-title {
    font-size: 4rem;
  }

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

  .hero-section,
  .error-section {
    padding: 1rem 0;
  }

  .api-header {
    margin-top: -70px;
    padding-top: calc(2rem + 70px);
  }

  .chart-frame {
    height: 300px;
  }

  .api-section,
  .endpoint,
  .feature-card {
    padding: 1rem;
  }
}

@media (max-width: 600px) {
  .endpoint {
    padding: 1rem 0.5rem;
  }

  .chart-frame {
    width: 98vw;
    height: 220px;
  }
}

@media (max-width: 800px) {
  .chart-frame {
    width: 98vw;
    height: 220px;
  }
}
