/* ====================================
   GLOBAL STYLES & RESET
   ==================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  color: #e6e6e6;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.4;
}

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

/* ====================================
   TERMINAL HEADER
   ==================================== */
.terminal-header {
  background: #2d2d2d;
  border-radius: 8px 8px 0 0;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.terminal-dot:hover {
  transform: scale(1.1);
}

.dot-red {
  background: #ff5f56;
}

.dot-yellow {
  background: #ffbd2e;
}

.dot-green {
  background: #27ca3f;
}

.terminal-title {
  margin-left: auto;
  font-size: 0.8rem;
  color: #888;
  font-weight: 500;
}

/* ====================================
   MAIN TERMINAL
   ==================================== */
.terminal {
  background: #1a1a1a;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  border: 1px solid #333;
  overflow: hidden;
}

/* ====================================
   FILE STATUS BAR
   ==================================== */
.file-status-bar {
  background: #2d2d2d;
  padding: 0.3rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: #888;
  border-bottom: 1px solid #333;
}

.file-info {
  color: #00ff88;
}

.file-status {
  color: #ffbd2e;
}

.cursor-position {
  color: #00ccff;
}

/* ====================================
   TERMINAL CONTENT
   ==================================== */
.terminal-content {
  padding: 1rem;
  background: #1a1a1a;
}

.command-line {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #333;
}

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

.command {
  color: #00ccff;
}

/* ====================================
   FILE CONTENT AREA - FIXED ALIGNMENT
   ==================================== */
.file-content {
  display: flex;
  background: #1e1e1e;
  border-radius: 0;
  padding: 0;
  margin-bottom: 1rem;
  min-height: 500px;
  font-size: 1rem;
  line-height: 1.4;
  width: 100%;
}

.line-numbers {
  display: flex;
  flex-direction: column;
  min-width: 50px;
  padding: 1rem 1rem 1rem 0.5rem;
  border-right: 1px solid #333;
  user-select: none;
  flex-shrink: 0;
  background: #1a1a1a;
}

.line-number {
  font-size: 1rem;
  color: #555;
  text-align: right;
  line-height: 1.4;
  height: 1.4em;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.file-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background: #1e1e1e;
  width: 100%;
}

.text-line {
  line-height: 1.4;
  height: 1.4em;
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.text-content {
  color: #e6e6e6;
}

.markdown-header {
  color: #00ff88;
  font-weight: bold;
}

.cursor {
  color: #00ff88;
  animation: cursor-blink 1s infinite;
  margin-left: 2px;
}

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

/* ====================================
   NANO CONTROLS
   ==================================== */
.nano-controls {
  background: #2d2d2d;
  padding: 0.5rem 1rem;
  border-top: 1px solid #333;
  font-size: 0.7rem;
}

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

.control-item {
  color: #888;
  flex: 1;
  text-align: center;
}

.control-item:hover {
  color: #00ff88;
  cursor: pointer;
}

/* ====================================
   NAVIGATION TERMINAL
   ==================================== */
.navigation-terminal {
  background: #0a0a0a;
  border-radius: 8px;
  margin: 1rem;
  padding: 1rem;
  border: 1px solid #333;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.nav-terminal-content {
  font-size: 0.85rem;
}

.nav-terminal-line {
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
}

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

.nav-command {
  color: #00ccff;
}

.nav-output {
  margin-left: 1rem;
}

.file-listing {
  color: #ccc;
  font-size: 0.8rem;
}

.file-listing.clickable {
  color: #00ccff;
  cursor: pointer;
  transition: color 0.2s ease;
}

.file-listing.clickable:hover {
  color: #00ff88;
  text-decoration: underline;
}

.nav-input {
  color: #00ccff;
  min-width: 1px;
}

.nav-cursor {
  color: #00ff88;
  animation: cursor-blink 1s infinite;
  margin-left: 2px;
}

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

.hint-text {
  color: #00ff88;
  font-size: 0.75rem;
  font-style: italic;
}

/* ====================================
   FLOATING ELEMENTS
   ==================================== */
.floating-element {
  position: fixed;
  font-size: 0.8rem;
  color: #333;
  pointer-events: none;
  z-index: -1;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  opacity: 0.2;
  animation: float 20s infinite linear;
}

@keyframes float {
  0% { transform: translateY(0px) rotate(0deg); }
  25% { transform: translateY(-20px) rotate(90deg); }
  50% { transform: translateY(0px) rotate(180deg); }
  75% { transform: translateY(-20px) rotate(270deg); }
  100% { transform: translateY(0px) rotate(360deg); }
}

/* ====================================
   SCROLLBAR STYLING
   ==================================== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
  background: #00ff88;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #00ccff;
}

/* ====================================
   RESPONSIVE DESIGN
   ==================================== */
@media (max-width: 1024px) {
  .container {
    padding: 0.5rem;
  }
  
  .terminal-content {
    padding: 0.5rem;
  }
  
  .file-content {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .line-numbers {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid #333;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
  }
  
  .control-row {
    flex-direction: column;
    gap: 0.2rem;
  }
  
  .control-item {
    text-align: left;
  }
}

@media (max-width: 768px) {
  .file-status-bar {
    flex-direction: column;
    gap: 0.2rem;
    align-items: flex-start;
  }
  
  .navigation-terminal {
    margin: 0.5rem;
    padding: 0.5rem;
  }
  
  .floating-element {
    display: none;
  }
}

/* ====================================
   ACCESSIBILITY
   ==================================== */
@media (prefers-reduced-motion: reduce) {
  .cursor,
  .nav-cursor {
    animation: none;
  }
  
  .floating-element {
    animation: none;
  }
  
  .terminal-dot {
    transition: none;
  }
}

/* ====================================
   HIGHLIGHT EFFECTS
   ==================================== */
.text-content:contains("**") {
  font-weight: bold;
}

.markdown-header:hover {
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

/* ====================================
   LOADING STATES
   ==================================== */
.loading {
  opacity: 0.5;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.1), transparent);
  animation: loading-sweep 2s infinite;
}

@keyframes loading-sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}