/* 
   sudonishant.github.io - Stylesheet
   Theme: Apple macOS Glassmorphic Terminal (4K Ultra-Crisp Edition)
*/

:root {
  --bg-color: #030508;
  --terminal-bg: rgba(10, 14, 20, 0.85);
  --header-bg: rgba(18, 22, 28, 0.96);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 229, 255, 0.1);
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Tokyo Night / macOS Terminal Colors */
  --text-primary: #cbd5e1;
  --text-muted: #64748b;
  --color-green: #00ff66;
  --color-cyan: #00e5ff;
  --color-blue: #3b82f6;
  --color-red: #ff5f56;
  --color-yellow: #ffbd2e;
  --color-green-mac: #27c93f;
}

/* Reset and Global Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-mono);
  overflow: hidden;
  font-size: 14px;
  /* Ultra-sharp text rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle Matrix Canvas Background */
#matrix-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.08;
  pointer-events: none;
}

/* Glassmorphic CRT Screen Glass Overlay (Ultra Subtle, No scanlines) */
.crt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.01) 0%, rgba(0, 0, 0, 0.3) 100%);
  z-index: 100;
  pointer-events: none;
}

/* macOS Desktop centering wrapper */
.mac-desktop {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 30px;
}

/* Frosted glass macOS Terminal Window */
.mac-terminal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 900px;
  height: 85vh;
  max-height: 600px;
  background-color: var(--terminal-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.65), 
    0 0 0 1px rgba(0, 229, 255, 0.04), 
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  overflow: hidden;
}

/* macOS Window Header Bar */
.mac-terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 42px;
  padding: 0 18px;
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  user-select: none;
  z-index: 10;
}

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

.ctrl-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.dot-close {
  background-color: var(--color-red);
}

.dot-minimize {
  background-color: var(--color-yellow);
}

.dot-maximize {
  background-color: var(--color-green-mac);
}

.window-title {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.2px;
  text-align: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.tab-indicator {
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.02);
}

/* Terminal Screen Area */
.mac-terminal-body {
  flex: 1;
  padding: 20px;
  overflow: hidden;
}

.terminal-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}

.welcome-banner {
  white-space: pre;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 20px;
  font-size: 12px;
  user-select: none;
}

.terminal-history {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 15px;
}

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 5px;
}

.prompt {
  white-space: nowrap;
  font-weight: bold;
}

.prompt-user {
  color: var(--color-cyan);
}

.prompt-host {
  color: var(--color-green);
}

.prompt-tilde {
  color: var(--text-primary);
}

/* Cursor and Text Inputs */
#terminal-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--color-green);
  font-family: var(--font-mono);
  font-size: 14px;
  caret-color: var(--color-green);
}

/* CLI Text Colors */
.term-input-echo {
  color: var(--text-primary);
  font-weight: bold;
}

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

.term-cyan {
  color: var(--color-cyan);
}

.term-error {
  color: var(--color-red);
  font-weight: 500;
}

.term-warning {
  color: var(--color-yellow);
}

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

.term-highlight {
  color: #fff;
  background-color: rgba(0, 229, 255, 0.15);
  padding: 2px 6px;
  border-radius: 3px;
}

/* GNU Nano Editor Overlay Styles */
#nano-editor {
  position: absolute;
  top: 42px;
  left: 0;
  width: 100%;
  height: calc(100% - 42px);
  background-color: #0c0f12;
  display: flex;
  flex-direction: column;
  color: #ffffff;
  padding: 10px;
  z-index: 50;
}

.nano-header {
  background-color: #ffffff;
  color: #0c0f12;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: bold;
  text-align: center;
}

#nano-textarea {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 14px;
  resize: none;
  padding: 10px 5px;
  line-height: 1.5;
}

.nano-footer {
  background-color: #0c0f12;
  color: #ffffff;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px;
  font-size: 11px;
  white-space: pre-wrap;
  line-height: 1.5;
  user-select: none;
}

/* Interactive htop Overlay Styles */
#htop-monitor {
  position: absolute;
  top: 42px;
  left: 0;
  width: 100%;
  height: calc(100% - 42px);
  background-color: #0a0d10;
  color: #00ff66;
  font-family: var(--font-mono);
  padding: 12px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  font-size: 12px;
  user-select: none;
}

.htop-header-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 12px;
}

.htop-bar {
  display: flex;
  gap: 8px;
  font-weight: bold;
}

.htop-bar-fill {
  color: #00e5ff;
}

.htop-process-title {
  background-color: #27c93f;
  color: #000000;
  padding: 2px 5px;
  font-weight: bold;
}

.htop-process-list {
  flex: 1;
  overflow-y: auto;
  padding: 5px 0;
  line-height: 1.4;
  color: #ffffff;
}

.htop-footer {
  background-color: #00e5ff;
  color: #000000;
  padding: 2px 5px;
  font-size: 11px;
  font-weight: bold;
}

/* Custom Scrollbar for macOS Terminal Screen */
.terminal-container::-webkit-scrollbar {
  width: 5px;
}

.terminal-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

.terminal-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.terminal-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Responsive Styles */
@media (max-width: 768px) {
  body, html {
    font-size: 12px;
  }
  
  .mac-desktop {
    padding: 10px;
  }
  
  .mac-terminal {
    height: 90vh;
    max-height: none;
    border-radius: 8px;
  }
  
  .welcome-banner {
    font-size: 8px;
    line-height: 1.2;
  }
  
  #terminal-input {
    font-size: 12px;
  }
}

/* Audio Player Toggle Widget */
.music-toggle {
  background: rgba(0, 255, 102, 0.1);
  border: 1px solid #00ff66;
  color: #00ff66;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  cursor: pointer;
  margin-right: 12px;
  transition: all 0.2s ease-in-out;
  font-weight: 500;
  user-select: none;
}
.music-toggle:hover {
  background: #00ff66;
  color: #030508;
  box-shadow: 0 0 8px #00ff66;
}
.music-toggle.playing {
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid #00e5ff;
  color: #00e5ff;
  animation: musicPulse 1.5s infinite alternate;
}
.music-toggle.playing:hover {
  background: #00e5ff;
  color: #030508;
  box-shadow: 0 0 8px #00e5ff;
}

@keyframes musicPulse {
  from {
    box-shadow: 0 0 4px rgba(0, 229, 255, 0.4);
  }
  to {
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.8);
  }
}
