:root {
  --bg: #001728;
  --boot-bg: #0b2a44;
  --accent: #00d1d1;
  --muted: #9fb1c9;
  --card: #0f2b3f;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: #e6f6f6;
  transition: background 0.3s ease, color 0.3s ease;
}

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hidden {
  display: none;
}

/* Boot screen */
.boot-screen {
  background: linear-gradient(180deg, var(--boot-bg), #031927);
  color: var(--accent);
  text-align: center;
  display: flex;
  align-items: center;           /* vertically center */
  justify-content: center;       /* horizontally center */
  flex-direction: column;
  height: 100vh;
  margin: 0;
  padding: 0;
}

.boot-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.frog-logo {
  width: 160px;
  height: auto;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.6));
}

.os-name {
  width: 260px;
  margin-top: 10px;
}

.boot-sub {
  margin: 0;
  color: var(--muted);
}

.boot-progress {
  width: 360px;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 20px;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #00ffaa);
  transition: width 0.2s;
}

.boot-footer {
  position: absolute;
  bottom: 18px;
  left: 18px;
  color: rgba(255,255,255,0.12);
  font-size: 12px;
}

/* Login screen */
.login-screen {
  background: linear-gradient(180deg, #082231, #02121a);
  display: flex;
  align-items: center;           /* vertically center */
  justify-content: center;       /* horizontally center */
  height: 100vh;
  margin: 0;
  padding: 0;
}

.login-card {
  background: rgba(255,255,255,0.03);
  padding: 28px;
  border-radius: 10px;
  min-width: 320px;
  max-width: 420px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  text-align: left;
}

.login-header {
  text-align: center;
  margin-bottom: 10px;
}

.login-logo {
  width: 200px;
  height: auto;
}

.login-instruction {
  text-align: center;
  color: var(--muted);
}

.login-card label {
  display: block;
  margin: 12px 0;
  color: var(--muted);
  font-size: 14px;
}

.login-card input {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.01);
  color: inherit;
}

.login-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.login-actions button {
  background: var(--accent);
  border: none;
  padding: 10px 14px;
  border-radius: 6px;
  color: #002626;
  cursor: pointer;
  font-weight: 600;
}

.login-actions button:hover {
  filter: brightness(1.1);
}

.error {
  color: #ff6b6b;
  margin-top: 8px;
}

/* Terminal screen */
.terminal-screen {
  background: linear-gradient(180deg, #06202b, #012022);
  padding-top: 40px;
  align-items: stretch;
  transition: background 0.3s ease;
}

.taskbar {
  height: 40px;
  background: rgba(0,0,0,0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  color: var(--muted);
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  transition: background 0.3s ease, color 0.3s ease;
}

.task-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-frog {
  width: 24px;
  height: auto;
}

.terminal-card {
  margin: 70px auto 0;
  max-width: 900px;
  background: rgba(255,255,255,0.02);
  padding: 20px;
  border-radius: 10px;
}

.terminal-placeholder {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: center;
  color: var(--muted);
  padding: 12px;
}

/* Top Bar */
.task-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Taskbar buttons */
.taskbar-btn {
  background: rgba(0, 209, 209, 0.15);
  border: 1px solid rgba(0, 209, 209, 0.3);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  font-weight: 600;
}

.taskbar-btn:hover {
  background: rgba(0, 209, 209, 0.25);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.taskbar-btn:active {
  transform: translateY(0);
}

/* Theme selector dropdown */
.theme-selector {
  display: flex;
  align-items: center;
}

.theme-dropdown {
  background: rgba(0, 209, 209, 0.15);
  border: 1px solid rgba(0, 209, 209, 0.3);
  color: var(--accent);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  font-weight: 600;
  outline: none;
}

.theme-dropdown:hover {
  background: rgba(0, 209, 209, 0.25);
  border-color: var(--accent);
}

.theme-dropdown:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 209, 209, 0.2);
}

.theme-dropdown option {
  background: #0f2b3f;
  color: #e6f6f6;
  padding: 8px;
}

/* Logout icon styling */
.logout-icon {
  width: 24px;
  height: 24px;
  cursor: pointer;
  filter: brightness(0.8);
  transition: filter 0.2s;
}

.logout-icon:hover {
  filter: brightness(1.2);
}

/* File Manager Sidebar */
.file-sidebar {
  position: fixed;
  right: 0;
  top: 40px;
  width: 320px;
  height: calc(100vh - 40px);
  background: rgba(0, 0, 0, 0.95);
  border-left: 2px solid var(--accent);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  overflow: hidden;
}

.file-sidebar.hidden {
  transform: translateX(100%);
}

.file-sidebar.drag-active {
  background: rgba(0, 209, 209, 0.05);
  border-left-color: var(--accent);
  border-left-width: 4px;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(0, 209, 209, 0.1);
  border-bottom: 1px solid var(--accent);
}

.sidebar-header h3 {
  margin: 0;
  color: var(--accent);
  font-size: 16px;
}

.close-sidebar {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.close-sidebar:hover {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.sidebar-actions {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(0, 209, 209, 0.3);
}

.action-btn {
  flex: 1;
  background: rgba(0, 209, 209, 0.15);
  border: 1px solid rgba(0, 209, 209, 0.3);
  color: var(--accent);
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.action-btn:hover {
  background: rgba(0, 209, 209, 0.25);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.action-btn:active {
  transform: translateY(0);
}

.current-path {
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(0, 209, 209, 0.2);
  font-size: 12px;
  color: var(--muted);
  font-family: monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-zone {
  margin: 12px;
  padding: 30px 20px;
  border: 2px dashed rgba(0, 209, 209, 0.3);
  border-radius: 8px;
  background: rgba(0, 209, 209, 0.05);
  transition: all 0.3s;
  cursor: pointer;
}

.drop-zone:hover {
  border-color: rgba(0, 209, 209, 0.5);
  background: rgba(0, 209, 209, 0.1);
}

.drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(0, 209, 209, 0.2);
  border-style: solid;
  transform: scale(1.02);
}

.drop-zone-content {
  text-align: center;
  pointer-events: none;
}

.drop-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.6;
  transition: all 0.3s;
}

.drop-zone:hover .drop-icon,
.drop-zone.drag-over .drop-icon {
  opacity: 1;
  transform: scale(1.1);
}

.drop-text {
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.drop-subtext {
  color: var(--muted);
  font-size: 12px;
}

.file-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  margin-bottom: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.file-item:hover {
  background: rgba(0, 209, 209, 0.1);
  border-color: rgba(0, 209, 209, 0.3);
}

.file-item.directory {
  border-left: 3px solid #ffd700;
}

.file-item.file {
  border-left: 3px solid var(--accent);
}

.file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  overflow: hidden;
}

.file-icon {
  font-size: 18px;
  min-width: 20px;
}

.file-name {
  color: #e6f6f6;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  color: var(--muted);
  font-size: 11px;
  margin-left: auto;
  padding-left: 8px;
}

.file-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.file-item:hover .file-actions {
  opacity: 1;
}

.file-action-btn {
  background: transparent;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 14px;
  transition: all 0.2s;
}

.file-action-btn:hover {
  background: rgba(0, 209, 209, 0.2);
}

.loading {
  text-align: center;
  padding: 20px;
  color: var(--muted);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.3;
}

/* Adjust xterm when sidebar is visible */
#xterm.sidebar-visible {
  margin-right: 320px;
}

/* Terminal area styling */
.terminal-area {
  background-color: #012022;
  color: #00ffcc;
  font-family: "Courier New", Courier, monospace;
  padding: 12px;
  margin-top: 40px; /* taskbar height */
  height: calc(100vh - 40px);
  overflow-y: auto;
  white-space: pre-wrap;
}

/* Prompt text */
.terminal-prompt {
  display: inline;
  user-select: none; /* prevent deleting prompt */
}

.terminal-cursor {
  display: inline-block;
  width: 8px;
  animation: blink 1s step-start infinite;
  color: #00ffcc;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Custom Modal/Dialog Styling */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(-20px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal-container {
  background: linear-gradient(135deg, rgba(1, 32, 34, 0.98), rgba(15, 43, 63, 0.98));
  border: 2px solid var(--accent);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8),
              0 0 40px rgba(0, 209, 209, 0.2);
  min-width: 400px;
  max-width: 500px;
  animation: slideIn 0.3s ease;
  overflow: hidden;
}

.modal-header {
  background: rgba(0, 209, 209, 0.15);
  border-bottom: 1px solid rgba(0, 209, 209, 0.3);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  color: var(--accent);
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(90deg);
}

.modal-body {
  padding: 24px 20px;
  color: #e6f6f6;
}

.modal-icon {
  text-align: center;
  font-size: 48px;
  margin-bottom: 16px;
  animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.modal-message {
  text-align: center;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 16px;
  color: #e6f6f6;
}

.modal-input-container {
  margin-top: 16px;
}

.modal-input-container.hidden {
  display: none;
}

.modal-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(0, 209, 209, 0.3);
  border-radius: 6px;
  color: var(--accent);
  font-size: 14px;
  font-family: 'Courier New', Courier, monospace;
  outline: none;
  transition: all 0.2s;
}

.modal-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 209, 209, 0.2);
  background: rgba(0, 0, 0, 0.6);
}

.modal-input::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.modal-footer {
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(0, 209, 209, 0.2);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.modal-btn {
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  min-width: 80px;
}

.modal-btn-primary {
  background: var(--accent);
  color: #002626;
}

.modal-btn-primary:hover {
  background: #00ffee;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 209, 209, 0.4);
}

.modal-btn-primary:active {
  transform: translateY(0);
}

.modal-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #e6f6f6;
  border-color: rgba(255, 255, 255, 0.3);
}

.modal-btn-secondary:active {
  transform: scale(0.98);
}

/* Specific modal types */
.modal-container.alert-success .modal-header {
  background: rgba(80, 250, 123, 0.15);
  border-bottom-color: rgba(80, 250, 123, 0.3);
}

.modal-container.alert-error .modal-header {
  background: rgba(255, 85, 85, 0.15);
  border-bottom-color: rgba(255, 85, 85, 0.3);
}

.modal-container.alert-warning .modal-header {
  background: rgba(255, 204, 0, 0.15);
  border-bottom-color: rgba(255, 204, 0, 0.3);
}

.modal-container.alert-info .modal-header {
  background: rgba(139, 233, 253, 0.15);
  border-bottom-color: rgba(139, 233, 253, 0.3);
}
