/* DATAGRIS CYBERSECURITY — Global Styles & Design System */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  /* OKLCH Color Space Palette */
  --accent: #ff4757;
  --accent-hover: #e63e4d;
  --accent-rgb: 255, 71, 87;
  
  /* Brand Dark Mode (Obsidian Cyber) */
  --bg-body: oklch(0.12 0.012 250);     /* #09090e */
  --bg-card: oklch(0.16 0.018 250 / 0.55); /* Glass card base */
  --bg-sidebar: oklch(0.14 0.015 250 / 0.85); /* Sidebar base */
  
  --border: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.12);
  --border-active: rgba(255, 71, 87, 0.3);
  
  --text: oklch(0.92 0.008 250);        /* #e8e8f0 */
  --text-dim: oklch(0.72 0.015 250);    /* #9a9ab0 */
  --text-muted: oklch(0.55 0.020 250);  /* #6a6a85 */
  
  --input-bg: rgba(255, 255, 255, 0.02);
  --input-border: rgba(255, 255, 255, 0.07);
  --input-text: oklch(0.92 0.008 250);
  
  --scroll-track: rgba(0, 0, 0, 0.2);
  --scroll-thumb: rgba(255, 255, 255, 0.08);
  --badge-bg: rgba(255, 255, 255, 0.03);
  --card-glow: rgba(255, 71, 87, 0.05);
  
  --sidebar-w: 240px;
  --content-max: 1560px;
}

[data-theme="light"] {
  /* Brand Light Mode (Sleek Clean) */
  --bg-body: oklch(0.96 0.005 250);     /* #f4f4f7 */
  --bg-card: oklch(1.00 0.000 0 / 0.75);
  --bg-sidebar: oklch(0.98 0.005 250 / 0.9);
  
  --border: rgba(0, 0, 0, 0.06);
  --border-light: rgba(0, 0, 0, 0.1);
  --border-active: rgba(214, 48, 49, 0.25);
  
  --text: oklch(0.18 0.012 250);        /* #1a1a2e */
  --text-dim: oklch(0.45 0.015 250);    /* #5a5a7a */
  --text-muted: oklch(0.65 0.015 250);  /* #9999b0 */
  
  --input-bg: rgba(0, 0, 0, 0.02);
  --input-border: rgba(0, 0, 0, 0.08);
  --input-text: oklch(0.18 0.012 250);
  
  --scroll-track: rgba(0, 0, 0, 0.04);
  --scroll-thumb: rgba(0, 0, 0, 0.1);
  --badge-bg: rgba(0, 0, 0, 0.03);
  --card-glow: rgba(255, 71, 87, 0.03);
  
  --accent: #d63031;
  --accent-hover: #c0392b;
}

/* === Ambient Tech Overlay === */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  opacity: 0.6;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.015) 2px,
    rgba(0, 0, 0, 0.015) 4px
  );
  opacity: 0.7;
}

/* === General Typography & Reset === */
body {
  background-color: var(--bg-body);
  color: var(--text);
  font-family: 'Outfit', 'Fira Sans', system-ui, -apple-system, sans-serif;
  transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 100dvh;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  overflow-x: hidden;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.skip-link:focus { transform: translateY(0); }

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', 'Fira Code', monospace;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

code, .font-mono {
  font-family: 'Fira Code', Consolas, Monaco, monospace;
  font-size: 0.9em;
}

/* === Modern Scrollbars === */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--scroll-track);
}
::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 71, 87, 0.2);
}

/* === Glassmorphic Cards === */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 16px;
  position: relative;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.05); /* Specular top border highlight */
}

[data-theme="light"] .card {
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.03),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
}

.card-hover:hover {
  border-color: var(--border-active);
  box-shadow: 
    0 12px 30px rgba(0, 0, 0, 0.3),
    0 0 20px var(--card-glow),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

/* === Custom Form Inputs & Buttons === */
input, select, textarea {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  padding: 10px 16px;
  color: var(--input-text);
  width: 100%;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  background: rgba(255, 71, 87, 0.02);
  box-shadow: 
    0 0 0 4px rgba(255, 71, 87, 0.15),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.03);
}

button, .btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  font-family: inherit;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s ease, border-color 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(255, 71, 87, 0.15);
}

button:hover, .btn:hover {
  transform: translateY(-1.5px) scale(1.01);
  box-shadow: 
    0 8px 24px rgba(255, 71, 87, 0.3),
    0 0 12px rgba(255, 71, 87, 0.2);
}

button:active, .btn:active {
  transform: translateY(0.5px);
}

/* === Sidebar Navigation === */
.sidebar {
  background: var(--bg-sidebar);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-right: 1px solid var(--border) !important;
  width: var(--sidebar-w);
  height: 100vh;
  height: 100dvh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
  padding-bottom: env(safe-area-inset-bottom, 8px);
}

.nav-link {
  padding: 11px 16px;
  border-radius: 10px;
  color: var(--text-dim);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 71, 87, 0.05);
  transform: translateX(4px);
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(255, 71, 87, 0.1) 0%, rgba(255, 71, 87, 0.01) 100%);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

.nav-link svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.nav-link:hover svg {
  transform: scale(1.1);
}

.theme-btn {
  padding: 11px 16px;
  border-radius: 10px;
  color: var(--text-dim);
  background: transparent;
  border: none;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.2s;
}

.theme-btn:hover {
  background: rgba(255, 71, 87, 0.05);
  color: var(--accent);
}

.theme-btn svg {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-btn:hover svg {
  transform: rotate(180deg);
}

/* === Content Area Layout === */
.content-area {
  margin-left: var(--sidebar-w);
  padding: 32px;
  max-width: calc(var(--content-max) + var(--sidebar-w));
  min-width: 0;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* === Badges & Signals === */
.badge {
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  background: var(--badge-bg);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.severity-critical {
  color: #ff4757;
  text-shadow: 0 0 10px rgba(255, 71, 87, 0.3);
  font-weight: 700;
}
.severity-high {
  color: #ff6b35;
  text-shadow: 0 0 10px rgba(255, 107, 53, 0.3);
  font-weight: 700;
}
.severity-medium {
  color: #f1c40f;
  text-shadow: 0 0 10px rgba(241, 196, 15, 0.3);
}
.severity-low {
  color: #3498db;
  text-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

/* === Focus Visible Accessibility === */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* === Responsive Layout Adjustments === */
.hamburger {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 60;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  color: var(--text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
}

.hamburger:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 45;
  transition: opacity 0.3s;
}

.sidebar-overlay.show {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .hamburger {
    display: flex;
  }
  .content-area {
    margin-left: 0;
    padding: 80px 16px 32px 16px;
  }
  .sidebar { overflow-y: auto; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  .card { border-radius: 12px; }
}
@media (max-width: 480px) {
  .content-area { padding: 76px 10px 20px 10px; }
  input, select, textarea { font-size: 16px; padding: 10px 12px; }
  button, .btn { font-size: 13px; padding: 10px 18px; }
  .badge { font-size: 10px; padding: 3px 10px; }
  .grid { gap: 10px; }
  th, td { padding: 8px 10px; font-size: 12px; }
}

/* === Shimmer Loading Skeleton === */
.skeleton {
  background: linear-gradient(90deg, var(--badge-bg) 25%, rgba(255, 255, 255, 0.05) 50%, var(--badge-bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === Tables === */
.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-top: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 12px 16px;
  color: var(--text-dim);
  font-family: 'Space Grotesk', monospace;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.01);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}

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

/* ---- plan lock icons ---- */
.nav-link svg.nav-lock-icon {
  width: 13px !important;
  height: 13px !important;
  margin-left: auto;
  opacity: 0.65;
  flex-shrink: 0;
}
.nav-link:hover svg.nav-lock-icon {
  transform: none;
  opacity: 1;
}
