/* DoCrosspost — DoSmooth Apps Design System (Icon-First, Calm, Readable)
 * Copyright (c) 2026 DoSmooth Oy (Business ID: 3670223-1). All rights reserved.
 */

:root {
  --bg-obsidian: #0c0d11;
  --bg-surface: #13151c;
  --bg-panel: #191c25;
  --bg-card: #222634;
  --bg-hover: #2c3244;
  --border-subtle: rgba(255, 250, 245, 0.09);
  --border-strong: rgba(255, 250, 245, 0.2);

  --text-titanium: #faf9f6;
  --text-platinum: #eae8e3;
  --text-silver: #b5b9c7;
  --text-muted: #8a8fa3;

  --accent-steel: #60c5f1;
  --accent-steel-soft: rgba(96, 197, 241, 0.16);
  --accent-emerald: #3dd6a4;
  --accent-emerald-soft: rgba(61, 214, 164, 0.16);
  --accent-gold: #f0c36d;
  --accent-gold-soft: rgba(240, 195, 109, 0.18);
  --accent-rose: #f77c96;
  --accent-rose-soft: rgba(247, 124, 150, 0.16);

  --radius-sm: 11px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-brand: 'Avenir Next', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', ui-monospace, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-obsidian);
  color: var(--text-platinum);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Top bar */
.topbar {
  height: 64px;
  padding: 0 20px;
  background: rgba(19, 21, 28, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.topbar-left,
.topbar-center,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-titanium);
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.brand-mark img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.brand-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
}

.brand-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}

.brand-select {
  background: transparent;
  color: var(--text-titanium);
  border: none;
  font-size: 14.5px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.brand-select option {
  background: var(--bg-panel);
  color: var(--text-titanium);
}

.nav-tabs {
  display: inline-flex;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  gap: 4px;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-silver);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-tab svg {
  width: 17px;
  height: 17px;
}

.nav-tab:hover {
  color: var(--text-titanium);
}

.nav-tab.active {
  background: var(--bg-card);
  color: var(--text-titanium);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-titanium);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn svg {
  width: 17px;
  height: 17px;
}

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

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #f0c36d 0%, #d89b3c 100%);
  color: #111319;
  border-color: transparent;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
  background: linear-gradient(135deg, #f0c36d 0%, #d89b3c 100%);
}

.btn-emerald {
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald);
  border-color: rgba(61, 214, 164, 0.35);
}

.btn-emerald:hover:not(:disabled) {
  background: rgba(61, 214, 164, 0.24);
}

.btn-icon {
  padding: 7px 10px;
}

/* Views */
.view {
  flex: 1;
  overflow: hidden;
  display: none;
}

.view.active {
  display: flex;
}

/* 3-pane Studio layout */
.studio-grid {
  display: grid;
  grid-template-columns: 310px 1fr 360px;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.pane {
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pane-left {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
}

.pane-right {
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
}

.pane-center {
  background: radial-gradient(700px 420px at 50% 28%, rgba(240, 195, 109, 0.055), transparent 70%),
    var(--bg-obsidian);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  overflow: hidden;
}

.section-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-silver);
}

/* Clean Icon-First Platform Tiles */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.platform-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 11px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.platform-chip svg {
  width: 22px;
  height: 22px;
}

.platform-chip:hover {
  border-color: var(--border-strong);
  color: var(--text-titanium);
}

.platform-chip.selected {
  background: var(--accent-gold-soft);
  border-color: rgba(240, 195, 109, 0.65);
  color: var(--accent-gold);
}

.platform-chip.selected span {
  color: var(--text-titanium);
}

/* Segmented controls */
.seg-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.seg-row-2 {
  grid-template-columns: repeat(2, 1fr);
}

.seg-btn {
  padding: 9px 6px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-silver);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.seg-btn.active {
  background: var(--accent-steel-soft);
  border-color: rgba(96, 197, 241, 0.55);
  color: var(--text-titanium);
}

/* Sliders */
.slider-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--text-silver);
}

.slider-label span:last-child {
  font-family: var(--font-mono);
  color: var(--text-titanium);
  font-size: 13px;
}

input[type='range'] {
  width: 100%;
  accent-color: var(--accent-gold);
  cursor: pointer;
  height: 6px;
}

/* Center Stage */
.stage-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.dropzone {
  width: min(440px, 92%);
  height: min(460px, 82%);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: rgba(25, 28, 37, 0.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 32px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent-gold);
  background: rgba(240, 195, 109, 0.08);
}

.dropzone-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: var(--accent-gold-soft);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-canvas,
.preview-video {
  max-width: 100%;
  max-height: calc(100vh - 220px);
  border-radius: var(--radius-md);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  border: 1px solid var(--border-subtle);
  display: none;
}

/* Carousel strip */
.carousel-bar {
  width: 100%;
  max-width: 680px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.slide-thumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  flex: 1;
}

.slide-thumb {
  width: 48px;
  height: 58px;
  border-radius: 8px;
  border: 2px solid transparent;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  background: var(--bg-card);
}

.slide-thumb.active {
  border-color: var(--accent-gold);
}

.slide-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(12, 13, 17, 0.85);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

/* Form inputs */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-silver);
  display: flex;
  justify-content: space-between;
}

.input,
.textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-obsidian);
  color: var(--text-titanium);
  font-family: var(--font-sans);
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.15s ease;
}

.input:focus,
.textarea:focus {
  border-color: rgba(240, 195, 109, 0.65);
}

.textarea {
  min-height: 165px;
  resize: vertical;
  line-height: 1.55;
}

.char-counter {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
}

.char-counter.over {
  color: var(--accent-rose);
  font-weight: 700;
}

/* Calendar & Channels views */
.page-scroll {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 28px;
}

.page-inner {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.cal-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.cal-dow {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  padding-bottom: 6px;
}

.cal-cell {
  min-height: 114px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cal-cell.other-month {
  opacity: 0.35;
}

.cal-cell.today {
  border-color: rgba(240, 195, 109, 0.65);
}

.cal-day-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-silver);
}

.cal-event {
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-titanium);
  background: var(--bg-card);
  border-left: 3px solid var(--accent-gold);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.channel-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.channel-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 17px;
  color: var(--text-titanium);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 10, 0.8);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  width: min(500px, 100%);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--accent-emerald);
  color: var(--text-titanium);
  font-size: 14.5px;
  font-weight: 600;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  z-index: 200;
  display: none;
}

.toast.show {
  display: block;
}

@media (max-width: 1080px) {
  .studio-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .app-shell {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }
  .view.active {
    overflow: visible;
  }
}
