@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&family=IBM+Plex+Serif:wght@400;700&family=Dancing+Script&display=swap');

:root {
  --win-bg: oklch(18% 0.015 250);
  --win-border-light: oklch(35% 0.02 250);
  --win-border-dark: oklch(5% 0.01 250);
  --win-header-bg: linear-gradient(90deg, oklch(22% 0.06 285), oklch(28% 0.08 285));
  --win-text: oklch(85% 0.01 250);
  --accent-green: oklch(75% 0.18 150);
  --accent-red: oklch(60% 0.2 25);
  --accent-cyan: oklch(70% 0.12 210);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: #050507;
  background-image:
      radial-gradient(oklch(20% 0.01 250) 1px, transparent 1px);
  background-size: 30px 30px;
  color: var(--win-text);
  font-family: 'Space Mono', monospace;
  font-size: 16px;
  overflow-x: hidden;
}

.win-panel {
  background-color: var(--win-bg);
  border: 1px solid var(--win-border-light);
  box-shadow: 10px 10px 0px rgba(0,0,0,0.9);
}

.win-panel-inset {
  background-color: #0c0c0e;
  border: 1px solid #1f2937;
  box-shadow: inset 2px 2px 8px rgba(0,0,0,0.5);
}

.win-header {
  background: var(--win-header-bg);
  color: var(--accent-cyan);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 900;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  user-select: none;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.win-btn {
  background-color: var(--accent-cyan);
  color: #000;
  border: none;
  padding: 8px 20px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Mono', monospace;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  font-size: 0.8rem;
}

.win-btn:hover {
  background-color: oklch(80% 0.15 210);
  transform: translateY(-1px);
  box-shadow: 0 0 20px oklch(70% 0.12 210 / 0.3);
}

.win-btn-dark {
  background-color: #111;
  color: var(--win-text);
  border: 1px solid #333;
  padding: 8px 20px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Mono', monospace;
  transition: all 0.2s;
  font-size: 0.8rem;
}

.win-btn-dark:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.win-btn:active, .win-btn-dark:active {
  transform: translateY(1px);
}

.win-btn:disabled, .win-btn-dark:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.win-control-btn {
  background-color: oklch(75% 0.02 250);
  color: black;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid oklch(5% 0.01 250);
  border-bottom: 1px solid oklch(5% 0.01 250);
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  margin-left: 3px;
}

.text-green { color: var(--accent-green) !important; }
.text-red { color: var(--accent-red) !important; }

/* Scanline effect */
.scanlines::before {
  content: " ";
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
  z-index: 1000;
  background-size: 100% 2px, 3px 100%;
  pointer-events: none;
}

/* Layout Shell */
.desktop-environment {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  box-sizing: border-box;
}

.main-workspace {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 16px;
  align-items: start;
}

/* Sections */
.app-section {
  display: none;
  flex-direction: column;
  gap: 16px;
}
.app-section.active {
  display: flex;
}

.panel-body {
  padding: 16px;
}

/* Slot Components */
.reel-frame {
  display: flex; 
  gap: 8px; 
  padding: 12px; 
  background: oklch(14% 0.01 250);
  box-shadow: inset 2px 2px oklch(5% 0.01 250), inset -1px -1px #333;
  height: 160px;
  border: 2px solid #333;
}

.reel {
  flex: 1; 
  background: oklch(5% 0.01 250); 
  height: 100%;
  overflow: hidden;
  position: relative;
  display: flex;
  justify-content: center;
}

.reel-inner {
  position: absolute;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.reel-inner i {
  height: 160px; /* Matching reel-frame height for perfect centering */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
}

/* Bank/Explorer Components */
.explorer-window {
  display: grid;
  grid-template-columns: 180px 1fr;
  min-height: 300px;
  background: oklch(5% 0.01 250);
  border: 2px solid var(--win-border-light);
}

.explorer-sidebar { 
  background: oklch(18% 0.015 250); 
  border-right: 2px solid var(--win-border-light); 
  padding: 4px; 
  overflow-y: auto; 
}

.sidebar-node {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  user-select: none;
  transition: background 0.1s;
}

.sidebar-node:hover { background: #222; }
.sidebar-node.active { background: oklch(35% 0.1 250); color: #fff; }

.file-view {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 16px;
  overflow-y: auto;
  align-content: start;
}

.file-obj {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  padding: 8px;
  transition: background 0.1s;
}
.file-obj:hover { background: rgba(0, 0, 128, 0.2); outline: 1px dotted #fff; }
.file-obj i { font-size: 2rem; margin-bottom: 4px; color: #888; }
.file-obj span { font-size: 0.7rem; color: #dfdfdf; overflow: hidden; text-overflow: ellipsis; width: 100%; }

/* Document Preview */
.doc-preview-pane {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2000;
  display: none;
  flex-direction: column;
  box-shadow: 0 0 100px oklch(5% 0.01 250 / 0.9);
  width: 95%;
  max-width: 800px;
  height: 90vh;
  max-height: 1000px;
  border: 1px solid var(--win-border-light);
  overflow: hidden;
}

.letter-paper {
  background: oklch(98% 0.005 250);
  flex-grow: 1;
  padding: 40px 60px;
  font-family: "IBM Plex Serif", serif;
  font-size: 15px;
  line-height: 1.7;
  color: oklch(15% 0.01 250);
  overflow-y: auto;
  position: relative;
}

@media (max-width: 768px) {
  .letter-paper {
    padding: 30px 20px;
    font-size: 14px;
  }
}

.letter-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid oklch(15% 0.01 250);
  padding-bottom: 20px;
  margin-bottom: 30px;
}

.corporate-logo {
  font-weight: 900;
  letter-spacing: -1px;
  font-size: 1.2rem;
  text-transform: uppercase;
}

.corporate-details {
  text-align: right;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: oklch(45% 0.01 250);
}

.letter-body {
  min-height: 300px;
}

.signature-block {
  margin-top: 50px;
  border-top: 1px solid oklch(85% 0.01 250);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.signature-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: oklch(45% 0.01 250);
}

.digital-signature {
  font-family: 'Dancing Script', cursive;
  font-size: 1.5rem;
  color: oklch(35% 0.15 285);
}

@media (max-width: 640px) {
  .letter-paper {
    padding: 20px;
    font-size: 13px;
  }
  .letter-header {
    flex-direction: column;
    gap: 10px;
  }
  .corporate-details {
    text-align: left;
  }
}

.account-card { 
  padding: 16px; 
  cursor: pointer; 
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #18181b;
  background: #09090b;
}

.account-card:hover { 
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.1);
  transform: translateY(-2px);
}

.source-active { 
  background: rgba(239, 68, 68, 0.05) !important; 
  border-color: var(--accent-red) !important;
  box-shadow: inset 0 0 10px rgba(239, 68, 68, 0.1) !important;
}

.target-active { 
  background: rgba(16, 185, 129, 0.05) !important; 
  border-color: var(--accent-green) !important;
  box-shadow: inset 0 0 10px rgba(16, 185, 129, 0.1) !important;
}

/* Logs */
#event_log {
  flex-grow: 1;
  overflow-y: auto;
  background: oklch(14% 0.01 250);
  border: 1px solid #333;
  padding: 12px;
  font-size: 0.85rem;
  line-height: 1.4;
  height: 300px;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .main-workspace {
    grid-template-columns: 1fr;
  }
  aside {
    order: 2;
  }
}

@media (max-width: 640px) {
  .desktop-environment {
    padding: 8px;
    gap: 8px;
  }
  .win-header {
    font-size: 0.75rem;
  }
  .panel-body {
    padding: 12px;
  }
  .reel-frame {
    height: 120px;
  }
  .reel {
    font-size: 50px;
  }
  .explorer-window {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .explorer-sidebar {
    display: flex;
    overflow-x: auto;
    border-right: none;
    border-bottom: 2px solid var(--win-border-light);
  }
  .sidebar-node {
    white-space: nowrap;
  }
  .doc-preview-pane {
    inset: 0;
    height: 100vh;
    max-width: none;
  }
}

/* BSOD & RSOD */
#bsod_screen, #rsod_screen {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  color: #ffffff;
  font-family: "Courier New", Courier, monospace;
  z-index: 99999;
  padding: 20px;
  box-sizing: border-box;
}

#bsod_screen { background-color: oklch(30% 0.15 250); }
#rsod_screen { background-color: oklch(40% 0.2 25); }

/* Contact Form Enhancements */
.contact-field {
  width: 100%;
  background-color: oklch(12% 0.01 250);
  border: 1px solid oklch(35% 0.02 250);
  color: var(--accent-cyan);
  font-family: 'Space Mono', monospace;
  padding: 12px;
  outline: none;
  transition: all 0.2s;
  box-shadow: inset 2px 2px 0px rgba(0,0,0,0.5);
}

.contact-field:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px oklch(70% 0.12 210 / 0.2), inset 2px 2px 0px rgba(0,0,0,0.5);
}

.contact-field::placeholder {
  color: oklch(40% 0.01 250);
  opacity: 0.5;
}

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

.transmitting-log {
  font-size: 10px;
  color: var(--accent-green);
  font-family: 'Space Mono', monospace;
  margin-top: 4px;
  animation: transmission-pulse 1s infinite;
}
