/* ============================================================
   Hotel De Plataan — AI Social Media Studio
   Warm boutique-hotel design tokens (sage + cream)
   ============================================================ */

:root {
  /* Ink — warm charcoal → warm greys, used for text, buttons, headings */
  --ink-900: #2B2722;
  --ink-800: #3A352E;
  --ink-700: #4D4639;
  --ink-600: #6B6356;
  --ink-500: #8A8173;
  --ink-400: #A99F8E;
  --ink-300: #C9C0AF;
  --ink-200: #E2DACB;
  --ink-100: #EDE7DB;
  --ink-50:  #F6F2EA;

  /* Brand accent (sage green) — calm, natural, hospitality */
  --sage-600: #586848;
  --sage-500: #6E7F5C;
  --sage-400: #8A9B76;
  --sage-300: #A9B898;
  --sage-200: #CBD6BD;
  --sage-100: #E6ECDD;

  /* Secondary warm accent (terracotta) — for occasional highlights */
  --terra-500: #B5764F;
  --terra-100: #F3E3D7;

  /* Surfaces */
  --surface:    #FFFEFC;       /* near-white, faint warmth */
  --canvas:     #FAF7F2;       /* warm cream */
  --canvas-2:   #F5F1E8;
  --border:     #E9E2D6;       /* soft taupe */
  --border-strong: #D8CFC0;

  /* Semantic (warmed slightly to sit on cream) */
  --success: #4F7A43;
  --success-bg: #E7EFDF;
  --warning: #B07A1E;
  --warning-bg: #F6EAD2;
  --danger:  #C0563F;
  --danger-bg:  #F5E2DB;
  --info:    #4A7BA6;
  --info-bg: #E5EDF3;

  /* Platform brand colors (subtle use in badges) */
  --p-instagram: #E1306C;
  --p-tiktok:    #111111;
  --p-linkedin:  #0A66C2;
  --p-facebook:  #1877F2;
  --p-x:         #111111;
  --p-youtube:   #FF0000;

  /* Primary (overridable via Tweaks) */
  --primary:        var(--ink-900);
  --primary-hover:  var(--ink-800);
  --primary-fg:     #FAF7F2;
  --accent:         var(--sage-500);
  --accent-fg:      #FFFEFC;        /* readable text on the sage accent */
  --accent-soft:    var(--sage-100);
  --accent-ring:    rgba(110, 127, 92, 0.40);

  /* Type */
  --font-sans:  "Geist", "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Fraunces", "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-mono:  "Geist Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Type scale */
  --t-display:   44px;
  --t-h1:        32px;
  --t-h2:        24px;
  --t-h3:        18px;
  --t-body:      14px;
  --t-small:     13px;
  --t-xs:        12px;
  --t-micro:     11px;

  /* Radii */
  --r-xs:  6px;
  --r-sm:  10px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-xl:  28px;
  --r-pill: 999px;

  /* Spacing — 4px grid */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;

  /* Shadows — soft, warm-tinted, layered */
  --sh-xs: 0 1px 0 rgba(43, 39, 34, 0.03), 0 1px 2px rgba(43, 39, 34, 0.04);
  --sh-sm: 0 1px 0 rgba(43, 39, 34, 0.03), 0 2px 8px rgba(43, 39, 34, 0.05);
  --sh-md: 0 6px 18px rgba(43, 39, 34, 0.06), 0 1px 0 rgba(43, 39, 34, 0.02);
  --sh-lg: 0 16px 40px rgba(43, 39, 34, 0.09), 0 2px 8px rgba(43, 39, 34, 0.04);
  --sh-pop: 0 20px 48px rgba(43, 39, 34, 0.16);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.32, 0.64, 1);
  --dur-fast: 120ms;
  --dur: 200ms;
  --dur-slow: 320ms;
}

/* ============================================================
   Base
   ============================================================ */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--ink-900);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

button { background: none; border: 0; padding: 0; cursor: pointer; }

a { color: inherit; text-decoration: none; }

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

/* ============================================================
   Utilities
   ============================================================ */

.font-mono { font-family: var(--font-mono); font-feature-settings: "zero", "ss01"; }
.tabular { font-variant-numeric: tabular-nums; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: -0.005em;
  background: var(--ink-100);
  color: var(--ink-700);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.tag-success { background: var(--success-bg); color: var(--success); border-color: transparent; }
.tag-warning { background: var(--warning-bg); color: var(--warning); border-color: transparent; }
.tag-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: transparent; }
.tag-info    { background: var(--info-bg);    color: var(--info);    border-color: transparent; }
.tag-accent  { background: var(--accent-soft); color: var(--ink-900); border-color: transparent; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  font-size: var(--t-body);
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink-900);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--sh-xs);
  transition: transform var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.btn:hover { background: var(--ink-50); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; }

.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, var(--sh-sm);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-accent {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: transparent;
  box-shadow: var(--sh-sm);
}
.btn-accent:hover { background: var(--sage-600); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.btn-ghost:hover { background: var(--ink-100); }

.btn-sm { height: 30px; padding: 0 10px; font-size: var(--t-small); border-radius: 8px; }
.btn-lg { height: 44px; padding: 0 18px; font-size: 15px; border-radius: var(--r-md); }
.btn-icon { width: 36px; padding: 0; }

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-xs);
}

/* Input */
.input {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: var(--t-body);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  width: 100%;
}
.input:focus-within {
  border-color: var(--ink-700);
  box-shadow: 0 0 0 3px var(--accent-ring);
  outline: none;
}
.input input {
  border: 0;
  outline: 0;
  background: transparent;
  flex: 1;
  min-width: 0;
  font-size: inherit;
}
.input input::placeholder { color: var(--ink-400); }

/* Avatar */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--sage-400), var(--sage-200));
  color: var(--ink-900);
  font-weight: 600;
  font-size: var(--t-small);
  letter-spacing: -0.01em;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* Headings — serif for a warm, editorial hotel feel */
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
h1, h2, h3 {
  font-family: var(--font-serif);
  letter-spacing: -0.01em;
  font-weight: 500;
}
h4 { letter-spacing: -0.02em; }
h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }

.muted { color: var(--ink-500); }
.tiny { font-size: var(--t-xs); color: var(--ink-500); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-500);
}

/* Scrollbar — soft */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--ink-200); border-radius: 999px; border: 2px solid var(--canvas); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-300); }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   Polish — motion, interactive states, loading & empty
   ============================================================ */

/* Screen entrance — content fades + lifts gently on view change */
@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.view-enter { animation: viewIn var(--dur-slow) var(--ease-out) both; }

/* Staggered list items (set animation-delay inline per index) */
.stagger-item { animation: viewIn var(--dur) var(--ease-out) both; }

/* Numbered step chip (Generate-post flow) */
.step-num {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-soft); color: var(--sage-600);
  font-size: 12px; font-weight: 600;
}

/* Cards transition smoothly; .card-interactive lifts on hover */
.card {
  transition: box-shadow var(--dur) var(--ease-out),
              border-color var(--dur) var(--ease-out),
              transform var(--dur) var(--ease-out);
}
.card-interactive { cursor: pointer; }
.card-interactive:hover {
  box-shadow: var(--sh-md);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.card-interactive:active { transform: translateY(0); box-shadow: var(--sh-sm); }

/* Tile — inline-styled prompt/list buttons that lacked a hover affordance */
.tile {
  transition: box-shadow var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.tile:hover { box-shadow: var(--sh-sm); transform: translateY(-1px); }
.tile:active { transform: translateY(0); box-shadow: none; }

/* Loading skeleton — shimmer */
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--ink-100) 0%, var(--ink-50) 50%, var(--ink-100) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

/* Empty state */
.empty-state { text-align: center; padding: var(--s-12) var(--s-6); color: var(--ink-500); }
.empty-state .empty-icon {
  width: 44px; height: 44px; margin: 0 auto var(--s-3);
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--sage-600);
}
.empty-state h3 { font-size: var(--t-h3); color: var(--ink-800); margin-bottom: var(--s-1); }

/* Honour reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   Responsive — tablet & phone
   The layout grids are authored as React inline styles, which
   render into the element's `style` attribute. We override the
   fixed multi-column grids via attribute selectors so they
   reflow on narrow screens. (auto-fit / auto-fill grids already
   adapt and are intentionally left alone.)
   ============================================================ */

/* Tablet / small laptop — collapse the widest 4-up and split layouts */
@media (max-width: 900px) {
  /* Overview hero: side-by-side -> stacked */
  [style*="1.4fr 1fr"]   { grid-template-columns: 1fr !important; }
  /* Two-column "label | content" rows -> stacked */
  [style*="180px 1fr"]   { grid-template-columns: 1fr !important; }
  /* 4-up stat/media grids -> 2-up */
  [style*="repeat(4, 1fr)"] { grid-template-columns: repeat(2, 1fr) !important; }
  /* Generic two-column blocks -> single column */
  [style*=": 1fr 1fr"]   { grid-template-columns: 1fr !important; }
}

/* Phone — single column everywhere, tighter chrome */
@media (max-width: 560px) {
  [style*="repeat(4, 1fr)"] { grid-template-columns: repeat(2, 1fr) !important; }
  /* Calendar: shrink the day-label column so 7 days still fit */
  [style*="44px repeat(7, 1fr)"] { grid-template-columns: 26px repeat(7, 1fr) !important; }
  /* Modals/popovers: use the full width with a small gutter */
  [style*="position: fixed"][style*="inset: 0"] { padding: 12px !important; }
  /* Big decorative paddings shrink so content keeps room on small cards */
  .empty-state { padding: 32px 16px !important; }
}

/* Make horizontal scroll impossible to trigger from stray wide children */
html, body { max-width: 100%; overflow-x: hidden; }
.app-main { -webkit-overflow-scrolling: touch; }
