
* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --bg: #f8fbff;
  --surface: #ffffff;
  --surface-soft: #f1f5fb;
  --surface-strong: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e5e7eb;
  --accent: #008343;
  --accent-soft: #dbeafe;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: radial-gradient(circle at top left, #eff6ff 0%, #f8fafc 40%, #ffffff 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  padding-top: 80px;
  transition: background 0.35s ease, color 0.35s ease;
}

.dark {
  color-scheme: dark;
  --bg: #020917;
  --surface: #111827;
  --surface-soft: #1f2937;
  --surface-strong: #334155;
  --text: #f8fafc;
  --text-muted: #a5b4fc;
  --border: #334155;
  --accent: #60a5fa;
  --accent-soft: #1d4ed8;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  background: radial-gradient(circle at top left, rgba(96, 165, 250, 0.12), transparent 30%), #020617;
}

.site-header {
  position:absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  z-index: 1000;
  display: flex;
  align-items: right;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.dark .site-header {
  background: rgba(15, 23, 42, 0.94);
}

.contact-box {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-self: center;
}

.contact-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9em;
  text-align: center;
  align-self: center;
}
.site-title {
  color: var(--accent);
  font-size: 1.6em;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.03em;
  text-align: center;
  align-self: center;
}

.site-nav-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  margin: 0 12px;
}

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1em;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.dark .theme-toggle {
  background: #1f2937;
  color: #ffffff;
  border-color: #475569;
}


/* Grid Layout */
.grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
  padding: 20px;
}

/* Card Styling */
.card {
  background: var(--card-bg, var(--surface));
  border: 1px solid #e5e7eb;
  padding: 24px 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 150px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.card h2 {
  margin: 0;
  font-size: 1.3em;
  color: #1e3a8a;
  font-weight: 700;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  border-color: #3b82f6;
}

/* Suggestions */
.suggestions {
  max-width: 600px;
  margin: 10px auto;
  text-align: left;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 100;
}

.suggestion {
  background: white;
  padding: 14px 18px;
  border-bottom: 1px solid #e5e7eb;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  color: #1f2937;
}

.suggestion:last-child {
  border-bottom: none;
}

.suggestion:hover {
  background-color: #f0f4ff;
  color: #3b82f6;
  font-weight: 500;
}

/* Logo */
.logo {
  width: 200px;
  height: 200px;
  object-fit: contain;
  margin: 20px auto;
  padding: 20px;
  background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 45px rgba(96, 165, 250, 0.12);
}

.logo-fallback {
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 2px dashed var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text-muted);
  padding: 20px;
  line-height: 1.4;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45);
}

.hero {
  max-width: 1200px;
  margin: 60px auto;
  padding: 60px 20px;
  text-align: center;
  background: radial-gradient(circle at top, rgba(59, 130, 246, 0.18), transparent 42%), var(--surface);
  border-radius: 28px;
  margin-bottom: 40px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.dark .hero {
  background: radial-gradient(circle at top, rgba(96, 165, 250, 0.12), transparent 40%), var(--surface);
}

.hero h1 {
  font-size: clamp(2.6rem, 4vw, 3.4rem);
  margin: 0 0 16px 0;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.hero p {
  font-size: 1.1em;
  color: var(--text-muted);
  margin: 0 0 30px 0;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

input {
  width: 100%;
  max-width: 600px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: var(--surface);
  color: var(--text);
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

input::placeholder {
  color: var(--text-muted);
}

.button-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.button-group .btn {
  width: 100%;
}

/* Page Layout */
.page {
  max-width: 1000px;
  margin: 60px auto;
  padding: 40px 24px;
  text-align: center;
  background: linear-gradient(180deg, var(--surface-soft) 0, var(--surface) 220px);
  border-radius: 28px;
  border: 1px solid var(--border);
}

.dark .page {
  background: linear-gradient(180deg, var(--surface-soft) 0, var(--surface) 220px);
}

.team-page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  max-width: 1380px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

.team-page-body {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  gap: 24px;
}

.team-page-body > * {
  width: 100%;
}

.logo-preview-container {
  width: 100%;
  border-radius: 28px;
  padding: 18px;
  background: var(--surface-soft);
  transition: background 0.3s ease;
}

.dark .logo-preview-container {
  background: #111827;
}

.preview-actions-panel {
  width: 100%;
  background: var(--surface);
  border-radius: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.dark .preview-actions-panel {
  background: #111827;
}

.page .info-box,
.page .former-logos-section,
.page .logo-preview-container,
.page .preview-actions-panel {
  width: 100%;
}

.info-box {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: 22px;
  margin: 20px auto;
  text-align: left;
  color: var(--text);
  line-height: 1.75;
  box-shadow: var(--shadow);
}

.info-box.status-box {
  background: linear-gradient(180deg, var(--surface-soft), var(--surface));
}

.merger-tree {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.merger-node {
  display: grid;
  gap: 4px;
  padding: 14px 9px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.merger-children {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-left: 16px;
  border-left: 2px solid var(--border);
}

.merger-node strong,
.merger-node span {
  display: block;
}

.merger-node.current {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.08);
}

.merger-tree .node-label {
  font-weight: 700;
}

.team-card {
  display: block;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 18px;
  margin: 12px 0;
  border-radius: 18px;
  cursor: pointer;
  text-align: left;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  color: var(--text);
  font-weight: 500;
}

.team-card:hover {
  transform: translateX(6px);
  box-shadow: 0 16px 40px rgba(59, 130, 246, 0.16);
  border-color: var(--accent);
}

.team-card strong {
  display: inline-block;
  font-size: 1.05em;
}

.team-card .team-status {
  display: inline-flex;
  margin-left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.76em;
  font-weight: 700;
}

.card {
  transition: all 0.35s ease;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 10px auto;
  padding: 12px 22px;
  background: linear-gradient(135deg, var(--accent), #1d4ed8);
  color: #ffffff;
  text-decoration: none;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.18);
  font-weight: 700;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.dark .btn {
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
}

.dark .card,
.dark .info-box,
.dark .team-card,
.dark .suggestions,
.dark .logo-fallback {
  background: #111827;
  color: #e2e8f0;
  border-color: #334155;
}

.dark input {
  background: #111827;
  border-color: #334155;
  color: #e2e8f0;
}

.dark .site-nav-link,
.dark .theme-toggle {
  color: #e2e8f0;
}

.dark .hero {
  background: radial-gradient(circle at top, rgba(96, 165, 250, 0.16), transparent 42%), #111827;
}

.dark .suggestion:hover {
  background-color: #1f2937;
}

.dark .team-card:hover {
  background: #1f2937;
}

.dark .logo {
  background: radial-gradient(135deg, rgba(96, 165, 250, 0.08), rgba(96, 165, 250, 0.02));
}

.dark .logo-fallback {
  background: #111827;
  color: #cbd5e1;
}

.team-list-filter {
  width: 100%;
  margin-bottom: 12px;
  padding: 10px 12px;
  font-size: 14px;
}


.team-list {
  display: grid;
  gap: 8px;
}

.team-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  color: #1f2937;
  text-decoration: none;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.team-list-item.active,
.team-list-item:hover {
  border-color: #3b82f6;
  background: #f8f9ff;
}

.team-list-item strong,
.team-list-item small {
  display: block;
}

.team-list-item small {
  margin-top: 2px;
  color: #6b7280;
  font-size: 0.78em;
}

.team-list-meta,
.team-list-colors {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.team-list-status {
  padding: 2px 6px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 0.7em;
  font-weight: 700;
}

.team-list-empty {
  padding: 12px;
  color: #6b7280;
  text-align: center;
}

.team-content {
  min-width: 0;
}

.page h1 {
  color: #1e3a8a;
  font-size: 2.5em;
  margin: 0 0 20px 0;
  font-weight: 700;
}

.page h3 {
  color: #475569;
  font-size: 1.1em;
  margin: 20px 0 10px 0;
  font-weight: 600;
}

@media (max-width: 900px) {
  .team-page-layout {
    grid-template-columns: 1fr;
    padding: 14px;
  }
}

/* Search Country */
.search-country {
  margin: 28px auto;
  max-width: 500px;
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: var(--surface);
  color: var(--text);
}

.search-country:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.search-country::placeholder {
  color: var(--text-muted);
}

.former-logos-section {
  margin: 40px 0;
  background: var(--surface);
}

.former-logos-section h3 {
  text-align: center;
  color: var(--accent);
  margin: 30px 0 20px 0;
}

.table-wrapper {
    overflow-x: auto;
}

.former-logos-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  margin-left: auto;
  margin-right: auto;
}

.former-logos-table th {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  padding: 16px;
  text-align: left;
  border-bottom: 2px solid #1e3a8a;
  color: white;
  font-weight: 600;
}

.former-logos-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.former-logos-table tr:last-child td {
  border-bottom: none;
}

.former-logos-table tr:hover {
  background-color: var(--surface-soft);
}

.former-logo {
  height: 100px;
  width: auto;
  object-fit: contain;
  padding: 10px;
  background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
  border-radius: 6px;
}

.dark .search-country,
.dark .former-logos-section,
.dark .former-logos-table,
.dark .former-logo {
  background: #111827;
  color: #e2e8f0;
  border-color: #334155;
}
