/* ==========================================
   VARIABLES & DESIGN SYSTEM
   ========================================== */
:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent-color: #FA582D; /* Palo Alto Networks Cyber Orange */
  --accent-gradient: linear-gradient(135deg, #FA582D 0%, #FF8A50 100%);
  --accent-glow: rgba(250, 88, 45, 0.06);
  --radius-lg: 12px;
  --radius-md: 8px;
  --transition-smooth: all 0.2s ease;
}

body.dark-mode {
  --bg-main: #0b0f19;
  --bg-card: #1e293b;
  --border-color: #334155;
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent-glow: rgba(250, 88, 45, 0.15);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg-main); color: var(--text-primary); font-family: 'Inter', sans-serif; font-size: 14px; overflow-x: hidden; }

.app-container { display: flex; flex-direction: column; min-height: 100vh; padding: 10px; gap: 10px; height: 100vh; }

/* HEADER */
.app-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 20px; background: var(--bg-card); border-radius: var(--radius-lg);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05); border: 1px solid var(--border-color);
  flex-shrink: 0;
}
.header-logo-section { display: flex; align-items: center; gap: 12px; }
.header-logo-icon { width: 32px; height: 32px; }
.header-titles h1 { font-size: 18px; font-weight: 700; background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.header-titles .subtitle { font-size: 11px; color: var(--text-secondary); }

/* FILTERS */
.horizontal-filters {
  background: var(--bg-card); padding: 12px 20px; border-radius: var(--radius-lg);
  border: 1px solid var(--border-color); display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end;
  flex-shrink: 0;
}
.filter-item { display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.filter-item label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.filter-item input[type="text"], .filter-item select {
  padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border-color); background: rgba(0,0,0,0.03); color: inherit;
}
.filter-item.range-item { min-width: 160px; }
.range-val { font-size: 11px; color: var(--accent-color); float: right; }

.checkbox-group-horizontal { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.custom-cb { display: flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; }

.btn-reset {
  padding: 8px 16px; background: var(--bg-main); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); color: var(--text-secondary); font-weight: 600; cursor: pointer;
  transition: var(--transition-smooth);
}
.btn-reset:hover { background: var(--accent-glow); border-color: var(--accent-color); color: var(--accent-color); }

/* TABLE */
.main-content { 
  overflow: auto; background: var(--bg-card); border-radius: var(--radius-lg); border: 1px solid var(--border-color);
  flex-grow: 1; position: relative;
}

/* Custom Scrollbar Always Visible */
.main-content::-webkit-scrollbar { width: 12px; height: 12px; }
.main-content::-webkit-scrollbar-track { background: var(--bg-main); }
.main-content::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; border: 3px solid var(--bg-card); }
body.dark-mode .main-content::-webkit-scrollbar-thumb { background: #475569; border-color: var(--bg-card); }

.comparison-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.comparison-table td { padding: 12px 15px; border-right: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); text-align: center; }

/* Sticky Top Row (Model Names) */
.comparison-table tr:first-child td {
  position: sticky; top: 0; z-index: 100; background: var(--bg-card);
  font-weight: 700; box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Sticky Left Column (Labels) */
.spec-lbl { 
  text-align: left !important; font-weight: 600; color: var(--text-secondary); background: var(--bg-main) !important;
  position: sticky; left: 0; z-index: 90; min-width: 160px;
}

/* Intersection Sticky */
.comparison-table tr:first-child td:first-child { z-index: 110; }

.table-section-row td { background: var(--accent-glow); font-weight: 700; text-transform: uppercase; font-size: 11px; color: var(--accent-color); text-align: left !important; }

.model-header-cell { display: flex; align-items: center; gap: 8px; justify-content: center; cursor: pointer; }
.model-details-trigger { font-weight: 700; color: var(--accent-color); cursor: pointer; transition: var(--transition-smooth); }
.model-details-trigger:hover { text-decoration: underline; filter: brightness(1.2); }

.selected-col { background: rgba(250, 88, 45, 0.04); }

/* MODAL */
.modal-backdrop {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); display: none;
  justify-content: center; align-items: center; z-index: 1000;
}
.modal-backdrop.show { display: flex; }
.modal-content {
  background: var(--bg-card); padding: 30px; border-radius: var(--radius-lg);
  max-width: 650px; width: 90%; max-height: 90vh; overflow-y: auto; position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}
.close-modal { position: absolute; top: 15px; right: 20px; cursor: pointer; font-size: 28px; color: var(--text-muted); }
.datasheet-link {
  display: inline-block; margin-top: 10px; padding: 12px 24px;
  background: var(--accent-gradient); color: white; border-radius: 8px; text-decoration: none; font-weight: 700;
}

/* TOOLTIP ABOUT */
.about-container { position: relative; display: inline-block; }
.about-trigger { font-size: 12px; color: var(--text-muted); text-decoration: underline; cursor: help; }
.about-tooltip {
  visibility: hidden; width: 280px; background: var(--bg-card); border: 1px solid var(--border-color);
  padding: 12px; border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  position: absolute; right: 0; top: 100%; margin-top: 10px; z-index: 1000;
  font-size: 12px; line-height: 1.4; opacity: 0; transition: opacity 0.2s ease;
}
.about-container:hover .about-tooltip { visibility: visible; opacity: 1; }
body.dark-mode .about-tooltip { background: #1e293b; box-shadow: 0 10px 25px rgba(0,0,0,0.5); }

/* COMPARE BAR */
.compare-bar {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--accent-color); color: white; padding: 10px 24px; border-radius: 30px;
  display: none; align-items: center; gap: 15px; box-shadow: 0 10px 30px rgba(250, 88, 45, 0.25); z-index: 500;
}
.compare-bar.show { display: flex; }
.btn-open-compare { background: white; color: var(--accent-color); border: none; padding: 6px 18px; border-radius: 20px; font-weight: 700; cursor: pointer; }

/* Zebra striping for table rows */
.comparison-table tr:nth-child(even):not(.table-section-row) td {
  background-color: #f8fafc;
}
.comparison-table tr:nth-child(even):not(.table-section-row) td.spec-lbl {
  background-color: #f1f5f9 !important;
}

body.dark-mode .comparison-table tr:nth-child(even):not(.table-section-row) td {
  background-color: #162032;
}
body.dark-mode .comparison-table tr:nth-child(even):not(.table-section-row) td.spec-lbl {
  background-color: #0f172a !important;
}

/* Series/Gamme Badge Styling */
.series-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.series-pa-400 { background-color: #0ea5e9; }  /* sky blue */
.series-pa-500 { background-color: #8b5cf6; }  /* purple */
.series-pa-1400 { background-color: #3b82f6; } /* indigo */
.series-pa-3400 { background-color: #fa582d; } /* palo orange */

/* Gamme horizontal filter checkbox colors */
#series-checkboxes label[data-series="PA-400"] { color: #0ea5e9; font-weight: 600; }
#series-checkboxes label[data-series="PA-500"] { color: #8b5cf6; font-weight: 600; }
#series-checkboxes label[data-series="PA-1400"] { color: #3b82f6; font-weight: 600; }
#series-checkboxes label[data-series="PA-3400"] { color: #fa582d; font-weight: 600; }

/* Table Row Hover Highlight */
.comparison-table tr:hover td {
  background-color: rgba(250, 88, 45, 0.05) !important;
}
body.dark-mode .comparison-table tr:hover td {
  background-color: rgba(250, 88, 45, 0.12) !important;
}

/* Table Column Hover Highlight */
.hover-col {
  background-color: rgba(250, 88, 45, 0.03) !important;
}
body.dark-mode .hover-col {
  background-color: rgba(250, 88, 45, 0.08) !important;
}
