:root {
  /* Color Palette - Professional Tech/Cyber */
  --bg-body: #f4f6f9;
  --bg-sidebar: #1e293b;
  --bg-card: #ffffff;
  --text-primary: #334155;
  --text-secondary: #64748b;
  --text-sidebar: #cbd5e1;
  --accent: #2563eb; /* Royal Blue */
  --accent-hover: #1d4ed8;

  /* Status Colors */
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --info: #3b82f6;

  /* Spacing */
  --sidebar-width: 280px;
  --header-height: 60px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px; /* Base size for mobile */
}

/* =========================================
   Mobile First Layout (Default)
   ========================================= */

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Sidebar - Mobile: Hidden/Offcanvas by default */
.sidebar {
  position: fixed;
  top: 0;
  left: -100%; /* Hidden */
  width: 280px;
  height: 100vh;
  background-color: var(--bg-sidebar);
  color: var(--text-sidebar);
  z-index: 1000;
  transition: left 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar.active {
  left: 0;
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sidebar-header {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  justify-content: space-between;
}

.close-sidebar-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  display: block; /* Visible on mobile */
}

.logo-icon {
  font-size: 24px;
  color: var(--accent);
}
.brand {
  font-weight: 700;
  color: #fff;
  display: block;
}
.client {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: block;
}

.nav-links {
  list-style: none;
  padding: 10px 0;
  flex: 1;
  overflow-y: auto;
}

.nav-links li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-sidebar);
  text-decoration: none;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.nav-links li a:hover,
.nav-links li a.active {
  background-color: rgba(255, 255, 255, 0.05);
  color: white;
  border-right: 3px solid var(--accent);
}

.sidebar-footer {
  padding: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Main Content - Mobile */
.main-content {
  margin-left: 0;
  width: 100%;
  background-color: var(--bg-body);
  transition: margin 0.3s;
}

/* Header Bar */
.top-bar {
  height: var(--header-height);
  background: white;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 900;
}

.mobile-menu-toggle {
  font-size: 1.2rem;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  margin-right: 10px;
  display: block; /* Visible on mobile */
}

.breadcrumbs {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.85rem;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.actions {
  display: none; /* Hidden on mobile strictly to save space, or simplify */
}

/* Button Styles */
.actions button,
.actions a {
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  margin-left: 10px;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  background: white;
  color: var(--text-primary);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.actions .btn-print:hover {
  background: #f8fafc;
}

.actions .btn-portfolio {
  background: var(--bg-sidebar);
  color: white;
  border: none;
}

.actions .btn-portfolio:hover {
  background: #0f172a;
}

/* Content Area */
.content-wrapper {
  padding: 20px 16px;
  width: 100%;
}

.report-header {
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e2e8f0;
}

.report-header h1 {
  font-size: 1.8rem; /* Smaller for mobile */
  color: #1e293b;
  margin-bottom: 10px;
  line-height: 1.2;
}

.report-header h2 {
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.section-title {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: #0f172a;
  border-left: 4px solid var(--accent);
  padding-left: 12px;
}

.report-section {
  margin-bottom: 60px;
  scroll-margin-top: 70px;
}

/* Grid Systems - Mobile defaults to single column */
.grid-2-col,
.grid-3-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

/* Cards */
.card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
}

/* Highlight Box */
.highlight-box {
  margin-top: 20px;
  background: #f8fafc;
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid var(--warning);
}

.highlight-box li {
  font-size: 0.9rem;
}

/* Findings */
.finding-block {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid #e2e8f0;
  position: relative;
}

.finding-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.badge {
  font-size: 0.75rem;
  padding: 4px 8px;
}

.code-block {
  padding: 12px;
  font-size: 0.8rem;
  overflow-x: auto;
}

/* Tech Stack */
.tech-item {
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.tech-label {
  width: auto;
  font-size: 0.9rem;
}
.tech-val {
  font-size: 0.9rem;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 0;
  margin-left: 10px;
}

/* The vertical line */
.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px; /* Center of the marker (40px/2) */
  width: 2px;
  background: #e2e8f0;
}

.timeline-item {
  margin-bottom: 30px;
  position: relative;
  padding-left: 60px; /* Space for marker */
}

.timeline-marker {
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--accent);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  z-index: 2;
  box-shadow: 0 0 0 4px var(--bg-body); /* Gap effect */
}

.timeline-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
}
.timeline-content h3 {
  color: var(--accent);
  margin-bottom: 8px;
  font-size: 1.1rem;
}

/* Footer */
.report-footer {
  margin-top: 60px;
  padding-top: 30px;
  font-size: 0.85rem;
}

/* =========================================
   Tablet / Desktop (Min-Width: 1024px)
   ========================================= */

@media (min-width: 1024px) {
  /* Layout */
  .app-container {
    flex-direction: row;
  }

  /* Sidebar - Permanent */
  .sidebar {
    position: fixed;
    left: 0;
    width: var(--sidebar-width);
    box-shadow: none;
    height: 100vh;
    z-index: 100;
  }

  .close-sidebar-btn {
    display: none;
  }

  .sidebar-overlay {
    display: none !important;
  }

  /* Main Content */
  .main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
  }

  /* Top Bar */
  .top-bar {
    padding: 0 40px;
  }

  .mobile-menu-toggle {
    display: none;
  }

  .actions {
    display: block; /* Show actions on desktop */
  }

  /* Typography & Spacing */
  .content-wrapper {
    padding: 40px;
  }

  .report-header h1 {
    font-size: 2.5rem;
  }

  .section-title {
    font-size: 1.8rem;
  }

  /* Grids */
  .grid-2-col {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .grid-3-col {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }

  /* Components */
  .finding-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .tech-item {
    flex-direction: row;
    align-items: center;
  }

  .tech-label {
    width: 100px;
  }

  /* Timeline Desktop Adjustments */
  .timeline {
    margin-left: 20px;
  }

  .timeline::before {
    left: 25px; /* Adjust if markers get bigger */
  }

  .timeline-marker {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }

  .timeline-item {
    padding-left: 80px;
  }
}

/* Print Styles - Always Optimized */
@media print {
  .sidebar,
  .mobile-menu-toggle,
  .actions,
  .close-sidebar-btn,
  .sidebar-overlay {
    display: none !important;
  }
  .main-content {
    margin: 0 !important;
    width: 100% !important;
    background: white;
  }
  .top-bar {
    border: none;
    margin-bottom: 20px;
    position: static;
  }
  .app-container {
    display: block;
  }
  body {
    font-size: 12pt;
  }
  .card,
  .finding-block {
    break-inside: avoid;
    border: 1px solid #ddd;
    box-shadow: none;
  }
}
