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

:root {
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-tertiary: #1a1a1a;
  --accent-red: #8b0000;
  --accent-red-bright: #cc0000;
  --text-primary: #c0c0c0;
  --text-bright: #ffffff;
  --text-dim: #666666;
}

body {
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Boot Screen */
.boot-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.boot-container {
  padding: 2rem;
  max-width: 600px;
}

.boot-line {
  color: #00ff00;
  margin-bottom: 0.5rem;
  opacity: 0;
  animation: fadeIn 0.3s forwards;
}

.boot-line.typing::after {
  content: '';
  animation: blink 0.5s infinite;
}

.cursor {
  color: #00ff00;
  animation: blink 0.5s infinite;
}

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

@keyframes blink {
  50% { opacity: 0; }
}

/* Overlay Effects */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.1) 0px,
    rgba(0, 0, 0, 0.1) 1px,
    transparent 1px,
    transparent 2px
  );
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.6) 100%);
}

/* Watching Eye */
.watching-eye {
  position: fixed;
  font-size: 2rem;
  transform: translate(-50%, -50%);
  z-index: 998;
  opacity: 0.3;
  animation: fadeInOut 2s ease-in-out;
  pointer-events: none;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.5; }
}

/* App Container */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Header */
.main-header {
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--accent-red);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.menu-toggle {
  background: none;
  border: 1px solid var(--text-dim);
  color: var(--text-primary);
  padding: 0.5rem;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.2s;
}

.menu-toggle:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.logo {
  display: flex;
  flex-direction: column;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-bright);
  letter-spacing: 0.3em;
}

.logo-subtitle {
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.2em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-red-bright);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.clearance-badge {
  background: var(--bg-tertiary);
  border: 1px solid var(--accent-red);
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.clearance-badge:hover {
  background: var(--accent-red);
  color: var(--text-bright);
}

.timestamp {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Main Content Layout */
.main-content {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* Sidebar */
.sidebar {
  width: 250px;
  background: var(--bg-secondary);
  border-right: 1px solid #333;
  padding: 1rem;
  transition: all 0.3s;
  overflow-y: auto;
}

.sidebar.closed {
  width: 0;
  padding: 0;
  overflow: hidden;
}

.nav-item {
  padding: 0.8rem 1rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 2px solid transparent;
}

.nav-item:hover {
  background: var(--bg-tertiary);
  border-left-color: var(--accent-red);
  color: var(--text-bright);
  text-shadow: 0 0 10px var(--accent-red);
}

.nav-item.restricted {
  color: var(--text-dim);
}

.nav-section {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #333;
}

.section-header {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
  letter-spacing: 0.1em;
}

.filter-btn {
  padding: 0.4rem 0.8rem;
  margin: 0.3rem 0;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.filter-btn:hover, .filter-btn.active {
  background: var(--bg-tertiary);
}

.filter-btn.safe.active { color: #2d5a27; }
.filter-btn.euclid.active { color: #8b6914; }
.filter-btn.keter.active { color: #8b0000; }

.nav-stats {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #333;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.nav-stats div {
  margin-bottom: 0.5rem;
}

.nav-stats .alert-high {
  color: var(--accent-red-bright);
  animation: pulse 1s infinite;
}

/* Content Area */
.content-area {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  background: linear-gradient(135deg, var(--bg-primary) 0%, #0d0d0d 100%);
}

/* Files Grid */
.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* File Card */
.file-card {
  background: var(--bg-tertiary);
  border: 1px solid #333;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

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

.file-card:hover::before {
  transform: scaleX(1);
}

.file-card:hover {
  border-color: var(--accent-red);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(139, 0, 0, 0.3);
}

.file-card.locked {
  opacity: 0.6;
  cursor: not-allowed;
}

.file-card.viewed {
  border-left: 3px solid #2d5a27;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.scp-number {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--text-bright);
}

.lock-icon {
  font-size: 1.2rem;
}

.card-name {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  min-height: 1.5em;
}

.card-class {
  font-size: 0.8rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.card-stamp {
  font-family: 'Special Elite', cursive;
  font-size: 0.7rem;
  color: var(--accent-red);
  text-transform: uppercase;
  border: 1px solid var(--accent-red);
  padding: 0.2rem 0.5rem;
  display: inline-block;
  transform: rotate(-3deg);
  margin-top: 0.5rem;
}

/* Document View */
.document-view {
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg-tertiary);
  padding: 2rem;
  position: relative;
  border: 1px solid #333;
}

.document-view.glitch {
  animation: glitch 0.15s;
}

@keyframes glitch {
  0%, 100% { transform: translate(0); filter: none; }
  20% { transform: translate(-2px, 2px); filter: hue-rotate(90deg); }
  40% { transform: translate(2px, -2px); filter: hue-rotate(-90deg); }
  60% { transform: translate(-1px, -1px); }
  80% { transform: translate(1px, 1px); }
}

.classified-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 6rem;
  color: rgba(139, 0, 0, 0.1);
  pointer-events: none;
  font-weight: bold;
  letter-spacing: 0.3em;
  white-space: nowrap;
}

.back-btn {
  background: none;
  border: 1px solid var(--text-dim);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  cursor: pointer;
  margin-bottom: 1.5rem;
  transition: all 0.2s;
}

.back-btn:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.document-header {
  border-bottom: 2px solid var(--accent-red);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.document-header h1 {
  font-size: 1.8rem;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}

.object-class {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border: 2px solid;
  font-size: 0.9rem;
}

.document-section {
  margin-bottom: 2rem;
}

.document-section h3 {
  color: var(--text-bright);
  margin-bottom: 1rem;
  font-size: 1.1rem;
  border-left: 3px solid var(--accent-red);
  padding-left: 0.8rem;
}

.document-section p {
  line-height: 1.8;
  white-space: pre-wrap;
}

.document-section.addendum {
  background: rgba(139, 0, 0, 0.1);
  padding: 1rem;
  border-left: 3px solid var(--accent-red);
}

.redaction {
  background: #000;
  color: #000;
  padding: 0 2px;
  cursor: pointer;
  transition: all 0.3s;
  user-select: none;
}

.redaction:hover {
  background: #222;
}

.redaction.revealed {
  background: var(--accent-red);
  color: var(--text-bright);
}

.document-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #333;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* Access Denied Full */
.access-denied-full {
  text-align: center;
  padding: 4rem 2rem;
}

.denied-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.access-denied-full h2 {
  font-size: 2rem;
  color: var(--accent-red);
  margin-bottom: 1rem;
}

.access-denied-full p {
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

/* Search Terminal */
.search-terminal {
  max-width: 700px;
  margin: 0 auto;
  background: #000;
  border: 1px solid #333;
  padding: 1.5rem;
}

.terminal-header {
  color: #00ff00;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.terminal-input {
  display: flex;
  align-items: center;
  background: #111;
  padding: 0.8rem;
  margin-bottom: 1rem;
}

.prompt {
  color: #00ff00;
  margin-right: 0.5rem;
}

.terminal-input input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  flex: 1;
  outline: none;
}

.cursor-blink {
  color: #00ff00;
  animation: blink 0.7s infinite;
}

.search-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--accent-red);
  color: var(--accent-red);
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.search-btn:hover {
  background: var(--accent-red);
  color: var(--text-bright);
}

.search-results {
  margin-top: 1.5rem;
}

.results-header {
  color: #00ff00;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.result-item {
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 2px solid transparent;
}

.result-item:hover {
  background: var(--bg-tertiary);
  border-left-color: var(--accent-red);
}

.no-results {
  color: var(--accent-red);
  margin-top: 1rem;
  padding: 1rem;
  border: 1px dashed var(--accent-red);
}

/* Warning Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  animation: fadeIn 0.3s;
}

.warning-modal {
  background: var(--bg-secondary);
  border: 3px solid var(--accent-red);
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  text-align: center;
  animation: shake 0.5s;
}

.warning-modal.breach {
  border-color: #ff0000;
  box-shadow: 0 0 50px rgba(255, 0, 0, 0.5);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.warning-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.3rem;
  color: var(--accent-red-bright);
  margin-bottom: 1rem;
}

.warning-icon {
  font-size: 2rem;
  animation: pulse 0.5s infinite;
}

.warning-content {
  white-space: pre-wrap;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.acknowledge-btn {
  background: var(--accent-red);
  border: none;
  color: var(--text-bright);
  padding: 0.8rem 2rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s;
}

.acknowledge-btn:hover {
  background: var(--accent-red-bright);
}

/* Code Modal */
.code-modal {
  background: var(--bg-secondary);
  border: 2px solid var(--text-dim);
  padding: 2rem;
  text-align: center;
}

.code-modal h3 {
  margin-bottom: 1rem;
  color: var(--text-bright);
}

.code-modal input {
  background: #000;
  border: 1px solid var(--text-dim);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1.2rem;
  padding: 0.8rem;
  text-align: center;
  width: 100%;
  margin-bottom: 1rem;
  letter-spacing: 0.3em;
}

.code-modal input:focus {
  outline: none;
  border-color: var(--accent-red);
}

.code-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.code-buttons button {
  background: var(--bg-tertiary);
  border: 1px solid var(--text-dim);
  color: var(--text-primary);
  padding: 0.5rem 1.5rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.code-buttons button:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* Footer */
.main-footer {
  background: var(--bg-secondary);
  border-top: 1px solid #333;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer-left {
  display: flex;
  gap: 2rem;
}

.ip-address {
  color: var(--text-dim);
}

.breach-link {
  color: var(--accent-red);
  text-decoration: none;
  transition: all 0.2s;
}

.breach-link:hover {
  color: var(--accent-red-bright);
  text-shadow: 0 0 10px var(--accent-red);
}

/* History View */
.history-view {
  max-width: 900px;
  margin: 0 auto;
  background: var(--bg-tertiary);
  padding: 2rem;
  position: relative;
  border: 1px solid #333;
}

.history-timeline {
  position: relative;
  padding-left: 2rem;
  border-left: 2px solid var(--accent-red);
}

.timeline-entry {
  position: relative;
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.timeline-entry::before {
  content: '';
  position: absolute;
  left: -2.35rem;
  top: 0.3rem;
  width: 12px;
  height: 12px;
  background: var(--accent-red);
  border-radius: 50%;
  border: 2px solid var(--bg-tertiary);
}

.timeline-year {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--accent-red);
  margin-bottom: 0.3rem;
}

.timeline-event {
  color: var(--text-primary);
  line-height: 1.6;
}

/* Personnel View */
.personnel-view {
  max-width: 1000px;
  margin: 0 auto;
  background: var(--bg-tertiary);
  padding: 2rem;
  position: relative;
  border: 1px solid #333;
}

.personnel-filters {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.filter-group label {
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

.filter-group select {
  background: #000;
  border: 1px solid var(--text-dim);
  color: var(--text-primary);
  font-family: inherit;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.filter-group select:focus {
  outline: none;
  border-color: var(--accent-red);
}

.personnel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.personnel-card {
  background: var(--bg-secondary);
  border: 1px solid #333;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.personnel-card:hover {
  border-color: var(--accent-red);
  transform: translateY(-2px);
}

.personnel-card.selected {
  border-color: var(--accent-red);
  box-shadow: 0 0 15px rgba(139, 0, 0, 0.3);
}

.personnel-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.personnel-id {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.personnel-clearance {
  font-weight: bold;
  font-size: 0.9rem;
}

.personnel-name {
  font-size: 1rem;
  color: var(--text-bright);
  margin-bottom: 0.3rem;
}

.personnel-job {
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.personnel-dept {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.personnel-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.personnel-details {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #333;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.personnel-details div {
  margin-bottom: 0.3rem;
}

.personnel-summary {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .main-header {
    padding: 0.8rem;
  }

  .logo-text {
    font-size: 1rem;
    letter-spacing: 0.1em;
  }

  .logo-subtitle {
    display: none;
  }

  .header-right {
    font-size: 0.7rem;
  }

  .connection-status {
    display: none;
  }

  .sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    z-index: 99;
    width: 250px;
  }

  .sidebar.closed {
    transform: translateX(-100%);
    width: 250px;
    padding: 1rem;
  }

  .content-area {
    padding: 1rem;
  }

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

  .document-view {
    padding: 1rem;
  }

  .classified-watermark {
    font-size: 3rem;
  }

  .main-footer {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .footer-left {
    flex-direction: column;
    gap: 0.3rem;
  }
}

@media (max-width: 480px) {
  .file-card {
    padding: 1rem;
  }

  .scp-number {
    font-size: 1.1rem;
  }

  .warning-modal {
    padding: 1.5rem;
  }

  .warning-header {
    font-size: 1rem;
  }
}