/* yumeship.css
   Full styling + theme variables for:
   - data-theme="cotton-candy"  (soft sweets, pastel)
   - data-theme="cottage-core"  (bakery, warm/marroncream)
   - data-theme="lavender"      (yami-kawaii / kuromi-ish)
   Usage: have your root container <div id="yumeship-root" data-theme="cotton-candy"> ... </div>
   This file intentionally uses [data-theme="..."] selectors to switch whole aesthetic.
*/

/* ------------------------------
   Fonts (load from Google in HTML or here via @import)
   - cotton-candy: Poppins (rounded) + Pacifico for display
   - cottage-core: Playfair Display + Josefin Slab
   - lavender: "DM Serif Display", "Press Start 2P" accents
------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;500;700&family=Pacifico&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Josefin+Sans:wght@300;400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Nunito:wght@300;600&display=swap');

/* ------------------------------
   Base variables & layout
------------------------------- */
:root {
  --max-width: 1100px;
  --gutter: 1.25rem;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --muted: #6b4a63;
  --ui-padding: 18px;
  --shadow-soft: 0 10px 30px rgba(100,50,80,0.08);
  --shadow-strong: 0 18px 50px rgba(40,10,40,0.12);
  --glass: rgba(255,255,255,0.6);
  --accent: #ff80b5; /* default accent */
  --fill-color: #ffb3d1;
  --track-color: #ffeef8;
}

/* page shell */
html,body { height:100%; }
body {
  margin:0;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: var(--muted);
  background: linear-gradient(180deg, #fff9fb 0%, #fff6fb 100%);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  padding: calc(var(--gutter) * 1.25);
  display:flex;
  justify-content:center;
}

/* root wrapper */
#yumeship-root {
  width:100%;
  max-width:var(--max-width);
  margin:0 auto;
  position:relative;
  transition: background 400ms ease, color 400ms ease;
}

/* common UI modules */
.soft-card {
  background: var(--panel-bg, rgba(255,255,255,0.9));
  border-radius: var(--radius-lg);
  padding: var(--ui-padding);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(0,0,0,0.03);
  display:flex;
  gap:18px;
  align-items:center;
}

.soft-panel {
  background: var(--panel-bg, rgba(255,255,255,0.85));
  padding: 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

/* header layout */
.ship-header {
  display:grid;
  grid-template-columns: 120px 1fr auto;
  gap:18px;
  align-items:center;
  margin-bottom:16px;
}

/* avatar */
.large-avatar, .id-avatar {
  width:120px;
  height:120px;
  border-radius:18px;
  overflow:hidden;
  flex:0 0 120px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
  border: 6px solid rgba(255,255,255,0.6);
  background: linear-gradient(180deg,#fff,#fff0f7);
}
.large-avatar img, .id-avatar img { width:100%; height:100%; object-fit:cover; display:block; }

/* header text */
.ship-title {
  margin:0;
  font-family: "Pacifico", cursive;
  font-size:1.9rem;
  color: var(--accent);
  display:flex;
  gap:12px;
  align-items:center;
}
.ship-sub { font-size:0.85rem; color:var(--muted); margin-left:8px; }

/* meta pills */
.header-meta { margin-top:8px; display:flex; gap:8px; flex-wrap:wrap; }
.meta-pill {
  background: linear-gradient(180deg, var(--pill-bg, #fff), var(--pill-bg-2, #fff) );
  padding:6px 10px;
  border-radius:999px;
  font-size:0.85rem;
  color:var(--pill-text, #7a5476);
  box-shadow: 0 6px 18px rgba(0,0,0,0.03);
}

/* header links */
.header-links { margin-top:10px; display:flex; gap:8px; align-items:center; }
.header-links a { font-weight:600; color:var(--link); text-decoration:none; padding:6px 8px; border-radius:12px; }
.header-links a:hover { text-decoration:underline; }

/* tiny utilities */
.muted { color: #9b7b99; font-size:0.95rem; }
.btn { display:inline-block; background:linear-gradient(180deg,var(--btn-1,var(--accent)),var(--btn-2,#ff5d9a)); color:white; padding:8px 12px; border-radius:12px; text-decoration:none; font-weight:700; box-shadow:var(--shadow-strong); border: none; cursor:pointer; }
.btn.small { padding:6px 8px; font-size:0.9rem; }

/* main layout sections */
.ship-main { display:grid; gap:16px; margin-bottom:18px; }
.section { display:block; }

/* ID cards grid */
.id-grid { display:grid; grid-template-columns: 1fr 1fr; gap:16px; margin-top:12px; }
.id-card { border-radius:14px; padding:12px; background:var(--card-bg, rgba(255,255,255,0.95)); box-shadow:0 8px 18px rgba(0,0,0,0.04); border:1px solid rgba(0,0,0,0.03); }
.id-top { display:flex; gap:12px; align-items:center; }
.id-info h3 { margin:0; color:var(--accent); font-weight:700; }
.id-tags .tag { background:linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.6)); padding:6px 8px; border-radius:10px; margin-right:6px; display:inline-block; font-weight:600; }

/* id-bio editable */
.id-bio { background:transparent; border-left:3px dashed rgba(0,0,0,0.03); padding-left:10px; margin-top:8px; }

/* thermometers grid */
.thermo-grid { display:flex; flex-direction:column; gap:12px; margin-top:12px; }
.thermo-item { display:flex; flex-direction:column; gap:8px; }
.thermo-label { font-weight:700; color:var(--accent); }

/* thermo controls layout */
.thermo-controls { display:flex; gap:12px; align-items:center; }

/* side label */
.thermo-side { width:100%; display:flex; align-items:center; gap:10px; }

/* style the range inputs: modern filled track using --percent variable */
.thermo-range {
  -webkit-appearance:none;
  width:100%;
  height:12px;
  border-radius:999px;
  background: linear-gradient(90deg, var(--fill-color) var(--percent,50%), var(--track-color, #f3e8ef) var(--percent,50%));
  outline:none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
  transition: background 160ms linear;
  cursor:pointer;
}

/* thumb */
.thermo-range::-webkit-slider-thumb{
  -webkit-appearance:none;
  appearance:none;
  width:22px; height:22px; border-radius:50%;
  box-shadow:0 6px 18px rgba(0,0,0,0.18);
  border:4px solid white;
  background: var(--thumb, var(--accent));
}
.thermo-value { min-width:36px; text-align:center; font-weight:700; color:var(--muted); }

/* bags */
.bags-grid { display:grid; grid-template-columns: 1fr 1fr; gap:16px; margin-top:12px; }
.bag-wrap h3 { margin:0 0 8px 0; color:var(--accent); }
.bag-svg { margin-bottom:10px; }
.bag-items { display:flex; gap:10px; align-items:flex-start; flex-wrap:wrap; }
.bag-item { width:86px; text-align:center; border-radius:10px; padding:6px; background:linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,250,255,0.95)); box-shadow: 0 6px 18px rgba(0,0,0,0.04); }
.bag-item img { width:64px; height:64px; object-fit:cover; border-radius:8px; display:block; margin:0 auto 6px; }

/* moodboard */
.aesthetic-grid { display:grid; grid-template-columns: 1fr 320px; gap:16px; margin-top:12px; }
.mood-thumbs { display:grid; grid-template-columns: repeat(2,1fr); gap:8px; }
.mood-thumbs img { width:100%; height:100px; object-fit:cover; border-radius:10px; box-shadow:0 6px 18px rgba(0,0,0,0.04); }

/* swatches */
.swatches { display:flex; gap:8px; margin-top:8px; }
.swatch { width:56px; height:56px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:0.7rem; color:#4a2b48; box-shadow:0 6px 18px rgba(0,0,0,0.03); }

/* gallery */
.gallery-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap:8px; margin-top:12px; }
.thumb img { width:100%; height:140px; object-fit:cover; border-radius:12px; display:block; }

/* footer */
.ship-footer { margin-top:8px; text-align:center; padding:12px; border-radius:12px; }

/* responsive */
@media (max-width:980px){
  .ship-header { grid-template-columns: 96px 1fr; }
  .aesthetic-grid { grid-template-columns: 1fr; }
  .id-grid { grid-template-columns: 1fr; }
  .bags-grid { grid-template-columns: 1fr; }
}

/* ------------------------------
   THEME: COTTON-CANDY
   full pastel, soft rounded corners, floating sparkles motif
------------------------------- */
[data-theme="cotton-candy"] {
  --accent: #ff66aa;
  --fill-color: #ffb3d1;
  --track-color: #fff0f7;
  --panel-bg: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,248,250,0.96));
  --pill-bg: rgba(255,255,255,0.98);
  --pill-bg-2: rgba(255,245,250,0.96);
  --pill-text: #b65a86;
  --link: #ff6fa7;
  --btn-1: #ff8abb;
  --btn-2: #ff5d9a;
  --thumb: #ff66aa;
  --card-bg: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,250,253,0.98));
  --swatch-text: #7a4f73;
  font-family: "Poppins", "Nunito", system-ui;
}

/* extra cotton-candy decorations */
[data-theme="cotton-candy"] #yumeship-root {
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255,214,235,0.18) 0 60px, transparent 60px),
    radial-gradient(circle at 90% 80%, rgba(219,240,255,0.08) 0 120px, transparent 120px);
}

/* slight more rounded corners for cotton-candy */
[data-theme="cotton-candy"] .soft-card { border-radius: 30px; }

/* subtle floating sugar motif layer (CSS-only fallback) */
[data-theme="cotton-candy"] #theme-motif-layer {
  pointer-events:none;
  position:absolute;
  inset:0;
  z-index:0;
}

/* ------------------------------
   THEME: COTTAGE-CORE
   warm bakery, marroncream, hand-drawn border option + paper textures
   uses serif headings + layered papercraft card effect
------------------------------- */
[data-theme="cottage-core"] {
  --accent: #8b5e3c; /* warm bakery brown */
  --fill-color: #e8cfa8;
  --track-color: #fbf3ea;
  --panel-bg: linear-gradient(180deg, #fffdf9 0%, #fff9f0 100%);
  --pill-bg: #fff9f5;
  --pill-bg-2: #fff3eb;
  --pill-text: #8b5e3c;
  --link: #a8623b;
  --btn-1: #d99a6b;
  --btn-2: #c77a4c;
  --thumb: #b36b44;
  --card-bg: linear-gradient(180deg, rgba(255,250,246,0.98), rgba(255,248,244,0.98));
  font-family: "Playfair Display", "Josefin Sans", serif;
  --swatch-text: #6b4733;
}

/* cottagecore textures + papercraft layering */
[data-theme="cottage-core"] #yumeship-root {
  background-image:
    linear-gradient(180deg, #fffaf3 0%, #fff6ee 100%),
    url('/assets/theme/cottage/papertop.png'); /* optional texture; replace or remove if not provided */
  background-blend-mode: overlay;
}

/* papercraft layered card effect */
[data-theme="cottage-core"] .soft-card {
  border-radius: 18px;
  box-shadow:
    0 6px 18px rgba(0,0,0,0.06),
    0 1px 0 rgba(255,255,255,0.6) inset;
  border: 1px solid rgba(0,0,0,0.04);
  position:relative;
}

/* hand-drawn border simulation (SVG mask fallback) */
[data-theme="cottage-core"] .id-card,
[data-theme="cottage-core"] .soft-panel {
  border: 0;
  box-shadow: none;
  background: linear-gradient(180deg,#fffdf8,#fff9f2);
  padding:16px;
  border-radius:12px;
  outline: 4px solid rgba(255,255,255,0.6); /* gives slightly raised paper look */
  filter: drop-shadow(0 8px 18px rgba(120,60,30,0.06));
}

/* slightly different layout: make avatars smaller & text more columnar */
[data-theme="cottage-core"] .ship-header { grid-template-columns: 96px 1fr auto; }
[data-theme="cottage-core"] .large-avatar { width:96px; height:96px; border-radius:14px; }

/* decorative motifs (bakery icons) shown in motif layer */
[data-theme="cottage-core"] #theme-motif-layer { pointer-events:none; position:absolute; inset:0; }

/* ------------------------------
   THEME: LAVENDER (yami-kawaii / kuromi)
   darker purples, black allowed, more angular, gothic-kawaii motifs
------------------------------- */
[data-theme="lavender"] {
  --accent: #d89be8;
  --fill-color: #9b66e6;
  --track-color: #2b1730;
  --panel-bg: linear-gradient(180deg, rgba(18,8,20,0.85), rgba(28,12,30,0.9));
  --pill-bg: rgba(255,255,255,0.03);
  --pill-bg-2: rgba(255,255,255,0.02);
  --pill-text: #e9c7ff;
  --link: #d9a3ff;
  --btn-1: #a24bd5;
  --btn-2: #6f2fa9;
  --thumb: #d89be8;
  --card-bg: linear-gradient(180deg, rgba(28,12,30,0.9), rgba(18,8,26,0.92));
  color: #f1e9f8;
  font-family: "DM Serif Display", "Nunito", serif;
  --swatch-text: #f6e9ff;
}

/* darker page background & lace overlay */
[data-theme="lavender"] #yumeship-root {
  background: radial-gradient(ellipse at 10% 20%, rgba(255,255,255,0.02), transparent 80%),
              linear-gradient(180deg,#120616 0%,#1b0c22 100%);
  color: #f3e7f9;
}

/* lavender cards - darker glass */
[data-theme="lavender"] .soft-card,
[data-theme="lavender"] .soft-panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.04);
  box-shadow: 0 18px 50px rgba(0,0,0,0.6);
}

/* sharper corners allowed in lavender */
[data-theme="lavender"] .soft-card { border-radius: 12px; }
[data-theme="lavender"] .large-avatar { width:110px; height:110px; border-radius:12px; border: 4px solid rgba(255,255,255,0.03); }

/* motif layer for falling hearts / tiny crosses */
[data-theme="lavender"] #theme-motif-layer { pointer-events:none; position:absolute; inset:0; z-index:0; }

/* ------------------------------
   THERMO brand & thumb color mapping per theme
------------------------------- */
[data-theme="cotton-candy"] .thermo-range { --fill-color: var(--fill-color); --track-color: var(--track-color); }
[data-theme="cottage-core"] .thermo-range { --fill-color: var(--fill-color); --track-color: var(--track-color); }
[data-theme="lavender"] .thermo-range { --fill-color: var(--fill-color); --track-color: rgba(255,255,255,0.04); }

/* ------------------------------
   Focus styles (only show when keyboard nav used)
------------------------------- */
.show-focus :focus { outline: 3px dashed rgba(255,150,210,0.18); outline-offset:4px; border-radius:8px; }

/* ------------------------------
   THEME-SPECIFIC ICON & PNG PLACEHOLDERS
   (replace the url(...) paths with your PNGs in /assets/theme/...)
------------------------------- */
[data-theme="cottage-core"] .swatch { box-shadow: 0 6px 16px rgba(120,60,20,0.06); }
[data-theme="cottage-core"] #yumeship-root { background-image: url('/assets/theme/cottage/pattern.png'), linear-gradient(180deg,#fffaf3,#fff6ee); background-blend-mode: overlay; }

/* ------------------------------
   Motif styles: single layer element that JS will populate with <span class="motif motif-xxx">
------------------------------- */
#theme-motif-layer { position:absolute; inset:0; z-index:0; pointer-events:none; overflow:hidden; }
.motif {
  position:absolute; will-change: transform, opacity;
  display:block;
  width:var(--motif-size, 22px);
  height:var(--motif-size, 22px);
  opacity:.95;
  transform: translate3d(0, -10vh, 0);
  animation: motif-fall linear infinite;
}
.motif img { width:100%; height:100%; display:block; }

/* motif falling animation */
@keyframes motif-fall {
  0% { transform: translate3d(var(--x,0), -12vh, 0) rotate(var(--r,0deg)); opacity:0; }
  6% { opacity:1; }
  100% { transform: translate3d(calc(var(--x,0) + var(--drift, 40px)), 120vh, 0) rotate(calc(var(--r,0deg) + 360deg)); opacity:0.9; }
}

/* ------------------------------
   Accessibility: prefer-reduced-motion
------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .motif { animation: none !important; transform:none !important; display:none !important; }
  .thermo-range { transition: none !important; }
}

/* ------------------------------
   Helper: colored swatch labels
------------------------------- */
.swatch span { font-size:0.68rem; color: var(--swatch-text); font-weight:700; }

/* ------------------------------
   End of stylesheet
------------------------------- */
