/* ====================================
   Classic Mac OS 9 Recreation for neo
   ==================================== */

@import url("https://fonts.googleapis.com/css2?family=Charcoal+Plus:wght@400;700&display=swap");

:root {
  --bg: #bdbdbd;
  --panel: #d6d6d6;
  --panel-dark: #9f9f9f;
  --titlebar: #e8e8e8;
  --titlebar-active: linear-gradient(#dce9ff, #b8d6ff);
  --accent: #3a3a3a;
  --text: #111;
  --shadow: rgba(0, 0, 0, 0.18);

  /* Mac OS 9 colors */
  --win-desktop: #6699cc;
  --win-white: #ffffff;
  --win-gray: #c0c0c0;
  --win-dark-gray: #808080;
  --win-black: #000000;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
  font-family: "Charcoal Plus", "Chicago", "Helvetica", Arial, sans-serif;
  font-size: 13px;
  color: var(--text);
}
body {
  background: linear-gradient(#d0d0d0, #b8b8b8);
  user-select: none;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* ============ BOOT SCREEN ============ */
#boot-screen {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.boot-content {
  text-align: center;
}

.boot-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
}

.boot-version {
  font-size: 18px;
  color: #888;
  margin-top: 15px;
  letter-spacing: 2px;
}

.boot-loading {
  width: 280px;
  margin: 0 auto;
}

.boot-bar {
  width: 100%;
  height: 16px;
  border: 2px solid #666;
  background: #000;
}

.boot-bar-fill {
  height: 100%;
  width: 0%;
  background: #fff;
  transition: width 0.15s linear;
}

.boot-text {
  margin-top: 8px;
  font-size: 12px;
  color: #666;
}

/* ============ MENU BAR ============ */
#menubar {
  height: 24px;
  background: linear-gradient(#efefef, #d6d6d6);
  border-bottom: 1px solid #8a8a8a;
  display: flex;
  align-items: center;
  padding: 2px 6px;
  font-weight: 600;
  color: #111;
  position: relative;
  z-index: 9000;
}

#apple-menu {
  width: 22px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 4px;
}

#menubar-items {
  display: flex;
  gap: 2px;
  flex: 1;
}

.menu {
  padding: 2px 8px;
  border-radius: 3px;
  cursor: default;
}

.menu:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #000;
}

#menubar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

#clock {
  font-size: 12px;
  color: #333;
}

/* ============ DESKTOP ============ */
#desktop {
  position: relative;
  height: calc(100% - 24px);
  overflow: hidden;
  padding: 12px;
  background-image: url("./assets/bg-main.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#icons {
  position: absolute;
  left: 12px;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
}

/* Icon style */
.icon {
  width: 72px;
  text-align: center;
  cursor: default;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  -webkit-user-select: none;
  padding: 4px;
}

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

.icon.drag-over {
  background: rgba(43, 107, 214, 0.3);
  border-radius: 4px;
}

.icon.selected .icon-img {
  outline: 2px solid #2b6bd6;
  outline-offset: 2px;
}

.icon-img {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-label {
  font-size: 11px;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* Trash slot */
#trash {
  position: absolute;
  right: 12px;
  bottom: 80px;
  width: 72px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

#trash.over .icon-img {
  transform: scale(1.1);
}

/* ============ WINDOWS ============ */
#windows {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

/* Window */
.window {
  position: absolute;
  width: 400px;
  height: 280px;
  background: linear-gradient(#f6f6f6, #e4e4e4);
  border: 2px solid #8a8a8a;
  border-bottom-width: 3px;
  border-right-width: 3px;
  box-shadow: 2px 4px 8px var(--shadow);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 4px;
}

#ollama-window {
  width: 500px;
  height: 450px;
  top: 50px;
  left: 100px;
}

#ollama-window .content {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.window.maximized {
  top: 0 !important;
  left: 0 !important;
  width: calc(100vw - 16px) !important;
  height: calc(100vh - 100px) !important;
  border-radius: 0;
}

/* Titlebar */
.titlebar {
  height: 26px;
  background: linear-gradient(#e9e9e9, #d3d3d3);
  border-bottom: 1px solid #9a9a9a;
  display: flex;
  align-items: center;
  padding: 0 6px;
  gap: 6px;
  cursor: move;
}

.controls {
  display: flex;
  gap: 6px;
}

.ctrl {
  width: 18px;
  height: 18px;
  border: 1px solid #7a7a7a;
  background: linear-gradient(#f2f2f2, #dcdcdc);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.ctrl:hover {
  background: linear-gradient(#fff, #e8e8e8);
}

.ctrl:active {
  transform: translateY(1px);
}

.title {
  flex: 1;
  text-align: center;
  font-weight: 600;
  font-size: 12px;
  pointer-events: none;
  color: #333;
}

/* Focus styles */
.window.focused {
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.window.focused .titlebar {
  background: linear-gradient(#dce9ff, #b8d6ff);
}

.window.focused .title {
  color: #000;
}

/* Content */
.content {
  flex: 1;
  padding: 12px;
  overflow: auto;
  background: linear-gradient(#fff, #f8f8f8);
}

/* Resize handle */
.resize-handle {
  width: 14px;
  height: 14px;
  position: absolute;
  right: 2px;
  bottom: 2px;
  cursor: se-resize;
  background:
    linear-gradient(135deg, #ddd 25%, transparent 25%),
    linear-gradient(225deg, #ddd 25%, transparent 25%),
    linear-gradient(45deg, #ddd 25%, transparent 25%),
    linear-gradient(315deg, #ddd 25%, #e4e4e4 25%);
  background-size: 4px 4px;
}

/* Minimized */
.window.minimized {
  transform: scale(0.25);
  opacity: 0.9;
  border-color: #888;
  transition:
    transform 0.2s,
    opacity 0.2s;
}

/* ============ DOCK ============ */
#dock {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  padding: 6px 10px;
  border-radius: 12px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.4),
    rgba(200, 200, 200, 0.3)
  );
  border: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  z-index: 800;
  display: flex;
  align-items: center;
  pointer-events: auto;
  backdrop-filter: blur(10px);
}

#dock-inner {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 4px 6px;
}

.dock-item {
  width: 44px;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 150ms cubic-bezier(0.2, 0.8, 0.2, 1);
  cursor: pointer;
  user-select: none;
}

.dock-item .dock-img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dock-item .dock-label {
  font-size: 10px;
  margin-top: 2px;
  opacity: 0;
  transition: opacity 150ms;
}

#dock-inner:hover .dock-item {
  transform: scale(0.9);
}

.dock-item:hover {
  transform: scale(1.3) !important;
}

#dock-inner:hover .dock-item .dock-label {
  opacity: 1;
}

#dock.dragover {
  outline: 2px dashed rgba(0, 0, 0, 0.3);
  outline-offset: 4px;
}

/* ============ CONTEXT MENU ============ */
.context-menu {
  position: fixed;
  background: linear-gradient(180deg, #f6f6f6, #e8e8e8);
  border: 1px solid #8a8a8a;
  border-radius: 4px;
  padding: 4px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  min-width: 160px;
}

.context-menu .item {
  padding: 4px 20px;
  cursor: pointer;
  font-size: 12px;
}

.context-menu .item:hover {
  background: linear-gradient(180deg, #2b6bd6, #1a4aa3);
  color: #fff;
}

.context-menu .sep {
  height: 1px;
  background: #aaa;
  margin: 4px 8px;
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}

::-webkit-scrollbar-track {
  background: #d6d6d6;
  border-left: 1px solid #9a9a9a;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #e8e8e8, #c0c0c0);
  border: 1px solid #888;
  border-radius: 2px;
}

::-webkit-scrollbar-button {
  background: #d6d6d6;
  border: 1px solid #888;
  display: block;
  height: 16px;
}

/* ============ BUTTONS ============ */
.mac-button {
  background: linear-gradient(180deg, #f0f0f0, #c8c8c8);
  border: 1px solid #888;
  border-radius: 4px;
  padding: 4px 16px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
}

.mac-button:hover {
  background: linear-gradient(180deg, #fff, #d8d8d8);
}

.mac-button:active {
  background: linear-gradient(180deg, #c0c0c0, #d8d8d8);
}

/* ============ INPUTS ============ */
.mac-input {
  background: #fff;
  border: 1px solid #888;
  border-radius: 4px;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 12px;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.mac-input:focus {
  outline: 2px solid #2b6bd6;
  outline-offset: 1px;
}

/* ============ WELCOME MESSAGE ============ */
.welcome-content {
  text-align: center;
  padding: 40px;
  color: #444;
}

.welcome-content h1 {
  font-size: 24px;
  margin-bottom: 16px;
  color: #1a4aa3;
}

.welcome-content p {
  font-size: 13px;
  line-height: 1.6;
  max-width: 400px;
  margin: 0 auto;
}

.welcome-icon {
  margin-bottom: 20px;
}

/* ============ UTILITIES ============ */
.text-center {
  text-align: center;
}
.mt-4 {
  margin-top: 16px;
}
.mb-4 {
  margin-bottom: 16px;
}
.flex {
  display: flex;
}
.gap-2 {
  gap: 8px;
}

/* ============ OLLAMA CHAT ============ */
#ollama-window {
  background: linear-gradient(#f6f6f6, #e8e8e8);
}

.ollama-toolbar {
  padding: 8px;
  background: #d6d6d6;
  border-bottom: 1px solid #aaa;
}

.ollama-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ollama-message {
  padding: 8px 12px;
  border-radius: 8px;
  max-width: 80%;
  line-height: 1.4;
  font-size: 12px;
}

.ollama-message.user {
  align-self: flex-end;
  background: #2b6bd6;
  color: #fff;
}

.ollama-message.assistant {
  align-self: flex-start;
  background: #e8e8e8;
  color: #333;
}

.ollama-message .cursor {
  display: inline-block;
  animation: blink 0.6s step-end infinite;
}

.ollama-input-area {
  padding: 8px;
  background: #d6d6d6;
  border-top: 1px solid #aaa;
  display: flex;
  gap: 8px;
}

.ollama-input-area .mac-input {
  flex: 1;
}

.ollama-welcome {
  text-align: center;
  padding: 40px;
  color: #666;
}

.ollama-welcome h2 {
  font-size: 18px;
  color: #2b6bd6;
  margin-bottom: 8px;
}

/* ============ CALCULATOR ============ */
.calc-display {
  background: #333;
  color: #fff;
  font-size: 28px;
  text-align: right;
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 8px;
  font-family: "Charcoal Plus", monospace;
}

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

.calc-btn {
  padding: 12px;
  font-size: 18px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  background: #a0a0a0;
  color: #000;
}

.calc-btn.orange {
  background: #f0a030;
  color: #fff;
}

.calc-btn.gray {
  background: #666;
  color: #fff;
}

.calc-btn.zero {
  grid-column: span 2;
}

.calc-btn:active {
  opacity: 0.7;
}

/* ============ SETTINGS ============ */
.settings-panel {
  display: flex;
  height: 100%;
}

.settings-sidebar {
  width: 140px;
  background: linear-gradient(180deg, #f0f0f0, #e0e0e0);
  border-right: 1px solid #aaa;
  padding: 8px 0;
}

.settings-item {
  padding: 8px 16px;
  cursor: pointer;
  font-size: 12px;
}

.settings-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.settings-item.active {
  background: linear-gradient(90deg, #2b6bd6, #1a4aa3);
  color: #fff;
}

.settings-content {
  flex: 1;
  padding: 20px;
}

.settings-content h2 {
  font-size: 18px;
  margin-bottom: 16px;
  color: #333;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.setting-row label {
  font-size: 12px;
}

/* ============ FOLDER VIEW ============ */
.folder-view {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 16px;
}

.folder-icon {
  width: 72px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px;
}

.folder-icon:hover {
  background: rgba(43, 107, 214, 0.1);
  border-radius: 4px;
}

.folder-icon .icon-img {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.folder-icon .icon-label {
  font-size: 11px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}
