:root {
  --surface: rgba(255, 255, 255, 0.12);
  --surface-strong: rgba(255, 255, 255, 0.18);
  --surface-border: rgba(255, 255, 255, 0.24);
  --text-high: #eef2ff;
  --text-medium: rgba(226, 232, 255, 0.84);
  --text-soft: rgba(226, 232, 255, 0.7);
  --accent: #7c5cff;
  --accent-soft: rgba(124, 92, 255, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  min-height: 100%;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-high);
  background: radial-gradient(circle at top left, rgba(124, 92, 255, 0.18), transparent 18%),
    radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.14), transparent 20%),
    linear-gradient(180deg, #070914 0%, #0f1325 100%);
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('Background.jpeg');
  background-size: cover;
  background-position: center;
  opacity: 0.14;
  filter: blur(4px) saturate(120%);
  pointer-events: none;
}

.desktop-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 20% 20%, rgba(124, 92, 255, 0.18), transparent 18%),
    radial-gradient(circle at 70% 10%, rgba(59, 130, 246, 0.12), transparent 15%),
    radial-gradient(circle at 50% 80%, rgba(16, 185, 129, 0.14), transparent 22%);
}

.topbar {
  position: absolute;
  left: 50%;
  top: 20px;
  transform: translateX(-50%);
  width: min(1100px, calc(100% - 32px));
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  gap: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  backdrop-filter: blur(22px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  z-index: 2;
}

.titlebar button {
  border: none;
  outline: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 18px;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.titlebar button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.statusbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

#timeElement {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-medium);
  font-size: 14px;
}

.window {
  position: fixed;
  top: 50vh;
  left: 50vw;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100% - 40px));
  max-height: calc(100vh - 80px);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 22, 44, 0.78);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(30px);
  padding: 24px;
  overflow: hidden;
  z-index: 1;
}

.window.opened {
  overflow-y: auto;
}

.windowheader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: -24px -24px 20px -24px;
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px 28px 0 0;
  backdrop-filter: blur(28px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.window-title {
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}

.draghandle {
  width: 28px;
  height: 28px;
  cursor: move;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
}

.closebutton {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.closebutton:hover {
  background: rgba(255, 255, 255, 0.26);
  transform: translateY(-1px);
}

.window h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -0.04em;
  color: #f8fafc;
  text-align: center;
}

.windowsubtitle {
  margin: 12px auto 24px;
  max-width: 420px;
  text-align: center;
  color: var(--text-medium);
  font-size: 15px;
  line-height: 1.8;
}

.windowbody {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.windowtext p {
  margin: 0;
  color: rgba(226, 232, 255, 0.92);
  line-height: 1.8;
  text-align: center;
  font-size: 15px;
}

.linkrow {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.buttonlink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.14);
  color: #eef2ff;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.buttonlink:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.16);
}

.calculator-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.calc-display {
  min-height: 66px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 16px;
  font-size: 28px;
  color: #eef2ff;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  word-break: break-word;
}

.calculator-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.calc-button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  color: #eef2ff;
  font-size: 18px;
  padding: 16px 0;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.calc-button:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.calc-button.operator {
  background: rgba(124, 92, 255, 0.18);
  border-color: rgba(124, 92, 255, 0.26);
}

.calc-button.equals {
  grid-column: span 4;
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(16, 185, 129, 0.3);
}

.file-row {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.file-row:hover {
  background: rgba(255, 255, 255, 0.12);
}

.preview-body {
  margin-top: 16px;
}

.preview-output {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 18px;
  min-height: 160px;
  width: 100%;
  resize: vertical;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  color: #eef2ff;
}

.preview-frame {
  width: 100%;
  min-height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  margin-bottom: 14px;
  background: rgba(0, 0, 0, 0.05);
}

.preview-placeholder {
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  padding: 24px;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 14px;
}

.preview-image {
  display: block;
  max-width: 100%;
  max-height: 260px;
  width: auto;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.hidden {
  display: none !important;
}

.browser-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.browser-url {
  flex: 1;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #eef2ff;
  padding: 12px 14px;
  font-size: 14px;
}

.browser-frame-wrapper {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.2);
}

.browser-frame {
  width: 100%;
  min-height: 340px;
  border: none;
  display: block;
}

.notes-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.notes-textarea {
  width: 100%;
  min-height: 260px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #eef2ff;
  padding: 18px;
  resize: vertical;
  font-size: 15px;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.notes-textarea::placeholder {
  color: rgba(238, 242, 255, 0.5);
}

.hidden {
  display: none !important;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.app-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  color: #eef2ff;
  padding: 20px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.app-card:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.file-list,
.settings-list {
  display: grid;
  gap: 12px;
}

.file-row,
.setting-row {
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #eef2ff;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.setting-row input {
  accent-color: var(--accent);
}

.dock {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  backdrop-filter: blur(28px);
}

.dockicon {
  border: none;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 12px 18px;
  min-width: 88px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.dockicon:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

body.no-glow .desktop-glow {
  display: none;
}

body.no-glass .window,
body.no-glass .topbar,
body.no-glass .dock,
body.no-glass .windowheader {
  backdrop-filter: none;
  background: rgba(15, 22, 44, 0.96);
  border-color: rgba(255, 255, 255, 0.1);
}

body.no-glass .windowheader {
  background: rgba(15, 22, 44, 0.95);
}

body.dark-mode {
  background: linear-gradient(180deg, #02030a 0%, #07101f 100%);
}

body.dark-mode::before {
  opacity: 0.08;
  filter: blur(3px) saturate(110%);
}

body.dark-mode .topbar,
body.dark-mode .dock,
body.dark-mode .windowheader {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .window {
  background: rgba(6, 13, 28, 0.88);
  border-color: rgba(255, 255, 255, 0.1);
}

