/* ============================================
   HAIR CREATOR 1.0 — CSS Tool
   © 1998-2026 HairSoft Inc. All rights reserved
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --win-bg: #c0c0c0;
  --win-dark: #808080;
  --win-darker: #404040;
  --win-light: #ffffff;
  --win-blue: #000080;
  --win-blue-light: #1084d0;
  --win-text: #000000;
  --win-red: #ff0000;
  --inset: inset 2px 2px 0 #808080, inset -2px -2px 0 #ffffff;
  --raised: inset -2px -2px 0 #808080, inset 2px 2px 0 #ffffff;
  --font: "Courier New", Courier, monospace;
}

body {
  background: var(--win-bg);
  font-family: var(--font);
  font-size: 12px;
  color: #000000;
  min-height: 100vh;
  padding: 8px;
}

/* ---- TITLE BAR ---- */
.title-bar {
  background: linear-gradient(to right, var(--win-blue), var(--win-blue-light));
  color: white;
  padding: 3px 6px;
  font-weight: bold;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.title-bar-text { display: flex; align-items: center; gap: 6px; }
.title-bar-icon { font-size: 14px; }

.title-bar-controls { display: flex; gap: 2px; }
.title-btn {
  width: 16px; height: 14px;
  background: var(--win-bg);
  border: none;
  box-shadow: var(--raised);
  font-size: 9px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font);
  color: black;
}
.title-btn:active { box-shadow: var(--inset); }

/* ---- WINDOW ---- */
.window {
  background: var(--win-bg);
  border: 2px solid;
  border-color: var(--win-light) var(--win-darker) var(--win-darker) var(--win-light);
  max-width: 1100px;
  margin: 0 auto;
}

.window-body { padding: 8px; }

/* ---- MENU BAR ---- */
.menu-bar {
  background: var(--win-bg);
  border-bottom: 1px solid var(--win-dark);
  padding: 2px 4px;
  display: flex; gap: 2px;
  font-size: 12px;
}
.menu-item {
  padding: 2px 8px;
  cursor: default;
  text-decoration: underline;
}
.menu-item:first-child { text-decoration-color: transparent; }
.menu-item:hover { background: var(--win-blue); color: white; }

/* ---- LAYOUT ---- */
.app-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 8px;
  margin-top: 8px;
}

@media (max-width: 700px) {
  .app-layout { grid-template-columns: 1fr; }
}

/* ---- PANEL / GROUPBOX ---- */
.panel {
  background: var(--win-bg);
  border: 2px solid;
  border-color: var(--win-darker) var(--win-light) var(--win-light) var(--win-darker);
  padding: 8px;
  margin-bottom: 6px;
}

.panel-title {
  font-weight: bold;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--win-dark);
  color: var(--win-blue);
  cursor: pointer;
  user-select: none;
}

.panel-title:hover {
  background: var(--win-dark);
  color: white;
  padding: 2px 4px;
  margin: -2px -4px 4px -4px;
}

.panel-toggle {
  display: inline-block;
  width: 12px;
  text-align: center;
  font-weight: bold;
}

.panel-content {
  display: block;
}

/* ---- FORM CONTROLS ---- */
.field { margin-bottom: 6px; display: flex; flex-direction: column; gap: 2px; }
.field label { font-size: 11px; font-weight: bold; color: #000000; }

.field-row { display: flex; align-items: center; gap: 6px; }
.field-row label { font-size: 11px; font-weight: bold; min-width: 90px; color: #000000; }
.field-row .val { font-size: 11px; min-width: 36px; text-align: right; color: #000080; font-weight: bold; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 14px;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--win-darker);
  box-shadow: var(--inset);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 20px;
  background: var(--win-bg);
  box-shadow: var(--raised);
  margin-top: -8px;
  cursor: pointer;
}

input[type="color"] {
  width: 36px; height: 22px;
  border: none;
  box-shadow: var(--inset);
  padding: 1px;
  cursor: pointer;
  background: var(--win-bg);
}

select {
  font-family: var(--font);
  font-size: 12px;
  background: white;
  border: none;
  box-shadow: var(--inset);
  padding: 2px 4px;
  width: 100%;
  cursor: pointer;
}

input[type="checkbox"] { cursor: pointer; width: 13px; height: 13px; }

.checkbox-row { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #000000; }

/* ---- BUTTONS ---- */
.btn {
  font-family: var(--font);
  font-size: 12px;
  background: var(--win-bg);
  border: none;
  box-shadow: var(--raised);
  padding: 4px 12px;
  cursor: pointer;
  min-width: 80px;
  color: #000000;
  font-weight: bold;
}
.btn:active { box-shadow: var(--inset); transform: translate(1px,1px); }
.btn:focus { outline: 1px dotted black; outline-offset: -3px; }

.btn-primary {
  font-weight: bold;
  background: var(--win-bg);
  color: #000000;
}

.btn-row { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }

/* ---- PREVIEW PANEL ---- */
.preview-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preview-window {
  background: white;
  border: 2px solid;
  border-color: var(--win-darker) var(--win-light) var(--win-light) var(--win-darker);
  position: relative;
  overflow: hidden;
  height: 320px;
}

.preview-window:fullscreen {
  height: 100vh;
  border: none;
}

.preview-window:fullscreen .preview-content {
  height: calc(100vh - 22px);
}

.preview-title-bar {
  background: linear-gradient(to right, var(--win-blue), var(--win-blue-light));
  color: white;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: bold;
  display: flex; justify-content: space-between;
}

.preview-content {
  padding: 12px;
  font-family: "Times New Roman", serif;
  font-size: 13px;
  line-height: 1.6;
  color: #333;
  height: calc(100% - 22px);
  overflow-y: auto;
}

.preview-content h2 { font-size: 16px; margin-bottom: 8px; color: #000080; }
.preview-content p { margin-bottom: 8px; }
.preview-content a { color: #0000ee; }

/* ---- THE HAIR ELEMENT IN PREVIEW ---- */
#hair-preview {
  position: absolute;
  pointer-events: none;
  z-index: 9999;
}

/* ---- CODE OUTPUT ---- */
.code-box {
  background: white;
  box-shadow: var(--inset);
  padding: 6px;
  font-family: var(--font);
  font-size: 11px;
  line-height: 1.5;
  white-space: pre;
  overflow-x: auto;
  min-height: 60px;
  color: #000080;
  border: none;
  width: 100%;
  resize: vertical;
}

.copy-success {
  color: var(--win-red);
  font-size: 11px;
  font-weight: bold;
  display: none;
  margin-left: 8px;
}
.copy-success.show { display: inline; }

/* ---- STATUS BAR ---- */
.status-bar {
  background: var(--win-bg);
  border-top: 2px solid;
  border-color: var(--win-darker) var(--win-light) var(--win-light) var(--win-darker);
  padding: 2px 8px;
  font-size: 11px;
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.status-segment {
  box-shadow: var(--inset);
  padding: 1px 6px;
  flex: 1;
}

/* ---- MARQUEE ---- */
.marquee-bar {
  background: var(--win-blue);
  color: yellow;
  font-size: 11px;
  padding: 2px 0;
  overflow: hidden;
  white-space: nowrap;
}
.marquee-bar marquee { display: block; }

/* ---- WOBBLE ANIMATION ---- */
@keyframes wobble {
  0%   { transform: rotate(var(--hair-rotate)) translateX(0px); }
  25%  { transform: rotate(calc(var(--hair-rotate) + 1deg)) translateX(0.5px); }
  75%  { transform: rotate(calc(var(--hair-rotate) - 1deg)) translateX(-0.5px); }
  100% { transform: rotate(var(--hair-rotate)) translateX(0px); }
}

/* ---- CRACK SHAPE ---- */
.shape-crack {
  background: none !important;
  filter: none !important;
  border-radius: 0 !important;
}
.shape-crack::before,
.shape-crack::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 0;
}

/* ---- SCROLLBAR (retro) ---- */
::-webkit-scrollbar { width: 16px; height: 16px; }
::-webkit-scrollbar-track { background: var(--win-bg); box-shadow: var(--inset); }
::-webkit-scrollbar-thumb { background: var(--win-bg); box-shadow: var(--raised); }
::-webkit-scrollbar-button { background: var(--win-bg); box-shadow: var(--raised); display: block; height: 16px; }

/* ---- TOOLTIP ---- */
.tip { font-size: 10px; color: #404040; font-style: italic; margin-top: 1px; }

/* ---- BLINK ---- */
@keyframes blink { 50% { opacity: 0; } }
.blink { animation: blink 1s step-end infinite; }

/* ---- RESPONSIVE ---- */
@media (max-width: 500px) {
  body { padding: 4px; }
  .preview-window { height: 220px; }
}
