:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.25);
  --primary-hover: #4f46e5;
  --secondary: #06b6d4;
  --accent: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  --glass: backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.1) 0%, transparent 40%);
  min-height: 100vh;
}

/* App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
  box-shadow: 0 0 15px var(--primary-glow);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #fff, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* App Layout with Left Sidebar */
.app-layout {
  display: flex;
  min-height: calc(100vh - 72px);
  width: 100%;
}

/* Sidebar Stepper (Left Vertical Navigation) */
.sidebar-stepper {
  width: 270px;
  min-width: 270px;
  max-width: 270px;
  background: rgba(11, 15, 25, 0.94);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0.85rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
  z-index: 90;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding: 0 0.5rem 0.75rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.sidebar-counter {
  font-size: 0.7rem;
  font-family: 'Fira Code', monospace;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.stepper-nav {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0;
  background: transparent;
  border: none;
  overflow: visible;
  width: 100%;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-muted);
  font-size: 0.83rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  user-select: none;
  position: relative;
}

.step-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateX(3px);
}

.step-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(6, 182, 212, 0.2));
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.step-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18%;
  height: 64%;
  width: 3.5px;
  border-radius: 0 4px 4px 0;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

/* Presence / Absence Sub Tabs */
.sub-nav-tabs {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  width: fit-content;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active.presence {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid #10b981;
  color: #34d399;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.tab-btn.active.absence {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(245, 158, 11, 0.2));
  border: 1px solid #ef4444;
  color: #f87171;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}


.step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.step-item.active .step-number {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
}

/* Main Container */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 2rem 2.5rem;
  max-width: 1400px;
}

@media (max-width: 992px) {
  .app-layout {
    flex-direction: column;
  }
  .sidebar-stepper {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
  }
  .sidebar-header {
    display: none;
  }
  .stepper-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem 0.45rem;
  }
  .step-item {
    width: auto;
    padding: 0.35rem 0.65rem;
    font-size: 0.76rem;
    border-radius: var(--radius-full);
  }
  .step-item.active::before {
    display: none;
  }
  .step-number {
    width: 20px;
    height: 20px;
    font-size: 0.68rem;
  }
  .main-content {
    padding: 1.5rem 1rem;
  }
}

/* Cards & Panels */
.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.panel-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
}

.panel-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #059669);
  color: #fff;
}

.btn-accent:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

/* Inputs & Form */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Dropzone */
.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

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

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

.modern-table th {
  background: rgba(0, 0, 0, 0.4);
  padding: 0.85rem 1rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.modern-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

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

.modern-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

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

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

.badge-info {
  background: rgba(6, 182, 212, 0.15);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

/* Fiss 2011 Table Symbols */
.fiss-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-weight: bold;
}

.fiss-core-present {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
  display: inline-block;
}

.fiss-contrib-present {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
}

.fiss-core-absent {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #ef4444;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ef4444;
  font-size: 11px;
  font-weight: 900;
}

.fiss-contrib-absent {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #ef4444;
  display: inline-block;
}

/* Educational Info Box */
.info-box {
  background: rgba(99, 102, 241, 0.08);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: #c7d2fe;
}

.info-box h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Grid helper */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

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

/* Venn Diagram Styles */
.venn-region-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.venn-region-card:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.venn-svg-circle {
  transition: fill-opacity 0.3s ease, stroke-width 0.3s ease;
  cursor: pointer;
}

.venn-svg-circle:hover {
  fill-opacity: 0.55 !important;
  stroke-width: 3.5px !important;
}

/* ==============================================================================
   Gemini AI Evaluation Styles (Steps 6 & 7)
   ============================================================================== */
.ai-eval-panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(30, 27, 75, 0.45) 0%, rgba(17, 24, 39, 0.85) 100%);
  border: 1px solid rgba(168, 85, 247, 0.3) !important;
  box-shadow: 0 4px 20px rgba(126, 34, 206, 0.15);
}

.ai-eval-panel:hover {
  border-color: rgba(168, 85, 247, 0.5) !important;
}

.ai-chip-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.ai-chip-btn:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: #a855f7;
  color: #fff;
  transform: translateY(-1px);
}

.ai-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(168, 85, 247, 0.2);
  border-top-color: #c084fc;
  border-radius: 50%;
  animation: ai-spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes ai-spin {
  to { transform: rotate(360deg); }
}

.ai-content-view {
  color: #e2e8f0;
}

.ai-content-view p {
  margin-bottom: 0.85rem;
  line-height: 1.7;
}

.ai-content-view h2, .ai-content-view h3, .ai-content-view h4 {
  color: #f3e8ff;
  font-weight: 700;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.ai-content-view ul, .ai-content-view ol {
  margin-left: 1.25rem;
  margin-bottom: 0.85rem;
}

.ai-content-view li {
  margin-bottom: 0.35rem;
}

.ai-content-view strong, .ai-content-view b {
  color: #fff;
}

.btn-ai-primary {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #fff;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
  border: none;
}

.btn-ai-primary:hover {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.5);
  transform: translateY(-1px);
  color: #fff;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

/* Print CSS */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
    background-image: none !important;
  }
  .app-header, .steps-nav, .sub-nav-tabs, .portal-back-btn, .btn, .ai-prompt-container, .header-actions, .ai-chip-btn {
    display: none !important;
  }
  .glass-panel {
    background: transparent !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    color: #000 !important;
    page-break-inside: avoid;
  }
  .modern-table {
    border-collapse: collapse !important;
    width: 100% !important;
  }
  .modern-table th, .modern-table td {
    border: 1px solid #333 !important;
    color: #000 !important;
    background: transparent !important;
  }
  .ai-content-view {
    color: #000 !important;
  }
}


