/* styles.css */

/* Import a modern, highly readable font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
  /* Color palette */
  --color-bg: #f5f7fa;
  --color-surface: #ffffff;
  --color-primary: #2f80ed;
  --color-primary-hover: #1366d6;
  --color-text: #333f4b;
  --color-text-light: #6b7a8f;
  --color-border: #e0e6ed;
  --color-shadow: rgba(0, 0, 0, 0.05);

  /* Spacing scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* Reset & base */
* {
  box-sizing: border-box;
}
html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  font-family: 'Inter', sans-serif;
  color: var(--color-text);
  line-height: 1.5;
}
h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--color-primary);
}

/* Container */
#controls {
  margin-bottom: var(--space-md);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* Buttons */
#controls button {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  box-shadow: 0 2px 4px var(--color-shadow);
}
#controls button:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}
#controls button:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px var(--color-shadow);
}

/* File input (hidden) */
#file-input {
  display: none;
}

/* Table container styling */
#network-table {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 8px var(--color-shadow);
}

/* Tabulator overrides */
.tabulator {
  border: none !important;
  font-family: inherit;
}

/* Header styling – updated for solid primary color + white text */
.tabulator .tabulator-header .tabulator-col {
  background: var(--color-primary) !important;
  color: #fff !important;
  font-weight: 500;
  border-right: 1px solid var(--color-primary-hover) !important;
}
.tabulator .tabulator-header .tabulator-col:last-child {
  border-right: none !important;
}

/* Row styling */
.tabulator .tabulator-row:not(.tabulator-selectable):nth-child(even) {
  background: var(--color-bg);
}
.tabulator .tabulator-row .tabulator-cell {
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-sm) var(--space-md);
}
.tabulator .tabulator-row:hover .tabulator-cell {
  background: var(--color-bg);
}

/* Cell editing */
.tabulator .tabulator-editing {
  background: #fff8e1 !important;
}

/* Footer / pagination (if used) */
.tabulator .tabulator-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

/* Responsive tweaks */
@media (max-width: 600px) {
  #controls {
    flex-direction: column;
  }
  #controls button {
    width: 100%;
  }
}

/* ————————————————————————————————
   Filter‐field styling (inputs & selects in the header)
   ———————————————————————————————— */
.tabulator .tabulator-header-filter {
  /* allow absolutely positioned pseudo‐elements if you want */
  position: relative;
}

.tabulator .tabulator-header-filter input,
.tabulator .tabulator-header-filter select {
  /* light filter‐specific background */
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  /* make room for the icon */
  padding: var(--space-xs) var(--space-sm) var(--space-xs) calc(var(--space-md) + 12px);
  /* funnel icon via SVG data‐URI */
  background-image: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='%236b7a8f' d='M6 10.667V16L10 13.333v-2.666L16 4H0z'/></svg>");
  background-repeat: no-repeat;
  background-position: var(--space-sm) center;
  background-size: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tabulator .tabulator-header-filter input:focus,
.tabulator .tabulator-header-filter select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(47, 128, 237, 0.2);
}

.tabulator .tabulator-header-filter input,
.tabulator .tabulator-header-filter select {
  padding: var(--space-xs) var(--space-xs) var(--space-xs) calc(var(--space-lg) + var(--space-sm)) !important;
}

/* 1. Darker table “canvas” behind all rows */
#network-table .tabulator-tableholder {
  background-color: #e0e0e0; /* darker gray */
}

/* 2. Zebra-striping on every row */
#network-table .tabulator-row:nth-child(odd) .tabulator-cell {
  background-color: #ffffff !important; /* white */
}
#network-table .tabulator-row:nth-child(even) .tabulator-cell {
  background-color: #f0f0f0 !important; /* light gray */
}

/* Override the inline height on the #network-table container */
#network-table {
  height: calc(100vh - 13em) !important;
  margin-bottom: var(--space-md);
}

/* Make sure Tabulator’s scroll pane fills that new height */
#network-table .tabulator-tableholder {
  height: 100% !important;
}

body { font-family: Arial, sans-serif; margin: 20px; }
#controls { margin-bottom: 10px; }
.dropdown { position: relative; display: inline-block; }
.dropdown-content { display: none; position: absolute; background: #fff; min-width: 160px; box-shadow: 0 8px 16px rgba(0,0,0,0.2); border-radius: 4px; z-index: 1; }
.dropdown-content button { background: none; color: #333; padding: 8px 16px; text-align: left; width: 100%; border: none; cursor: pointer; }
.dropdown-content button:hover { background: #f0f0f0; }
#intro { background: #f9f9f9; padding: 10px; border: 1px solid #ddd; border-radius: 4px; margin-bottom: 10px; }
.toggle-btn { background: none; border: none; cursor: pointer; font-size: 1.2rem; vertical-align: middle; margin-right: 8px; }
.toggle-btn:focus { outline: 2px solid #007BFF; }
#intro-header { display: flex; align-items: center; margin-bottom: 0px; }
#intro-header h2 { margin: 0; font-size: 1rem; font-weight: normal; color: #333; }