/* src/css/styles.css (REPLACE FULL FILE)
   Theme: “80s Mac OS / Classic UI” vibe + upgrades
*/

/* =========================
   Variables
========================= */
:root{
  --desk: #94bee2;
  --desk2:#7eaad3;

  --paper: #ffffff;
  --ink: #000000;
  --muted: rgba(0,0,0,0.65);

  --ui: #ffffff;
  --ui2: #f3f3f3;
  --ui3: #e8e8e8;

  --stroke: #000000;
  --stroke2: rgba(0,0,0,0.35);

  --accent: #000000;
  --danger: #b40000;

  --ui-line: 2px;
  --radius: 10px;

  --font: "Chicago","Geneva","MS Sans Serif",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  --mono: ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* =========================
   Global reset
========================= */
*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: var(--font);
  letter-spacing: -0.015em;
  color: var(--ink);

  background:
    linear-gradient(45deg, rgba(255,255,255,0.0) 25%, rgba(0,0,0,0.08) 25%, rgba(0,0,0,0.08) 75%, rgba(255,255,255,0.0) 75%, rgba(255,255,255,0.0)),
    linear-gradient(45deg, rgba(255,255,255,0.0) 25%, rgba(0,0,0,0.08) 25%, rgba(0,0,0,0.08) 75%, rgba(255,255,255,0.0) 75%, rgba(255,255,255,0.0));
  background-color: var(--desk);
  background-size: 6px 6px;
  background-position: 0 0, 3px 3px;
}

::selection{
  background: var(--ink);
  color: var(--paper);
}

/* =========================
   App Header
========================= */
.app-header{
  padding: 10px 12px 8px;
  display:flex;
  align-items:flex-end;
  gap: 12px;
  justify-content: space-between;
  flex-wrap: wrap;

  position: sticky;
  top: 0;
  z-index: 10;

  background: #000;
  border-bottom: var(--ui-line) solid #000;
}

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

  background: var(--paper);
  border-radius: 14px 14px 0 0;
  padding: 6px 10px 4px;
  border: var(--ui-line) solid #000;
  border-bottom: none;
}

.brand__mark{
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: var(--ui-line) solid #000;
  background: #fff;
  object-fit: cover;
  box-shadow: none;
}

.brand__text{
  display:flex;
  flex-direction:column;
  gap: 1px;
}
.brand__title{
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-size: 14px;
  line-height: 1.05;
}
.brand__subtitle{
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
}

/* =========================
   Tabs
========================= */
.tabs{
  display:flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;

  background: var(--paper);
  border: var(--ui-line) solid #000;
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  padding: 6px 8px 4px;
}

.subtabs{
  display:flex;
  gap: 8px;
  margin: 12px 0 14px;
  flex-wrap: wrap;
}

.tab, .subtab{
  border: var(--ui-line) solid #000;
  background: var(--paper);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0;
  font-size: 13px;
  line-height: 1;

  box-shadow: 2px 2px 0 #000;
  user-select: none;
}

.tab:hover, .subtab:hover{
  background: var(--ui2);
}

.tab.is-active, .subtab.is-active{
  background: var(--ink);
  color: var(--paper);
}

.tab:active, .subtab:active{
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #000;
}

/* =========================
   Layout
========================= */
.app-main{ padding: 16px; }

.panel{ display:none; }
.panel.is-active{ display:block; }

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 980px){
  .grid{ grid-template-columns: 1fr; }
}

/* =========================
   Cards (classic window panels)
========================= */
.card{
  background: var(--paper);
  border: var(--ui-line) solid #000;
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  box-shadow: 6px 6px 0 rgba(0,0,0,0.35);
  position: relative;
}

/* Title bar stripes (requested) */
.card__title{
  font-weight: 900;
  letter-spacing: 0;
  margin: -14px -14px 12px; /* pull to top edge like a title bar */
  padding: 8px 12px;
  border-bottom: var(--ui-line) solid #000;
  border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0;
  text-align: center;
  position: relative;

  /* stripes behind + a “white band” in the center so text stays readable */
  background:
    linear-gradient(#fff,#fff) center / 100% 62% no-repeat,
    repeating-linear-gradient(
      0deg,
      #000 0px,
      #000 2px,
      transparent 2px,
      transparent 5px
    );
}

.card__hint{
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
  margin-top: 10px;
}

/* =========================
   Forms
========================= */
.row{
  display:flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.label{
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0;
  font-weight: 900;
  text-transform: uppercase;
}

input, select, textarea, button{ font: inherit; }

input, select, textarea{
  width:100%;
  border: var(--ui-line) solid #000;
  background: #fff;
  color: #000;
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.25);
}

textarea.textarea{
  resize: vertical;
  min-height: 120px;
}

input:focus, select:focus, textarea:focus{
  box-shadow: 0 0 0 2px #000, 2px 2px 0 rgba(0,0,0,0.25);
}

/* =========================
   Buttons
========================= */
.btn{
  border: var(--ui-line) solid #000;
  background: var(--paper);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 2px 2px 0 #000;
}

.btn:hover{ background: var(--ui2); }
.btn:active{
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #000;
}

.btn.secondary{ background: var(--ui2); }

.btn.danger{
  background: #fff;
  border-color: #000;
  box-shadow: 2px 2px 0 #000;
  position: relative;
}

.btn.danger::after{
  content:"";
  position:absolute;
  inset: -2px;
  border-radius: 12px;
  border: 2px solid rgba(180,0,0,0.35);
  pointer-events:none;
}

/* smaller utility button */
.btn.sm{
  padding: 7px 10px;
  border-radius: 10px;
  font-weight: 900;
  font-size: 12px;
}

/* =========================
   Meta + Code blocks
========================= */
.meta{
  border: var(--ui-line) solid #000;
  background: var(--ui2);
  border-radius: 12px;
  padding: 10px 12px;
  color: rgba(0,0,0,0.75);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.25);
}

.code{
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.35;
  white-space: pre;
  overflow: auto;

  border: var(--ui-line) solid #000;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;

  box-shadow: 2px 2px 0 rgba(0,0,0,0.25);
}

/* segmented controls */
.segmented{
  display:inline-flex;
  gap: 8px;
  align-items:center;
}
.seg{ padding: 8px 12px; }

/* helpers */
.is-hidden{ display:none !important; }

/* =========================
   Lists
========================= */
.list{
  display:flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

/* allow certain lists to scroll */
.list.is-scroll{
  max-height: 58vh;
  overflow: auto;
  padding-right: 4px; /* room for scrollbar thumb border */
}

.list-item{
  border: var(--ui-line) solid #000;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  display:flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;

  box-shadow: 2px 2px 0 rgba(0,0,0,0.25);
}

.list-item__text{
  display:flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.list-item__title{
  font-weight: 900;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item__sub{
  color: rgba(0,0,0,0.65);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* right-side cluster (badge + buttons) */
.list-item__right{
  display:flex;
  align-items:center;
  gap: 8px;
  flex: none;
}

/* checkbox rows */
.check{
  display:flex;
  align-items:center;
  gap: 10px;
  font-weight: 900;
}
.check input{ width:auto; }

/* =========================
   Badges (scope match)
========================= */
.badge{
  border: var(--ui-line) solid #000;
  border-radius: 999px;
  padding: 3px 8px;
  font-weight: 900;
  font-size: 11px;
  line-height: 1;
  box-shadow: 1px 1px 0 #000;
  user-select: none;
  white-space: nowrap;
}
.badge.in{
  background: #000;
  color: #fff;
}
.badge.out{
  background: #fff;
  color: #000;
  position: relative;
}
.badge.out::after{
  content:"";
  position:absolute;
  inset: -2px;
  border-radius: 999px;
  border: 2px solid rgba(180,0,0,0.35);
  pointer-events:none;
}

/* =========================
   Header editor rows
========================= */
.hdr-rows{ display:flex; flex-direction:column; gap: 8px; }
.hdr-row{ display:flex; gap: 8px; align-items:center; }
.hdr-row input{ flex:1; }
.hdr-row .btn{ padding: 9px 10px; }
.hdr-actions{ display:flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.hdr-io{ margin-top: 10px; }

/* =========================
   Diff view
========================= */
.diff .diff-line{ font-family: var(--mono); }
.diff .add{ color:#0a7a1f; }
.diff .del{ color:#b40000; }

/* =========================
   Existing layout quirks you use
========================= */
.row.row-actions{
  flex-direction: row;
  gap: 10px;
}
.row.row-actions .btn{ flex: 1; }

.list-item.is-clickable{ cursor:pointer; }
.list-item.is-clickable:hover{ background: var(--ui2); }

.list-item.is-selected{
  background: #000;
  color: #fff;
  box-shadow: 2px 2px 0 #000;
}
.list-item.is-selected .list-item__sub{ color: rgba(255,255,255,0.78); }
.list-item.is-selected .btn.secondary{
  background: #fff;
  color: #000;
}
.list-item.is-selected .badge.in{
  background: #fff;
  color: #000;
}
.list-item.is-selected .badge.out{
  background: #fff;
  color: #000;
}

/* =========================
   Classic scrollbars (requested)
   - WebKit + Firefox
========================= */
.code, .list.is-scroll{
  scrollbar-width: auto;
  scrollbar-color: #000 #fff;
}

/* WebKit */
.code::-webkit-scrollbar,
.list.is-scroll::-webkit-scrollbar{
  width: 18px;
  height: 18px;
  background: #fff;
}

.code::-webkit-scrollbar-track,
.list.is-scroll::-webkit-scrollbar-track{
  background:
    linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%, #000),
    linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%, #000);
  background-color: #fff;
  background-size: 6px 6px;
  background-position: 0 0, 3px 3px;
  border-left: var(--ui-line) solid #000;
}

.code::-webkit-scrollbar-thumb,
.list.is-scroll::-webkit-scrollbar-thumb{
  background: #fff;
  border: var(--ui-line) solid #000;
  box-shadow: inset 0 0 0 2px #fff;
}

/* Make “active” tabs crisp on dark header */
.app-header .tab.is-active{
  box-shadow: 2px 2px 0 #000;
}

/* Sitemap small indent area */
.sitemap-children{
  margin-left: 14px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sitemap-path{
  font-family: var(--mono);
  font-size: 12px;
}
