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

:root {
  /* Deep Ocean Theme - Dark Mode */
  --background: hsl(220, 30%, 8%);
  --foreground: hsl(210, 20%, 90%);
  --card: hsl(220, 25%, 12%);
  --card-foreground: hsl(210, 20%, 90%);
  --primary: hsl(180, 70%, 50%);
  --primary-foreground: hsl(220, 40%, 10%);
  --secondary: hsl(215, 30%, 20%);
  --secondary-foreground: hsl(210, 20%, 90%);
  --muted: hsl(215, 30%, 15%);
  --muted-foreground: hsl(215, 20%, 60%);
  --accent: hsl(180, 50%, 15%);
  --accent-foreground: hsl(180, 70%, 50%);
  --destructive: hsl(0, 70%, 50%);
  --destructive-foreground: hsl(210, 20%, 90%);
  --border: hsl(215, 30%, 20%);
  --sidebar: hsl(220, 30%, 6%);
  --sidebar-foreground: hsl(210, 20%, 90%);
  --sidebar-primary: hsl(180, 70%, 50%);
  --sidebar-accent: hsl(215, 30%, 15%);
  --sidebar-border: hsl(215, 30%, 20%);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  background-image: url('../images/bg-texture.png');
  background-size: cover;
  background-attachment: fixed;
  background-blend-mode: overlay;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', sans-serif;
  text-transform: uppercase;
  letter-spacing: -0.025em;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

/* Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 16rem;
  background-color: var(--sidebar);
  border-right: 1px solid var(--sidebar-border);
  color: var(--sidebar-foreground);
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo {
  width: 2.5rem;
  height: 2.5rem;
  filter: invert(1);
  opacity: 0.8;
}

.sidebar-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.1em;
}

.sidebar-subtitle {
  font-size: 0.75rem;
  color: var(--sidebar-primary);
  opacity: 0.8;
  letter-spacing: 0.2em;
}

.sidebar-nav {
  padding: 1.5rem 1rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.3s;
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--sidebar-foreground);
  opacity: 0.7;
  letter-spacing: 0.05em;
}

.nav-item:hover {
  background-color: var(--sidebar-accent);
  opacity: 1;
}

.nav-item.active {
  background-color: var(--sidebar-accent);
  color: var(--sidebar-primary);
  border-left: 2px solid var(--sidebar-primary);
  opacity: 1;
}

.nav-icon {
  width: 1rem;
  height: 1rem;
}

.nav-item.active .nav-icon {
  animation: pulse 2s infinite;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--sidebar-border);
  margin-top: auto;
}

.status-panel {
  background-color: rgba(0, 0, 0, 0.3);
  padding: 0.75rem;
  border: 1px solid var(--border);
  font-size: 0.75rem;
}

.status-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.status-label {
  color: var(--muted-foreground);
}

.status-value {
  font-weight: 600;
}

.status-critical {
  color: var(--destructive);
  animation: pulse 2s infinite;
}

.status-active {
  color: var(--primary);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 16rem;
  position: relative;
}

.scanline::before {
  content: " ";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(to bottom, rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
  background-size: 100% 4px;
  z-index: 50;
  pointer-events: none;
}

/* Mobile Menu */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 2000;
  padding: 0.75rem;
  background-color: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--primary);
  cursor: pointer;
  color: var(--primary);
}

.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1500;
}

.mobile-menu-overlay.active {
  display: block;
}

/* Cards */
.card {
  background-color: var(--card);
  border: 1px solid var(--border);
  color: var(--card-foreground);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 0.875rem;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-content {
  padding: 1.5rem;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border: 1px solid var(--primary);
}

.btn-primary:hover {
  opacity: 0.8;
}

.btn-outline {
  background-color: transparent;
  color: var(--foreground);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

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

/* Badge */
.badge {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  border: 1px solid;
  display: inline-block;
}

.badge-critical {
  border-color: var(--destructive);
  color: var(--destructive);
}

.badge-warning {
  border-color: hsl(30, 70%, 50%);
  color: hsl(30, 70%, 50%);
}

/* Grid */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-cols-1 {
  grid-template-columns: 1fr;
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Glitch Effect */
.glitch-text {
  position: relative;
  display: inline-block;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--background);
}

.glitch-text::before {
  left: 2px;
  text-shadow: -1px 0 red;
  clip: rect(24px, 550px, 90px, 0);
  animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
}

.glitch-text::after {
  left: -2px;
  text-shadow: -1px 0 blue;
  clip: rect(85px, 550px, 140px, 0);
  animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
  0% { clip: rect(20px, 9999px, 15px, 0); }
  20% { clip: rect(60px, 9999px, 75px, 0); }
  40% { clip: rect(10px, 9999px, 80px, 0); }
  60% { clip: rect(90px, 9999px, 45px, 0); }
  80% { clip: rect(30px, 9999px, 5px, 0); }
  100% { clip: rect(50px, 9999px, 20px, 0); }
}

@keyframes glitch-anim-2 {
  0% { clip: rect(10px, 9999px, 85px, 0); }
  20% { clip: rect(30px, 9999px, 5px, 0); }
  40% { clip: rect(80px, 9999px, 35px, 0); }
  60% { clip: rect(50px, 9999px, 10px, 0); }
  80% { clip: rect(20px, 9999px, 55px, 0); }
  100% { clip: rect(60px, 9999px, 95px, 0); }
}

/* Redacted */
.redacted {
  background-color: var(--foreground);
  color: transparent;
  padding: 0 0.25rem;
  cursor: help;
  user-select: none;
  transition: all 0.5s;
}

.redacted:hover {
  background-color: transparent;
  color: var(--foreground);
}

/* Animations */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

.animate-fadeIn {
  animation: fadeIn 1s ease-in;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

/* Progress Bar */
.progress-bar {
  height: 0.25rem;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-top: 1rem;
}

.progress-fill {
  height: 100%;
  background-color: var(--primary);
  animation: pulse 2s infinite;
}

/* Separator */
.separator {
  height: 1px;
  background-color: rgba(255, 255, 255, 0.1);
  margin: 3rem 0;
}

/* Utilities */
.text-primary {
  color: var(--primary);
}

.text-muted {
  color: var(--muted-foreground);
}

.text-destructive {
  color: var(--destructive);
}

.text-center {
  text-align: center;
}

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-12 { margin-bottom: 3rem; }

.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

.pt-4 { padding-top: 1rem; }
.pt-6 { padding-top: 1.5rem; }

.pb-2 { padding-bottom: 0.5rem; }
.pb-3 { padding-bottom: 0.75rem; }

.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.space-y-1 > * + * {
  margin-top: 0.25rem;
}

.space-y-4 > * + * {
  margin-top: 1rem;
}

.space-y-6 > * + * {
  margin-top: 1.5rem;
}

.space-y-12 > * + * {
  margin-top: 3rem;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }

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

  .mobile-menu-toggle {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .container {
    padding: 1.5rem 1rem;
  }

  .grid-cols-2,
  .grid-cols-3 {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2rem !important;
  }

  .glitch-text {
    font-size: 2rem !important;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .grid-cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Terminal Logs */
.terminal-log {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--primary);
  opacity: 0.8;
}

.terminal-log:hover {
  opacity: 1;
}

.log-container {
  height: 140px;
  overflow: hidden;
  position: relative;
}

.log-fade {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.9));
}

/* Division Cards */
.division-card {
  position: relative;
  overflow: hidden;
}

.division-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.division-card:hover::before {
  opacity: 1;
}

/* Form Elements */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--secondary);
  border: 1px solid var(--border);
  color: var(--foreground);
  font-family: 'JetBrains Mono', monospace;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 255, 255, 0.1);
}
