@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');

:root {
  --brand-primary: #10b981;
  --brand-secondary: #facc15;
  --bg-base: #090d16;
  --bg-surface: #0f1623;
  --bg-elevated: #161f30;
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-base);
  color: #f1f5f9;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-display {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
}

.font-mono-code {
  font-family: 'JetBrains Mono', monospace;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #090d16;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Subtle Grid Background */
.bg-grid-pattern {
  background-size: 32px 32px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

/* View Transitions */
.app-view {
  display: none;
  animation: fadeInView 0.18s ease-out;
}

.app-view.active {
  display: block;
}

@keyframes fadeInView {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sidebar Navigation Item */
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: #94a3b8;
  transition: all 0.15s ease;
  cursor: pointer;
  border: 1px solid transparent;
  width: 100%;
  text-align: left;
  background: transparent;
}

.nav-link:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.16) 0%, rgba(16, 185, 129, 0.04) 100%);
  border-color: rgba(16, 185, 129, 0.28);
  font-weight: 600;
}

.nav-link.active .nav-icon {
  color: #10b981;
}

/* Studio Step Tabs */
.studio-step-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 22, 35, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.studio-step-btn:hover {
  border-color: rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
}

.studio-step-btn.active {
  background: #161f30;
  border-color: #10b981;
  color: #ffffff;
  box-shadow: 0 4px 20px -4px rgba(16, 185, 129, 0.2);
}

.studio-step-panel {
  display: none;
}

.studio-step-panel.active {
  display: block;
  animation: fadeInView 0.15s ease-out;
}

/* Realistic iPhone 15 Pro Story Mockup — Exact 9:16 (324x576 = 0.3x of 1080x1920) */
.iphone-mockup {
  width: 340px;
  background: #05070b;
  border-radius: 44px;
  border: 8px solid #1e293b;
  box-shadow: 
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 25px 60px -15px rgba(0, 0, 0, 0.85);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
}

.iphone-status-bezel {
  height: 32px;
  background: #000000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 30;
}

.iphone-dynamic-island {
  width: 90px;
  height: 20px;
  background: #05070b;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.iphone-story-canvas {
  position: relative;
  width: 324px;
  height: 576px; /* Proporção exata 9:16 (1080x1920 em escala 0.3x) */
  background: #070a0f;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.preview-media-bg-blur {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  /* Equivalente exato ao Sharp .blur(28).modulate({ brightness: 0.45, saturation: 1.1 }) em 0.3x */
  filter: blur(8.4px) brightness(0.45) saturate(1.1);
  transform: scale(1.06);
}

.preview-media-main {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.preview-media-main.cover-mode {
  object-fit: cover;
}

.preview-svg-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 15;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.preview-svg-overlay .draggable-story-item {
  pointer-events: all;
  cursor: grab;
  transition: filter 0.12s ease;
}

.preview-svg-overlay .draggable-story-item:hover {
  filter: drop-shadow(0 0 12px rgba(16, 185, 129, 0.55));
}

.preview-svg-overlay .draggable-story-item.is-dragging {
  cursor: grabbing;
  filter: drop-shadow(0 0 18px rgba(250, 204, 21, 0.85));
}

.preview-rendered-exact {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 18;
}

/* Calendar Grid Cells */
.cal-cell {
  min-height: 116px;
  background: #0d131f;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cal-cell:hover {
  border-color: rgba(16, 185, 129, 0.45);
  background: #131c2e;
}

.cal-cell.selected {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.06);
  box-shadow: 0 0 0 1px #10b981;
}

.cal-cell.today {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, #0d131f 100%);
}

.cal-cell.empty {
  background: rgba(13, 19, 31, 0.3);
  border-color: rgba(255, 255, 255, 0.02);
  cursor: default;
}

.cal-event-chip {
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.cal-event-chip.POSTED {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border-left: 2.5px solid #10b981;
}

.cal-event-chip.SCHEDULED {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border-left: 2.5px solid #3b82f6;
}

.cal-event-chip.PAUSED {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border-left: 2.5px solid #f59e0b;
}

.cal-event-chip.ERROR {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border-left: 2.5px solid #ef4444;
}

/* Inputs & Selects */
.saas-input {
  width: 100%;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  padding: 10px 13px;
  border-radius: 10px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.saas-input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.saas-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 6px;
}
