/* ===== Theme Variables ===== */
:root {
  --primary-color: #0f0;
  --bg-color: #000;
  --shadow-color: rgba(0, 255, 0, 0.25);
  --text-color: #fff;
  --border-color: rgba(0, 255, 0, 0.85);
  --terminal-border: rgba(0, 255, 0, 0.85);
}

/* Light Theme */
[data-theme='light'] {
  --primary-color: #ff69b4;
  --bg-color: #fff;
  --shadow-color: rgba(255, 105, 180, 0.1);
  --text-color: #333;
  --border-color: #ff69b4;
  --terminal-border: #ff69b4;
}

body {
  background: var(--bg-color);
  font-family: "Consolas","Courier New", monospace;
  margin: 0;
  overflow: hidden;
  color: var(--text-color);
}

#landing {
  position: relative;
  height: 100vh;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

/* ===== terminal (CLI card) ===== */
.card {
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.terminal {
  pointer-events: auto;
  width: 640px;
  height: 380px;
  background: var(--bg-color);
  border: 2px solid var(--terminal-border);
  border-radius: 8px;
  box-shadow: 0 0 10px var(--shadow-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.terminal-header {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background: #141414;
  border-bottom: 1px solid #333;
  color: #bbb;
  font-size: 14px;
}

.term-title {
  font-weight: bold;
  font-family: Consolas, monospace;
  color: #0f0;
}

.term-buttons {
  display: flex;
  gap: 8px;
  font-size: 16px;
}

.min-btn, .close-btn {
  cursor: pointer;
  padding: 2px 6px;
}
.min-btn:hover, .close-btn:hover { color: #fff; }
.close-btn {
  color: #bbb;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}
.close-btn:hover { color: #fff; }

.terminal-body {
  padding:0;
  flex: 1;
  padding: 12px;
  font-size: 15px;
  line-height: 1.35;
  overflow: auto;
  white-space: pre-wrap;
}

pre#cli-output { 
    margin: 0; 
    color: #90ff90;
    padding:10px;
 }

.cursor {
  display: inline-block;
  margin-left: 2px;
  font-weight: 700;
  animation: blink 700ms steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ===== UAC modal ===== */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
  z-index: 200;
}
.modal.hidden { display: none; }

.modal-window {
  width: 420px;
  background: #f3f4f6;
  border-radius: 6px;
  overflow:hidden;
  box-shadow: 0 12px 48px rgba(0,0,0,0.6);
}

.modal-header {
  background: #0078D7;
  color: white;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: grab;
  user-select: none;
}
.modal-title { font-weight: 600; }
.modal-close {
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.modal-close:hover { background: rgba(255,255,255,0.12); }

.modal-body {
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: #222;
  font-family: "Segoe UI", Tahoma, sans-serif;
}
.modal-body img { width: 44px; height: 44px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px;
}
.btn {
  padding: 8px 12px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}
.btn-confirm { background: #0078D7; color: white; }
.btn-cancel { background: #e1e1e1; color: #222; }

/* ===== transitions ===== */
body.fade-out { transition: opacity .6s ease; opacity: 0; }

/* responsive tweak */
@media (max-width:700px){
  .terminal { width: 90%; height: 60vh; }
  .modal-window { width: 92%; }
}


.term-title {
  flex: 1;
  text-align: center;
  color: #bbb;
  font-family: "Consolas","Courier New", monospace;
  font-size: 13px;
}

/* CLI body fix */
.terminal-body {
  flex: 1;
  padding: 8px 10px;
  font-size: 15px;
  line-height: 1.4;
  overflow-y: auto;
  white-space: pre-wrap;
}
pre#cli-output {
  margin: 0;
  padding: 0;
  color: #90ff90;
}
/* Terminal app window */
.terminal-window {
  position: absolute;
  top: 60px; left: 60px;
  width: 640px; height: 380px;
  background: var(--bg-color);
  border: 2px solid var(--terminal-border);
  border-radius: 8px;
  box-shadow: 0 0 25px var(--shadow-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
}

[data-theme='light'] .terminal-window {
  background: #fafafa;
  border-color: var(--primary-color);
}

[data-theme='light'] pre#cli-output {
  color: #333;
}

[data-theme='light'] .prompt {
  color: var(--primary-color);
}

[data-theme='light'] .active-input {
  color: #333;
}
.terminal-window.hidden { display: none; }

.term-buttons { display: flex; gap: 8px; }
.min-btn, .close-btn {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  color: #bbb;
  font-weight: 600;
}
.min-btn:hover, .close-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* Taskbar */
.taskbar {
  position: absolute;
  bottom: 0; 
  left: 0;
  width: 100%;
  height: 40px;
  background: var(--bg-color);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 20px;
  gap: 15px;
  backdrop-filter: blur(10px);
}

[data-theme='light'] .taskbar {
  background: rgba(255, 255, 255, 0.85);
  border-top-color: var(--primary-color);
}

[data-theme='light'] .taskbar-icon img {
  filter: none;
}

[data-theme='light'] .taskbar-icon:hover {
  background: rgba(255, 105, 180, 0.1);
}

.taskbar-systemtray {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
  padding-right: 20px;
  font-size: 14px;
  color: var(--text-color);
}

/* Theme Toggle Button */
#theme-toggle {
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  font-size: 16px;
}

#theme-toggle:hover {
  opacity: 0.8;
}

/* Flower Animation */
.flower {
  position: absolute;
  pointer-events: none;
  font-size: 20px;
  transition: transform 0.3s ease;
  color: var(--primary-color);
  z-index: 1;
}

[data-theme='light'] .flower {
  content: '🌸';
}

[data-theme='light'] #bg-canvas {
  opacity: 0.6;
}

#datetime {
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* pushes text to the right edge */
  line-height: 1.1;
  font-family: "Segoe UI", sans-serif;
  font-size: 13px;
}


.taskbar-icon {
  width: 28px; height: 28px;
  display: flex;
  align-items: center; justify-content: center;
  border-radius: 4px;
  cursor: pointer;
}
.taskbar-icon:hover { background: rgba(255,255,255,0.12); }
.taskbar-icon img { width: 22px; height: 22px; }

/* CLI typing line */
#current-line {
  display: inline-block;
  min-width: 4px;
  outline: none;
}


#cli-output {
  font-family: Consolas, "Courier New", monospace;
  white-space: pre-wrap;
  line-height: 1.4;
}

#current-line {
  font-family: Consolas, "Courier New", monospace;
}
/* Notepad window */
#notepad-app {
  position: absolute;
  top :50px;
  right: 20px;
  width: 400px;
  background: #fff;
  color: #000;
  border: 2px solid #493f3f;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  font-family: Consolas, monospace;
}

#notepad-app .window-header {
  background: #0078d7;
  color: #fff;
  padding: 6px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
}

.calc-header {
  border-radius: 5px 5px 0 0;
  padding: 8px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--primary-color);
  color: var(--bg-color);
}

.calc-buttons-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.calc-min, .calc-close {
  background: none;
  border: none;
  color: var(--bg-color);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 3px;
  line-height: 1;
}

.calc-min:hover, .calc-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

[data-theme='light'] .calc-header {
  color: white;
}

[data-theme='light'] .calc-min, 
[data-theme='light'] .calc-close {
  color: white;
}

.calc-title {
  font-size: 14px;
  font-weight: 500;
}



#notepad-app .window-body {
  padding: 10px;
  white-space: pre-wrap;
  font-size: 14px;
}

#notepad-app .window-header {
  position: relative; /* needed for z-index stacking */
  background: #0078d7;
  color: #fff;
  padding: 6px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
}

#notepad-app .notepad-close-btn {
  position: relative; /* so z-index applies */
  z-index: 10;        /* above the header */
  background: transparent;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
}

#notepad-app .notepad-close-btn:hover {
  background: rgba(255,255,255,0.2);
}


#notepad-app.hidden {
  display: none !important;
}
#save-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
}
#save-btn:hover {
  background: rgba(255,255,255,0.2);
}


#desktop {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  padding: 20px;
  gap: 20px;
  pointer-events: none; /* icons don’t block background */
}
.desktop-icon {
  width: 64px;
  text-align: center;
  color: white;
  font-size: 12px;
  cursor: pointer;
  pointer-events: auto; /* icons clickable */
}
.desktop-icon img {
  filter: brightness(0) invert(1);
  width: 48px;
  height: 48px;
  display: block;
  margin: 0 auto 4px;
}


.menu-bar {
  display: flex;
  gap: 12px;
  margin-left: 20px;
  color: #fff;
  font-size: 14px;
}

.menu {
  position: relative;
  cursor: pointer;
  padding: 2px 6px;
}
.menu:hover { background: rgba(255,255,255,0.15); }

.dropdown {
  position: absolute;
  top: 20px;
  left: 0;
  background: #fff;
  color: #000;
  border: 1px solid #ccc;
  border-radius: 4px;
  min-width: 100px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.25);
  z-index: 999;
}
.dropdown.hidden { display: none; }

.dropdown-item {
  padding: 6px 10px;
  cursor: pointer;
}
.dropdown-item:hover {
  background: #0078d7;
  color: #fff;
}



@media (max-width: 700px) {
  .terminal-window {
    width: 95%;
    height: 60vh;
    top: 10px !important;
    left: 2.5% !important; /* center */
  }

  #notepad-app {
    width: 90%;
    right: 5% !important;
    top: 70px !important;
    max-height: 60vh;
    overflow-y: auto;
  }

  .modal-window {
    width: 95%;
  }

  .terminal-body {
    font-size: 13px;
  }

  .taskbar {
    padding: 0 10px;
    gap: 6px;
    height: 48px;
  }

  .taskbar-icon {
    width: 36px;
    height: 36px;
  }
}

/* Calculator App */
#calculator-app {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  background: var(--bg-color);
  border: 2px solid var(--primary-color);
  border-radius: 10px;
  box-shadow: 0 0 20px var(--shadow-color);
  font-family: 'Segoe UI', sans-serif;
}

[data-theme='light'] #calculator-app {
  background: rgba(255, 255, 255, 0.95);
}

.calc-body {
  border-radius: 5px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.calc-display {
  background: var(--bg-color);
  border: 1px solid var(--primary-color);
  border-radius: 5px;
  padding: 10px;
  text-align: right;
  min-height: 80px;
}

[data-theme='light'] .calc-display {
  background: rgba(255, 255, 255, 0.9);
  color: #333;
}

.calc-previous {
  font-size: 0.8em;
  color: var(--text-color);
  opacity: 0.7;
  min-height: 1.2em;
}

.calc-current {
  font-size: 1.8em;
  color: var(--text-color);
  font-weight: bold;
  word-wrap: break-word;
}

.calc-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.calc-btn {
  padding: 15px;
  border: 1px solid var(--primary-color);
  background: var(--bg-color);
  color: var(--text-color);
  border-radius: 5px;
  font-size: 1.1em;
  cursor: pointer;
  transition: all 0.2s ease;
}

[data-theme='light'] .calc-btn {
  background: rgba(255, 255, 255, 0.9);
  color: #333;
}

.calc-btn:hover {
  background: var(--primary-color);
  color: var(--bg-color);
}

[data-theme='light'] .calc-btn:hover {
  color: #fff;
}

.calc-btn[data-action='operation'],
.calc-btn[data-action='equals'] {
  background: var(--primary-color);
  color: var(--bg-color);
}

[data-theme='light'] .calc-btn[data-action='operation'],
[data-theme='light'] .calc-btn[data-action='equals'] {
  color: #fff;
}

.calc-btn[data-action='operation']:hover,
.calc-btn[data-action='equals']:hover {
  filter: brightness(1.2);
}

.span-2 {
  grid-column: span 2;
}

/* Touch dragging support */
@media (hover: none) and (pointer: coarse) {
  .terminal-header, 
  #notepad-app .window-header {
    touch-action: none; /* prevent scroll hijack */
  }
}

/* Mobile warning */
.mobile-warning {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

.mobile-warning.hidden { display: none; }

.warning-card {
  background: #111;
  color: #fff;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
  border: 1px solid #0f0;
}

.warning-card h2 {
  margin-top: 0;
  color: #0f0;
}

.warning-card button {
  margin: 10px;
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

#proceed-btn {
  background: #0f0;
  color: #000;
}

#stay-btn {
  background: #333;
  color: #fff;
}

