/* ==========================================================================
   SYSTEM PROTOCOL DESIGN SYSTEM - STYLESHEET
   Neo-Brutalist Modern-Industrial Terminal Aesthetic
   ========================================================================== */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Archivo+Narrow:ital,wght@0,400..700;1,400..700&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:ital,wght@0,300..800;1,300..800&display=swap');

:root {
  /* Color Palette - System Protocol */
  --bg-color: #F5F5F3;
  --surface-color: #FAF9F6;
  --surface-container: #EEEEEB;
  --surface-dark: #1A1C1A;
  --surface-inverse: #2F312F;
  --text-main: #1A1C1A;
  --text-muted: #454555;
  --text-inverse: #F1F1EE;
  
  /* Brand Accents */
  --primary-blue: #1E1EC8;
  --primary-blue-dark: #07009D;
  --primary-blue-light: #A2A6FF;
  --secondary-orange: #FF8C00;
  --secondary-orange-bright: #FD8B00;
  
  /* System Lines & Shadows */
  --border-black: #1A1C1A;
  --border-grid: rgba(0, 0, 0, 0.06);
  --shadow-brutal: 3px 3px 0px 0px #1A1C1A;
  --shadow-brutal-sm: 2px 2px 0px 0px #1A1C1A;
  --shadow-brutal-blue: 3px 3px 0px 0px #1E1EC8;
  --shadow-brutal-orange: 3px 3px 0px 0px #FF8C00;
  
  /* Typography Variables */
  --font-display: 'Archivo Narrow', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-color);
  background-image: 
    linear-gradient(to right, var(--border-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border-grid) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background-color: var(--primary-blue);
  color: #ffffff;
}

/* Typography Utility Classes */
.font-display { font-family: var(--font-display); }
.font-mono { font-family: var(--font-mono); }
.font-body { font-family: var(--font-body); }

/* Neo-Brutalist Structural Components */
.neo-border {
  border: 1px solid var(--border-black);
}

.neo-border-thick {
  border: 2px solid var(--border-black);
}

.neo-border-heavy {
  border: 3px solid var(--border-black);
}

.neo-shadow {
  box-shadow: var(--shadow-brutal);
}

.neo-shadow-sm {
  box-shadow: var(--shadow-brutal-sm);
}

.neo-shadow-blue {
  box-shadow: var(--shadow-brutal-blue);
}

.neo-shadow-orange {
  box-shadow: var(--shadow-brutal-orange);
}

.section-divider {
  border-bottom: 1px solid var(--border-black);
}

.marker-highlight {
  background-color: var(--secondary-orange);
  color: #ffffff;
  padding: 0.1rem 0.4rem;
  font-family: var(--font-mono);
  font-weight: 600;
  display: inline-block;
}

.marker-highlight-blue {
  background-color: var(--primary-blue);
  color: #ffffff;
  padding: 0.1rem 0.4rem;
  font-family: var(--font-mono);
  font-weight: 600;
  display: inline-block;
}

/* Terminal Cursor Pulse */
.terminal-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background-color: var(--text-main);
  vertical-align: -0.15em;
  animation: blink 1s step-end infinite;
}

.terminal-cursor-blue {
  background-color: var(--primary-blue);
}

.terminal-cursor-orange {
  background-color: var(--secondary-orange);
}

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

/* Buttons & Interactive Elements */
.btn-brutal {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.75rem 1.25rem;
  background-color: var(--surface-color);
  color: var(--text-main);
  border: 1px solid var(--border-black);
  box-shadow: var(--shadow-brutal);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  text-decoration: none;
  user-select: none;
}

.btn-brutal:hover {
  background-color: var(--primary-blue);
  color: #ffffff;
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0px 0px var(--border-black);
}

.btn-brutal:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px 0px var(--border-black);
}

.btn-brutal-orange {
  background-color: var(--secondary-orange);
  color: #ffffff;
}

.btn-brutal-orange:hover {
  background-color: var(--border-black);
  color: #ffffff;
}

.btn-brutal-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

/* CLI Quick Command Active State */
.cli-quick-cmd.active {
  background-color: var(--primary-blue) !important;
  color: #ffffff !important;
  box-shadow: 3px 3px 0px 0px var(--border-black) !important;
}

.cli-quick-cmd.btn-brutal-orange.active {
  background-color: var(--secondary-orange) !important;
  color: #ffffff !important;
  box-shadow: 3px 3px 0px 0px var(--border-black) !important;
}

/* Filter Tag Pills */
.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
  background-color: var(--surface-color);
  border: 1px solid var(--border-black);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn:hover, .filter-btn.active {
  background-color: var(--primary-blue);
  color: #ffffff;
  box-shadow: var(--shadow-brutal-sm);
}

/* Image Grayscale Hover Effect */
.img-brutal-frame {
  position: relative;
  border: 3px solid var(--primary-blue);
  padding: 4px;
  background-color: #ffffff;
}

.img-brutal-frame img {
  width: 100%;
  height: auto;
  display: block;
  filter: grayscale(100%);
  transition: filter 0.3s ease;
  border: 1px solid var(--border-black);
}

.img-brutal-frame:hover img {
  filter: grayscale(0%);
}

/* Card Hover States */
.card-brutal {
  background-color: var(--surface-color);
  border: 1px solid var(--border-black);
  box-shadow: var(--shadow-brutal-sm);
  transition: all 0.2s ease;
  overflow: hidden;
}

.card-brutal:hover {
  box-shadow: var(--shadow-brutal);
  transform: translateY(-3px);
}

/* Interactive Terminal Section */
.cli-window {
  background-color: #0F1110;
  color: #00FF66;
  font-family: var(--font-mono);
  border: 2px solid var(--border-black);
  box-shadow: var(--shadow-brutal);
}

.cli-header {
  background-color: var(--border-black);
  color: #ffffff;
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.cli-body {
  padding: 1.25rem;
  min-height: 280px;
  max-height: 420px;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.5;
}

.cli-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(255, 255, 255, 0.05);
  padding: 0.5rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cli-input {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  width: 100%;
}

/* Mobile Drawer Overlay */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 320px;
  height: 100vh;
  background-color: var(--surface-color);
  border-left: 2px solid var(--border-black);
  z-index: 100;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 2rem 1.5rem;
  box-shadow: -5px 0px 20px rgba(0,0,0,0.15);
}

.mobile-drawer.open {
  right: 0;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0,0,0,0.5);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Modal Popup Styles */
.modal-wrapper {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-wrapper.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: var(--surface-color);
  border: 2px solid var(--border-black);
  box-shadow: 8px 8px 0px 0px var(--border-black);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
}

/* Custom Scrollbar for Terminal & Body */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--surface-container);
}

::-webkit-scrollbar-thumb {
  background: var(--border-black);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-blue);
}

/* Responsive Enhancements for Mobile, Tablet, Desktop */
@media (max-width: 640px) {
  html {
    font-size: 15px;
  }
  
  .btn-brutal {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .cli-input-wrapper {
    flex-wrap: wrap;
  }

  #cli-send-btn {
    width: 100%;
    justify-content: center;
    margin-top: 4px;
    min-height: 40px;
  }

  .cli-body {
    min-height: 240px;
    max-height: 350px;
    font-size: 0.8rem;
  }

  .img-brutal-frame {
    max-width: 280px;
    margin: 0 auto;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .btn-brutal {
    min-height: 44px;
  }
}

/* Print Utility */
@media print {
  body {
    background: none;
    color: #000000;
  }
  .cli-window, nav, footer {
    display: none;
  }
}
