@import "tailwindcss";

/* ═══════════════════════════════════════════════════════
   PASTEL SCRAPBOOK — Syamsu Files v6
   SINGLE-SCREEN APP — Comfortable & Modern sizing
   ═══════════════════════════════════════════════════════ */

/* ─── Light Theme (Paper) ─── */
:root, .theme-paper {
  --bg-start: #f0e6ff;
  --bg-end: #fce4ec;
  --bg-grid: rgba(180, 160, 210, 0.15);

  --panel: #fffbfe;
  --panel-alt: #f8f0ff;
  --panel-hover: #f3eaff;

  --ink: #3d2c5e;
  --ink-secondary: #6b5a8a;
  --ink-muted: #9a8bb5;
  --ink-faint: #c7bdd8;

  --border: #7c6b9e;
  --border-soft: #c4b5de;
  --border-faint: #e4daf0;

  --accent: #9b6dd7;
  --accent-hover: #8a5bc8;
  --accent-text: #ffffff;
  --accent-soft: #ede0ff;

  --pink: #e879a8;
  --pink-soft: #fde8f0;
  --teal: #618cc8;
  --teal-soft: #e0f5f3;
  --yellow: #f0c24a;
  --yellow-soft: #fff8e1;
  --blue: #6fa8dc;
  --blue-soft: #e3f0ff;

  --danger: #d94f5c;
  --danger-hover: #c43a47;
  --danger-bg: #ffeaec;
  --danger-text: #ffffff;

  --success: #4caf7d;
  --success-bg: #e8f8ef;

  --warning: #e8a930;
  --warning-bg: #fff8e1;

  --input-bg: #ffffff;
  --input-border: #c4b5de;
  --input-focus: #9b6dd7;

  --shadow-card: 4px 4px 0px var(--border);
  --shadow-card-hover: 5px 5px 0px var(--border), 0 6px 20px rgba(155, 109, 215, 0.12);
  --shadow-btn: 3px 3px 0px var(--border);
  --shadow-btn-active: 0px 0px 0px var(--border);
  --shadow-toast: 4px 4px 0px var(--border-soft);

  --scrollbar-thumb: #c4b5de;
  --scrollbar-track: #f0e6ff;
}

/* ─── Dark Theme (Midnight) ─── */
.theme-midnight {
  --bg-start: #1a1028;
  --bg-end: #0f1a24;
  --bg-grid: rgba(120, 90, 200, 0.08);

  --panel: #231838;
  --panel-alt: #2c2044;
  --panel-hover: #342850;

  --ink: #e8dcff;
  --ink-secondary: #c4b5de;
  --ink-muted: #8a7aaa;
  --ink-faint: #5a4a7a;

  --border: #7a60b0;
  --border-soft: #4a3870;
  --border-faint: #352650;

  --accent: #b48aef;
  --accent-hover: #c9a5ff;
  --accent-text: #1a1028;
  --accent-soft: #352660;

  --pink: #ff7eb3;
  --pink-soft: #3a1a2a;
  --teal: #56d4c8;
  --teal-soft: #0f2a28;
  --yellow: #ffd966;
  --yellow-soft: #2a2510;
  --blue: #7abfff;
  --blue-soft: #0f1a2a;

  --danger: #ff6b7a;
  --danger-hover: #ff4d5e;
  --danger-bg: #3a1520;
  --danger-text: #ffffff;

  --success: #56d49a;
  --success-bg: #0f2a1a;

  --warning: #ffc84a;
  --warning-bg: #2a2510;

  --input-bg: #1a1028;
  --input-border: #4a3870;
  --input-focus: #b48aef;

  --shadow-card: 4px 4px 0px rgba(0,0,0,0.5);
  --shadow-card-hover: 5px 5px 0px rgba(0,0,0,0.5), 0 6px 24px rgba(180, 138, 239, 0.15);
  --shadow-btn: 3px 3px 0px rgba(0,0,0,0.5);
  --shadow-btn-active: 0px 0px 0px rgba(0,0,0,0.5);
  --shadow-toast: 4px 4px 0px rgba(0,0,0,0.4);

  --scrollbar-thumb: #4a3870;
  --scrollbar-track: #1a1028;
}

/* ─── CRITICAL: Single-screen — no page scroll ─── */
*, *::before, *::after {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body, #root {
  height: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
  background-attachment: fixed;
}

/* Grid paper background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

body > #root {
  position: relative;
  z-index: 1;
}

::selection {
  background: var(--accent);
  color: var(--accent-text);
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border: 2px solid var(--scrollbar-track);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ═══ APP SHELL ═══ */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 12px 12px 0 12px;
  gap: 8px;
  position: relative;
}
@media (min-width: 768px) {
  .app-shell { padding: 16px 16px 0 16px; gap: 10px; }
}
@media (min-width: 1280px) {
  .app-shell { padding: 20px 20px 0 20px; }
}

.app-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* ═══ WINDOW CARD ═══ */
.window-card {
  background: var(--panel);
  border: 2.5px solid var(--border);
  box-shadow: var(--shadow-card);
  border-radius: 14px;
  overflow: hidden;
}

.window-header {
  background: linear-gradient(135deg, var(--accent), var(--pink));
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2.5px solid var(--border);
  min-height: 44px;
  flex-shrink: 0;
}

.window-dots {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.window-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,0.2);
}
.window-dot-red { background: #ff6b6b; }
.window-dot-yellow { background: #ffd93d; }
.window-dot-green { background: #6bcb77; }

.window-title {
  flex: 1;
  font-weight: 700;
  font-size: 14px;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window-body {
  padding: 20px;
}

/* ═══ BUTTONS ═══ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border: 2.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s, box-shadow 0.1s;
  box-shadow: var(--shadow-btn);
  font-family: inherit;
  line-height: 1.3;
  white-space: nowrap;
}
.btn:active {
  transform: translate(3px, 3px);
  box-shadow: var(--shadow-btn-active);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}
.btn:focus-visible {
  outline: 2.5px dashed var(--accent);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent-hover);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-secondary {
  background: var(--panel);
  color: var(--ink);
}
.btn-secondary:hover:not(:disabled) { background: var(--panel-hover); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--ink-secondary);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--panel-hover);
  border-color: var(--border-faint);
}
.btn-ghost:active {
  transform: none;
  box-shadow: none;
}

.btn-danger {
  background: var(--danger);
  color: var(--danger-text);
  border-color: var(--danger-hover);
}
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 8px;
  border-width: 2px;
  gap: 6px;
  box-shadow: 2px 2px 0px var(--border);
}
.btn-sm:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px var(--border);
}

.btn-icon {
  padding: 8px;
  min-width: 36px;
  min-height: 36px;
}

/* ═══ INPUTS ═══ */
.input {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: var(--input-bg);
  border: 2.5px solid var(--input-border);
  border-radius: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 4px rgba(155, 109, 215, 0.2);
}
.input::placeholder {
  color: var(--ink-muted);
}
.input-sm {
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 8px;
}

/* ═══ BADGES ═══ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 6px;
  border: 2px solid;
  white-space: nowrap;
}
.badge-pink { background: var(--pink-soft); color: var(--pink); border-color: var(--pink); }
.badge-teal { background: var(--teal-soft); color: var(--teal); border-color: var(--teal); }
.badge-blue { background: var(--blue-soft); color: var(--blue); border-color: var(--blue); }
.badge-yellow { background: var(--yellow-soft); color: var(--yellow); border-color: var(--yellow); }
.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* ═══ PROGRESS BAR ═══ */
.progress-track {
  height: 20px;
  background: var(--panel-alt);
  border: 2px solid var(--border-soft);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: repeating-linear-gradient(
    -45deg,
    var(--accent),
    var(--accent) 6px,
    var(--accent-hover) 6px,
    var(--accent-hover) 12px
  );
  background-size: 17px 100%;
  animation: progressStripe 0.6s linear infinite;
  transition: width 0.3s ease;
}
.progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  text-shadow: 0 0 4px var(--panel);
}
@keyframes progressStripe {
  0% { background-position: 0 0; }
  100% { background-position: 17px 0; }
}

/* ═══ FILE ROW ═══ */
.file-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1.5px dashed var(--border-faint);
  transition: background 0.1s;
  cursor: default;
  gap: 12px;
}
.file-row:hover {
  background: var(--panel-hover);
}
.file-row:last-child {
  border-bottom: none;
}

.file-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid;
  font-size: 18px;
}

/* ═══ TOAST ═══ */
.toast-scrapbook {
  background: var(--panel) !important;
  color: var(--ink) !important;
  border: 2.5px solid var(--border) !important;
  border-radius: 10px !important;
  box-shadow: var(--shadow-toast) !important;
  font-size: 14px !important;
  padding: 12px 16px !important;
  font-family: inherit !important;
}

/* ═══ SKELETON ═══ */
@keyframes skeletonPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}
.skeleton {
  background: var(--border-faint);
  border-radius: 6px;
  animation: skeletonPulse 1.5s ease-in-out infinite;
}

/* ═══ STICKER DECO ═══ */
.deco-sparkle {
  position: absolute;
  pointer-events: none;
  opacity: 0.1;
  font-size: 24px;
}
.theme-midnight .deco-sparkle {
  opacity: 0.06;
}

/* ═══ DROPDOWN MENU ═══ */
.dropdown-content {
  background: var(--panel);
  border: 2.5px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  padding: 4px;
  min-width: 200px;
  z-index: 100;
  animation: dropdownIn 0.12s ease-out;
}
@keyframes dropdownIn {
  from { opacity: 0; transform: scale(0.95) translateY(-4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.dropdown-item {
  padding: 10px 14px;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  transition: background 0.1s;
  outline: none;
}
.dropdown-item:hover, .dropdown-item[data-highlighted] {
  background: var(--accent-soft);
  color: var(--accent);
}
.dropdown-item-danger:hover, .dropdown-item-danger[data-highlighted] {
  background: var(--danger-bg);
  color: var(--danger);
}
.dropdown-separator {
  height: 1.5px;
  background: var(--border-faint);
  margin: 4px 0;
}

/* ═══ DIALOG ═══ */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 50;
  animation: fadeIn 0.15s ease;
}
.theme-midnight .dialog-overlay {
  background: rgba(0, 0, 0, 0.6);
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.dialog-content {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  width: 94%;
  animation: dialogIn 0.2s ease-out;
}
@keyframes dialogIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ═══ TOOLTIP ═══ */
.tooltip-content {
  background: var(--ink);
  color: var(--panel);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  animation: fadeIn 0.1s ease;
  z-index: 200;
}

/* ═══ TASKBAR ═══ */
.taskbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--panel);
  border-top: 2.5px solid var(--border);
  border-left: 2.5px solid var(--border);
  border-right: 2.5px solid var(--border);
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -3px 12px rgba(0,0,0,0.08);
  position: relative;
  z-index: 10;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}
.theme-midnight .taskbar {
  box-shadow: 0 -3px 16px rgba(0,0,0,0.3);
}

/* Start button */
.taskbar-start-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 16px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  color: var(--accent-text);
  background: linear-gradient(135deg, var(--accent), var(--pink));
  border: 2.5px solid var(--accent-hover);
  border-radius: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: transform 0.1s, box-shadow 0.1s;
  white-space: nowrap;
}
.taskbar-start-btn:active {
  transform: translate(3px, 3px);
  box-shadow: var(--shadow-btn-active);
}
.taskbar-start-btn:hover {
  filter: brightness(1.1);
}
.taskbar-start-icon {
  font-size: 18px;
}
.taskbar-start-text {
  display: none;
}
@media (min-width: 480px) {
  .taskbar-start-text { display: inline; }
}

/* Taskbar windows */
.taskbar-windows {
  display: flex;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}
.taskbar-window-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--ink-secondary);
  background: var(--panel-alt);
  border: 2px solid var(--border-soft);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.1s;
}
.taskbar-window-btn:hover {
  background: var(--panel-hover);
  border-color: var(--border);
}
.taskbar-window-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

/* System tray */
.taskbar-tray {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
  border-left: 2px solid var(--border-faint);
  margin-left: 6px;
}
.taskbar-tray-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--ink-muted);
}
.taskbar-tray-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 2px solid var(--border-faint);
  background: transparent;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: all 0.1s;
  font-family: inherit;
}
.taskbar-tray-btn:hover {
  background: var(--panel-hover);
  border-color: var(--border);
  color: var(--ink);
}

/* ═══ START MENU ═══ */
.start-menu-content {
  background: var(--panel);
  border: 2.5px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-card), 0 10px 40px rgba(0,0,0,0.15);
  min-width: 260px;
  overflow: hidden;
  animation: startMenuIn 0.15s ease-out;
  z-index: 200;
}
@keyframes startMenuIn {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.start-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  border-bottom: 2.5px solid var(--border);
}
.start-menu-body {
  padding: 6px;
}
.start-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  border-radius: 10px;
  cursor: pointer;
  outline: none;
  transition: background 0.1s;
}
.start-menu-item:hover, .start-menu-item[data-highlighted] {
  background: var(--accent-soft);
  color: var(--accent);
}
.start-menu-item-danger:hover, .start-menu-item-danger[data-highlighted] {
  background: var(--danger-bg);
  color: var(--danger);
}
.start-menu-separator {
  height: 1.5px;
  background: var(--border-faint);
  margin: 4px 10px;
}

/* ═══ Responsive ═══ */
@media (max-width: 640px) {
  .btn { min-height: 40px; padding: 10px 18px; font-size: 15px; }
  .input { min-height: 40px; padding: 10px 14px; font-size: 16px; }
  .taskbar { padding: 6px; gap: 4px; }
  .taskbar-start-btn { padding: 3px 12px; }
  .taskbar-window-btn { padding: 10px 10px; font-size: 13px; }
  .start-menu-item { padding: 14px 16px; font-size: 16px; min-height: 48px; }
}

/* ═══ Radix z-index ═══ */
[data-radix-popper-content-wrapper] {
  z-index: 100 !important;
}
