/* ==========================================================================
   ELV, Networking & Computer Hardware Malayalam Learning Platform
   Styles: Modern Dark & Light Theme, High-legibility Malayalam Typography
   ========================================================================== */

:root {
  --font-body: 'Noto Sans Malayalam', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-heading: 'Manjari', 'Noto Sans Malayalam', 'Segoe UI', sans-serif;
  --font-mono: 'Fira Code', 'Cascadia Code', Consolas, monospace;

  /* Dark Theme (Default) */
  --bg-primary: #0a0f1d;
  --bg-secondary: #111a2e;
  --bg-surface: #162238;
  --bg-card: #1c2b48;
  --bg-card-hover: #233659;
  --bg-input: #10192b;

  --border-light: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.16);
  --border-highlight: #00d2ff;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-white: #ffffff;

  /* Brand Accents */
  --accent-cyan: #00e5ff;
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-purple: #a855f7;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 12px 32px rgba(0, 229, 255, 0.15);

  --header-height: 72px;
  --sidebar-width: 290px;
}

/* Light Theme Variables */
body.light-theme {
  --bg-primary: #f8fafc;
  --bg-secondary: #edf2f7;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f8fafc;

  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-highlight: #0284c7;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --text-white: #ffffff;

  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 8px 24px rgba(2, 132, 199, 0.12);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
}

p {
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: all 0.2s;
}

a:hover {
  text-decoration: underline;
  color: #38bdf8;
}

code, pre {
  font-family: var(--font-mono);
}

/* Badges & Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-cyan {
  background: rgba(0, 229, 255, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 229, 255, 0.3);
}

.badge-green {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-red {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-purple {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Header */
.app-header {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(0, 210, 255, 0.3);
}

.brand-info h1 {
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.brand-info h1 .highlight {
  background: linear-gradient(120deg, #00e5ff, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.search-box-header {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box-header input {
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
  padding: 8px 14px 8px 36px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-family: var(--font-body);
  width: 260px;
  transition: all 0.25s;
}

.search-box-header input:focus {
  outline: none;
  width: 320px;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15);
}

.search-icon-svg {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  fill: var(--text-dim);
  pointer-events: none;
}

.theme-toggle-btn, .mobile-menu-btn, .print-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s;
}

.theme-toggle-btn:hover, .print-btn:hover, .mobile-menu-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.mobile-menu-btn {
  display: none;
}

/* Layout Wrapper */
.layout-container {
  display: flex;
  flex: 1;
  position: relative;
}

/* Left Sidebar Navigation */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-light);
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-sidebar::-webkit-scrollbar {
  width: 5px;
}

.app-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 4px;
}

.sidebar-category-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.8px;
  padding: 0 10px;
  margin-bottom: 6px;
}

.sidebar-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav-item {
  width: 100%;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-link:hover {
  background: var(--bg-surface);
  color: var(--text-main);
  text-decoration: none;
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.15) 0%, rgba(59, 130, 246, 0.08) 100%);
  color: var(--accent-cyan);
  border-color: rgba(0, 229, 255, 0.3);
}

.nav-link .icon {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
}

.nav-link .title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 32px 40px 60px 40px;
  max-width: 1200px;
  min-width: 0;
}

/* Hero Section */
.page-hero {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.08) 0%, rgba(99, 102, 241, 0.05) 100%);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.page-hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.page-hero h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.page-hero p.lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 850px;
  line-height: 1.8;
}

.quick-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon {
  font-size: 1.8rem;
}

.stat-info h5 {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.stat-info p {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

/* Content Sections */
.tab-section {
  display: none;
}

.tab-section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* Card Styling */
.content-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.content-card:hover {
  border-color: var(--border-medium);
}

.card-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-icon {
  font-size: 1.5rem;
}

.card-title-group h3 {
  font-size: 1.35rem;
  font-weight: 700;
}

.card-title-group h3 small {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: normal;
  display: block;
  margin-top: 2px;
}

/* Info Callout Boxes */
.callout {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin: 20px 0;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 0.95rem;
  line-height: 1.7;
}

.callout .callout-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.callout-info {
  background: rgba(0, 229, 255, 0.08);
  border-left: 4px solid var(--accent-cyan);
  color: var(--text-main);
}

.callout-tip {
  background: rgba(16, 185, 129, 0.08);
  border-left: 4px solid var(--accent-green);
  color: var(--text-main);
}

.callout-warning {
  background: rgba(245, 158, 11, 0.08);
  border-left: 4px solid var(--accent-amber);
  color: var(--text-main);
}

.callout-danger {
  background: rgba(239, 68, 68, 0.08);
  border-left: 4px solid var(--accent-red);
  color: var(--text-main);
}

/* Comparison Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 20px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.data-table th, .data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
}

.data-table th {
  background: var(--bg-card);
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.data-table tr:hover td {
  background: var(--bg-card-hover);
}

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

/* Feature Grid Cards */
.feature-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.feature-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 22px;
  transition: all 0.25s;
}

.feature-box:hover {
  transform: translateY(-3px);
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-hover);
}

.feature-box-icon {
  font-size: 2rem;
  margin-bottom: 14px;
}

.feature-box h4 {
  font-size: 1.15rem;
  margin-bottom: 8px;
  color: var(--text-main);
}

.feature-box p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Step By Step Guide List */
.step-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 20px 0;
}

.step-item {
  display: flex;
  gap: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  align-items: flex-start;
}

.step-number {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d2ff, #0072ff);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.05rem;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 114, 255, 0.3);
}

.step-body h4 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.step-body p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ==========================================================================
   RJ45 PINOUT & WIRE VISUALIZER STYLING
   ========================================================================== */

.pinout-container {
  background: #0b1120;
  border: 2px solid #1e293b;
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 24px 0;
}

.pinout-toggle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #1e293b;
}

.btn-group {
  display: inline-flex;
  background: #111a2e;
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
}

.toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.toggle-btn.active {
  background: var(--accent-cyan);
  color: #050b14;
  box-shadow: 0 2px 8px rgba(0, 229, 255, 0.4);
}

/* RJ45 Modular Plug Graphic */
.rj45-connector-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.rj45-plug-body {
  width: 100%;
  max-width: 680px;
  background: #151f33;
  border: 3px solid #334155;
  border-radius: 14px;
  padding: 24px 20px 20px 20px;
  position: relative;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.5), 0 10px 25px rgba(0,0,0,0.4);
}

.rj45-clip-notch {
  width: 90px;
  height: 22px;
  background: #334155;
  border-radius: 0 0 10px 10px;
  margin: -24px auto 16px auto;
  border: 2px solid #475569;
  border-top: none;
}

.wires-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.wire-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.2s;
}

.wire-column:hover {
  transform: translateY(-4px);
}

.wire-pin-number {
  background: #1e293b;
  border: 1px solid #475569;
  color: #f8fafc;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.gold-pin {
  width: 20px;
  height: 18px;
  background: linear-gradient(180deg, #fef08a 0%, #ca8a04 100%);
  border-radius: 4px 4px 0 0;
  box-shadow: 0 0 6px rgba(250, 204, 21, 0.6);
}

.wire-strand {
  width: 26px;
  height: 160px;
  border-radius: 6px;
  border: 2px solid rgba(0, 0, 0, 0.4);
  box-shadow: inset 2px 0 6px rgba(255,255,255,0.3), 0 4px 8px rgba(0,0,0,0.5);
  position: relative;
}

/* Realistic Wire Color Patterns */
.wire-white-orange {
  background: repeating-linear-gradient(
    -45deg,
    #ffffff,
    #ffffff 8px,
    #ff6600 8px,
    #ff6600 16px
  );
}

.wire-orange {
  background: #ff6600;
}

.wire-white-green {
  background: repeating-linear-gradient(
    -45deg,
    #ffffff,
    #ffffff 8px,
    #10b981 8px,
    #10b981 16px
  );
}

.wire-blue {
  background: #2563eb;
}

.wire-white-blue {
  background: repeating-linear-gradient(
    -45deg,
    #ffffff,
    #ffffff 8px,
    #2563eb 8px,
    #2563eb 16px
  );
}

.wire-green {
  background: #10b981;
}

.wire-white-brown {
  background: repeating-linear-gradient(
    -45deg,
    #ffffff,
    #ffffff 8px,
    #8b4513 8px,
    #8b4513 16px
  );
}

.wire-brown {
  background: #78350f;
}

.wire-label-name {
  font-size: 0.72rem;
  color: #cbd5e1;
  text-align: center;
  font-weight: 700;
  line-height: 1.2;
  min-height: 32px;
}

.wire-signal-tag {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: #0f172a;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

/* Wire Details Interactive Popup / Card */
.pin-detail-box {
  background: #111a2e;
  border: 1px solid #334155;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  width: 100%;
  max-width: 680px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pin-detail-left h5 {
  font-size: 1rem;
  color: var(--accent-cyan);
  margin-bottom: 4px;
}

.pin-detail-left p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* ==========================================================================
   KEYSTONE JACK VISUALIZER
   ========================================================================== */

.keystone-visual-wrapper {
  background: #0f172a;
  border: 2px solid #334155;
  border-radius: var(--radius-lg);
  padding: 26px;
  margin: 20px 0;
}

.keystone-body-block {
  display: flex;
  justify-content: space-around;
  gap: 20px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.keystone-side-column {
  flex: 1;
  min-width: 280px;
  background: #1e293b;
  border: 2px solid #475569;
  border-radius: var(--radius-md);
  padding: 20px;
}

.keystone-side-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #334155;
}

.keystone-slots-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.keystone-slot-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #0f172a;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #334155;
}

.slot-pin-label {
  font-family: var(--font-mono);
  font-weight: 700;
  width: 36px;
  color: var(--text-dim);
}

.slot-color-preview {
  width: 32px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.5);
}

.slot-color-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f1f5f9;
}

/* ==========================================================================
   CCTV STORAGE & BANDWIDTH CALCULATOR
   ========================================================================== */

.calculator-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 24px 0;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-group label small {
  font-weight: normal;
  color: var(--text-muted);
}

.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 10px 14px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: all 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15);
}

.calc-result-box {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.12) 0%, rgba(59, 130, 246, 0.08) 100%);
  border: 2px solid rgba(0, 229, 255, 0.3);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  text-align: center;
}

.result-metric h6 {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.result-metric .value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.result-metric .subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==========================================================================
   COMPUTER HARDWARE WATTAGE & BUILDER TOOL
   ========================================================================== */

.pc-builder-container {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 24px 0;
}

.builder-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

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

.builder-selection-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.builder-summary-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.wattage-gauge {
  text-align: center;
  padding: 20px 0;
}

.wattage-number {
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  line-height: 1;
}

.wattage-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.psu-recommendation {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  color: #34d399;
  font-weight: 700;
}

/* ==========================================================================
   INTERACTIVE QUIZ COMPONENT
   ========================================================================== */

.quiz-container {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 30px;
  margin: 24px 0;
}

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}

.quiz-question-box {
  margin-bottom: 24px;
}

.quiz-q-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.5;
}

.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-option-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  text-align: left;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.quiz-option-btn:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
}

.quiz-option-btn.selected-correct {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #34d399;
}

.quiz-option-btn.selected-wrong {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #f87171;
}

.quiz-explanation {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border-left: 4px solid var(--accent-cyan);
  font-size: 0.9rem;
  display: none;
}

.quiz-nav-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
}

/* General Buttons */
.btn-primary {
  background: linear-gradient(135deg, #00d2ff, #0072ff);
  border: none;
  color: white;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 114, 255, 0.3);
  font-family: var(--font-body);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 114, 255, 0.45);
}

.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-dim);
}

/* ==========================================================================
   GLOSSARY & CHEAT SHEET STYLES
   ========================================================================== */

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.glossary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  transition: all 0.2s;
}

.glossary-card:hover {
  border-color: var(--accent-cyan);
}

.glossary-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.glossary-term {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.glossary-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Technician Cheat Sheet Card */
.cheatsheet-card {
  background: #0f172a;
  border: 2px solid #334155;
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
}

.cheatsheet-title {
  color: var(--accent-cyan);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Responsive & Mobile styles */
@media (max-width: 1024px) {
  .app-sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height);
    bottom: 0;
    z-index: 999;
    transform: translateX(-100%);
    box-shadow: 10px 0 25px rgba(0, 0, 0, 0.5);
  }

  .app-sidebar.mobile-open {
    transform: translateX(0);
  }

  .mobile-menu-btn {
    display: flex;
  }

  .main-content {
    padding: 24px 20px;
  }

  .search-box-header input {
    width: 180px;
  }

  .search-box-header input:focus {
    width: 220px;
  }
}

@media (max-width: 640px) {
  .brand-info p {
    display: none;
  }

  .search-box-header {
    display: none;
  }

  .page-hero {
    padding: 20px;
  }

  .page-hero h2 {
    font-size: 1.5rem;
  }

  .wires-grid {
    gap: 6px;
  }

  .wire-strand {
    width: 20px;
    height: 120px;
  }

  .wire-pin-number {
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
  }

  .wire-label-name {
    font-size: 0.65rem;
  }
}

/* ==========================================================================
   YOUTUBE CHANNEL BUTTON, CARD & FOOTER
   ========================================================================== */

.youtube-btn {
  background: #ff0000;
  color: #ffffff !important;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  text-decoration: none !important;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
  white-space: nowrap;
}

.youtube-btn:hover {
  background: #cc0000;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 0, 0, 0.5);
  color: #ffffff !important;
  text-decoration: none !important;
}

.youtube-icon-svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

.sidebar-channel-card {
  background: linear-gradient(135deg, rgba(255, 0, 0, 0.12) 0%, rgba(220, 38, 38, 0.05) 100%);
  border: 1px solid rgba(255, 0, 0, 0.3);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 16px;
  text-align: center;
}

.sidebar-channel-card .channel-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #ff4d4d;
  background: rgba(255, 0, 0, 0.15);
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.sidebar-channel-card h4 {
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: var(--text-main);
}

.sidebar-channel-card p {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  word-break: break-all;
}

.app-footer {
  border-top: 1px solid var(--border-light);
  background: var(--bg-secondary);
  padding: 28px 24px;
  text-align: center;
  margin-top: 40px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ==========================================================================
   PRINT MEDIA STYLES (For On-site Technician Cheat Sheet)
   ========================================================================== */

@media print {
  body {
    background: white !important;
    color: black !important;
  }

  .app-header, .app-sidebar, .theme-toggle-btn, .print-btn, .mobile-menu-btn, .quiz-nav-actions, .pinout-toggle-bar {
    display: none !important;
  }

  .layout-container {
    display: block !important;
  }

  .main-content {
    padding: 0 !important;
    max-width: 100% !important;
  }

  .tab-section {
    display: none !important;
  }

  #section-cheatsheet {
    display: block !important;
  }

  .cheatsheet-card, .content-card {
    background: white !important;
    border: 1px solid #000 !important;
    color: black !important;
    page-break-inside: avoid;
    box-shadow: none !important;
    margin-bottom: 15px !important;
    padding: 15px !important;
  }

  .cheatsheet-title, h1, h2, h3, h4 {
    color: black !important;
  }

  .data-table th, .data-table td {
    border: 1px solid #333 !important;
    color: black !important;
  }
}
