/* 
  CROLIC.DEV — BRAND IDENTITY (Dark IDE) 
  Palette: Dracula / Tokyo Night / Monokai based.
*/

:root {
  /* Palette */
  --bg-void: #0D1117;
  /* Deep Void */
  --text-main: #E6EDF3;
  /* Terminal Text */
  --text-dim: #8B949E;
  /* Comments / Dimmed */
  --accent-carrot: #FFAF00;
  /* Carrot Neon */
  --accent-blue: #61AFEF;
  /* Tag Blue */
  --accent-purple: #BD93F9;
  /* System Purple */
  --accent-green: #50FA7B;
  /* Success Green */
  --accent-red: #FF5555;
  /* Error Red */

  /* Fonts */
  --font-mono: 'JetBrains Mono', 'Consolas', 'Menlo', 'Monaco', 'Lucida Console', 'Liberation Mono', 'Dejavu Sans Mono', monospace;
}

* {
  box-sizing: border-box;
}

::selection {
  background: var(--accent-carrot);
  color: var(--bg-void);
}

body {
  background-color: var(--bg-void);
  color: var(--text-main);
  font-family: var(--font-mono);
  margin: 0;
  height: 100dvh;
  /* Dynamic viewport height for mobile */
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  /* Prevent body scroll, terminal scrolls internally */
}

/* scanline effect overlay */
body::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  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));
  background-size: 100% 3px, 3px 100%;
  pointer-events: none;
  z-index: 999;
}


/* TERMINAL WINDOW */
#terminal {
  width: 900px;
  height: 600px;
  background: #161B22;
  /* Slightly lighter than void for window bg */
  border: 1px solid #30363D;
  border-radius: 6px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* WINDOW HEADER */
#header {
  background: #0D1117;
  padding: 10px 15px;
  border-bottom: 1px solid #30363D;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-dim);
}

.window-controls {
  display: flex;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red {
  background: #FF5F56;
}

.dot.yellow {
  background: #FFBD2E;
}

.dot.green {
  background: #27C93F;
}

.title {
  text-align: center;
  flex-grow: 1;
  font-weight: bold;
  letter-spacing: 0.05em;
}

/* TERMINAL CONTENT AREA */
#output {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--text-main);
  scroll-behavior: smooth;
}

/* SCROLLBAR */
#output::-webkit-scrollbar {
  width: 10px;
}

#output::-webkit-scrollbar-track {
  background: var(--bg-void);
}

#output::-webkit-scrollbar-thumb {
  background: #30363D;
  border-radius: 5px;
  border: 2px solid var(--bg-void);
}

#output::-webkit-scrollbar-thumb:hover {
  background: var(--accent-purple);
}

#loading {
  display: flex;
  flex-direction: column;
}

/* LINE CONTAINER (Messages & Prompt) */
.line {
  display: block;
  width: 100%;
  padding: 1px 0;
  line-height: 1.5;
  word-break: break-word;
  /* Allow long words to break if needed */
}

.prompt {
  color: var(--accent-carrot);
  margin-right: 12px;
  font-weight: bold;
  white-space: pre;
  /* Keep prompt spacing exact */
}

/* DYNAMIC ASCII SEPARATOR */
.separator {
  display: block;
  width: 100%;
  height: 1.25em;
  overflow: hidden;
  color: var(--text-dim);
  margin: 10px 0;
  user-select: none;
  white-space: nowrap;
  pointer-events: none;
}

.separator::before {
  content: "----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------";
  display: inline-block;
  letter-spacing: -1px;
  /* Tighter dash line */
}




/* HIDDEN INPUT for mobile/desktop paste support */
#cmd-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
  /* Let clicks pass through to #output for selection */
  background: transparent;
  border: none;
  color: transparent;
  outline: none;
}

/* BLINKING CURSOR */
.cursor {
  display: inline-block;
  width: 10px;
  height: 18px;
  background: var(--text-main);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* UTILITIES */
.highlight {
  color: var(--accent-carrot);
}

.blue {
  color: var(--accent-blue);
}

.purple {
  color: var(--accent-purple);
}

.green {
  color: var(--accent-green);
}

.red {
  color: var(--accent-red);
}

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

/* MOBILE RESPONSIVENESS */
@media (max-width: 768px) {
  #terminal {
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  body {
    background: #161B22;
    /* Pure terminal bg on mobile */
  }

  body::after {
    display: none;
    /* No scanlines on mobile */
  }

  #output {
    font-size: 13px;
    /* Slightly more density for mobile */
    padding: 12px;
  }

  .prompt {
    margin-right: 8px;
    /* Tighter prompt on mobile */
  }
}