/* ====================================================================
   SERVICES.CSS – OpenSovereign Services Page
   Merged styles from skills-capacity-matrix + services-portfolio-matrix
   Tab navigation, skills table, capacity cards, layer diagram,
   certifications, partner badges, roles
   ==================================================================== */

/* ====== PAGE SECTION ====== */

.services-page {
  padding: 100px 0 0;
  border-top: 1px solid var(--border-subtle);
}

.services-page .container {
  padding-top: 0;
}

/* ====== LOCAL TOKENS (page-specific) ====== */

:root {
  --bg-card: #151515;
  --bg-hover: #1a1a1a;
  --text: #E8EAED;
  --text-dim: #6F6F6F;
  --expert: #FF3131;
  --advanced: #AE0202;
  --basic: #474747;
  --empty: #1a1a1a;
  --check: #4ADE80;
  --gap-red: #FF6B6B;
  --gap-bg: rgba(255, 107, 107, 0.08);
  --border: #474747;
  --accent-dim: rgba(255, 49, 49, 0.15);

  /* Company colors (services-specific; differ from base partner palette) */
  --puzzle: #AE0202;
  --adfinis: #ff6b35;
  --cloudscale: #c4314b;
  --cyberlink: #8b1a1a;
  --vshn: #FF3131;
}

/* ====== TAB NAVIGATION ====== */

.nav-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.nav-tab {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-tab:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-tab.active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

/* ====== SECTIONS (tab panels) ====== */

.section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.section.active {
  display: block;
}

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

/* ====== SECTION HEADINGS (page-local) ====== */

.services-page h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.services-page h2 .accent {
  color: var(--color-accent);
}

.services-page h3 {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 1rem;
  color: var(--text-dim);
}

.tab-subtitle {
  font-size: 15px;
  color: var(--text-gray);
  margin-top: -8px;
  margin-bottom: 32px;
  line-height: 1.6;
}

/* ====================================================================
   TAB 1: SKILLS MATRIX
   ==================================================================== */

/* Legend */
.legend {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.legend-dot {
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

.legend-dot.expert { background: var(--expert); }
.legend-dot.advanced { background: var(--advanced); }
.legend-dot.basic { background: var(--basic); }
.legend-dot.empty { background: var(--empty); border: 1px solid var(--border); }

/* Skills Table */
.skills-table-wrapper {
  overflow-x: auto;
  margin-bottom: 2rem;
}

.skills-table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed; /* equal width for all partner columns */
  border-collapse: separate;
  border-spacing: 3px;
  font-size: 1rem;
}

.skills-table th {
  background: var(--bg-card);
  color: var(--color-accent);
  padding: 0.9rem 1rem;
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
  border-radius: var(--radius-sm);
}

.skills-table th:first-child {
  text-align: left;
  color: var(--text);
  width: 290px;
}

.skills-table td {
  padding: 0.75rem 1rem;
  text-align: center;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: default;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
}

.skills-table td:first-child {
  text-align: left;
  background: var(--bg-card);
  color: var(--text);
  font-weight: 500;
}

/* Group header rows (Infrastruktur, Plattform, ...) */
.skills-table tr.skills-group th {
  background: none;
  color: var(--text-gray-light);
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 1.6rem 1rem 0.4rem;
}

.skills-table tbody tr.skills-group:first-child th {
  padding-top: 0.8rem;
}

.skills-table td.expert {
  background: var(--expert);
  color: #fff;
  font-weight: 700;
}

.skills-table td.advanced {
  background: var(--advanced);
  color: #fff;
}

.skills-table td.basic {
  background: var(--basic);
  color: #ccc;
}

.skills-table td.empty-cell {
  background: var(--empty);
  color: #555;
}

/* Keep the competency column in view while scrolling sideways */
@media (max-width: 900px) {
  .skills-table th:first-child,
  .skills-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
  }

  .skills-table th:first-child {
    width: 180px;
  }

  .skills-table tr.skills-group th {
    position: static;
  }
}

.skills-table td:not(:first-child):hover {
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(255, 49, 49, 0.3);
  z-index: 10;
}

/* Tooltip */
.tooltip-container {
  position: relative;
}

.tooltip-container .tooltip {
  display: none;
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-dark);
  border: 1px solid var(--color-accent);
  color: var(--text);
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 400;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.tooltip-container .tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--color-accent);
}

.tooltip-container:hover .tooltip {
  display: block;
}

/* ====================================================================
   TAB 2: CAPACITY & LOCATIONS
   ==================================================================== */

.total-bar {
  background: var(--bg-card);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.total-bar .label {
  font-size: 1.1rem;
  font-weight: 500;
}

.total-bar .total-number {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--color-accent);
}

.capacity-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.capacity-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  border: 1px solid var(--border);
}

.capacity-card .company-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: var(--text);
}

.capacity-card .hq {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.capacity-bar-bg {
  background: var(--empty);
  border-radius: var(--radius-sm);
  height: 22px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.capacity-bar-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  transition: width 1s ease;
}

.capacity-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: 0.2rem;
}

.capacity-label {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.capacity-meta {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: left;
}

.capacity-meta div {
  margin-bottom: 0.3rem;
}

.capacity-meta strong {
  color: var(--text);
}

/* ====================================================================
   TAB 3: COMPLEMENTARITY (Layer Diagram)
   ==================================================================== */

.layer-diagram {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 2rem;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.layer {
  display: flex;
  align-items: stretch;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 4px;
}

.layer-label {
  min-width: 260px;
  padding: 1.2rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.layer-label .layer-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.layer-label .layer-sub {
  font-size: 0.8rem;
  font-weight: 400;
  opacity: 0.8;
  color: #fff;
}

.layer-content {
  flex: 1;
  padding: 1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  background: rgba(0, 0, 0, 0.15);
}

.layer-chip {
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

.layer-1 .layer-label { background: #FF3131; }
.layer-1 .layer-content { background: rgba(255, 49, 49, 0.1); }
.layer-2 .layer-label { background: #AE0202; }
.layer-2 .layer-content { background: rgba(174, 2, 2, 0.1); }
.layer-3 .layer-label { background: #A78BFA; }
.layer-3 .layer-content { background: rgba(167, 139, 250, 0.1); }
.layer-4 .layer-label { background: #F59E0B; }
.layer-4 .layer-content { background: rgba(245, 158, 11, 0.1); }

/* ====================================================================
   TAB 5: CERTIFICATIONS
   ==================================================================== */

.cert-table-wrapper {
  overflow-x: auto;
  margin-bottom: 2rem;
}

.cert-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 3px;
  font-size: 1rem;
}

.cert-table th {
  background: var(--bg-card);
  padding: 0.9rem 1rem;
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  color: var(--color-accent);
}

.cert-table th:first-child {
  text-align: left;
  color: var(--text);
  min-width: 260px;
}

.cert-table td {
  padding: 0.75rem 1rem;
  text-align: center;
  border-radius: 6px;
  background: var(--bg-card);
  font-size: 0.95rem;
}

.cert-table td:first-child {
  text-align: left;
  font-weight: 500;
  color: var(--text);
}

.cert-check {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
}

.cert-detail {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: block;
  margin-top: 2px;
}

.cert-empty {
  color: #3A3A3A;
  font-size: 1.2rem;
}

.cert-note {
  margin-top: 1rem;
  padding: 0.8rem 1.2rem;
  background: var(--accent-dim);
  border-left: 3px solid var(--color-accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* ====================================================================
   TAB 6: PARTNER STATUS
   ==================================================================== */

.partner-table-wrapper {
  overflow-x: auto;
  margin-bottom: 2rem;
}

.partner-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 3px;
  font-size: 0.95rem;
}

.partner-table th {
  background: var(--bg-card);
  padding: 0.8rem 1rem;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  color: var(--color-accent);
}

.partner-table th:first-child {
  text-align: left;
  color: var(--text);
  min-width: 220px;
}

.partner-table td {
  padding: 0.6rem 0.8rem;
  text-align: center;
  border-radius: 6px;
  background: var(--bg-card);
}

.partner-table td:first-child {
  text-align: left;
  font-weight: 500;
  color: var(--text);
}

.partner-badge {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-premier { background: rgba(255, 255, 255, 0.1); color: #fff; border: 1px solid rgba(255, 255, 255, 0.2); }
.badge-diamond { background: rgba(255, 255, 255, 0.1); color: #fff; border: 1px solid rgba(255, 255, 255, 0.2); }
.badge-advanced { background: rgba(255, 255, 255, 0.1); color: #fff; border: 1px solid rgba(255, 255, 255, 0.2); }
.badge-partner { background: rgba(255, 255, 255, 0.1); color: #fff; border: 1px solid rgba(255, 255, 255, 0.2); }
.badge-verified { background: rgba(255, 255, 255, 0.1); color: #fff; border: 1px solid rgba(255, 255, 255, 0.2); }
.badge-first { background: rgba(255, 255, 255, 0.1); color: #fff; border: 1px solid rgba(255, 255, 255, 0.2); }

.partner-empty {
  color: #3A3A3A;
  font-size: 1rem;
}

/* ====================================================================
   RESPONSIVE
   ==================================================================== */

@media (max-width: 1200px) {
  .capacity-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .capacity-grid {
    grid-template-columns: 1fr;
  }

  .total-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1.25rem 1.5rem;
  }

  .total-bar .total-number {
    font-size: 1.8rem;
  }
}
