/**
 * ATX Middleware - Main Stylesheet
 * Enterprise-grade styling for ACC to XECM integration
 */

:root {
  --primary: #0066cc;
  --primary-dark: #004d99;
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --bg: #f8f9fa;
  --card-bg: #ffffff;
  --text: #333333;
  --text-muted: #6c757d;
  --border: #dee2e6;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.15);
  --radius: 8px;
  --transition: all 0.2s ease;
}

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

body {
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding: 2rem;
  min-height: 100vh;
}

/* Container */
.container {
  max-width: 900px;
  margin: 0 auto;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}

h1 {
  color: var(--primary);
  font-size: 2rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

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

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #d4edda;
  color: var(--success);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

/* Status Indicators */
.status-ok {
  color: var(--success);
}

.status-error {
  color: var(--danger);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.status-icon {
  font-size: 0.75rem;
}

/* Overview Card */
.overview-card {
  margin-bottom: 2rem;
  background: linear-gradient(135deg, var(--card-bg) 0%, #f0f7ff 100%);
  border-left: 4px solid var(--primary);
}

.overview-card h2 {
  color: var(--primary);
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0.75rem;
}

.overview-text {
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.feature {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--card-bg);
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.feature:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.feature-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.feature div {
  display: flex;
  flex-direction: column;
}

.feature strong {
  font-size: 0.875rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.feature span:not(.feature-icon) {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Tech Stack Badges */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.tech-badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: #e7f0fa;
  border-radius: 20px;
  border: 1px solid #cce0f5;
  transition: var(--transition);
}

.tech-badge:hover {
  background: var(--primary);
  color: white;
}

/* Cards Grid */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Card */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

.card h2 {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

/* Info Rows */
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.info-value {
  font-weight: 500;
  font-size: 0.9rem;
}

/* Endpoints List */
.endpoints {
  list-style: none;
}

.endpoints li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.endpoints li:last-child {
  border-bottom: none;
}

.endpoint-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.endpoint-path {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 0.8rem;
  background: #e9ecef;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  color: var(--primary);
}

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

.endpoint-path a:hover {
  text-decoration: underline;
}

/* HTTP Method Badges */
.method {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  margin-right: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.method-get {
  background: #d4edda;
  color: #155724;
}

.method-post {
  background: #cce5ff;
  color: #004085;
}

.method-put {
  background: #fff3cd;
  color: #856404;
}

.method-delete {
  background: #f8d7da;
  color: #721c24;
}

/* Footer */
footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  padding-top: 1.5rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border);
}

.footer-links {
  margin-top: 0.75rem;
}

.footer-links a {
  color: var(--primary);
  text-decoration: none;
  margin: 0 0.75rem;
  font-size: 0.85rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 600px) {
  body {
    padding: 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .endpoints li {
    flex-direction: column;
    align-items: flex-start;
  }

  .endpoint-path {
    margin-top: 0.25rem;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .overview-text {
    font-size: 0.9rem;
  }

  .tech-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }
}
