/* ==========================================================================
   Big Lou AI Publishing Studio — Styling
   ========================================================================== */

:root {
  --studio-bg: #0c0f14;
  --studio-surface: #141922;
  --studio-card: rgba(26, 32, 44, 0.85);
  --studio-border: rgba(255, 255, 255, 0.1);
  --studio-border-hover: rgba(255, 255, 255, 0.22);
  --studio-accent: #00f2fe;
  --studio-accent-grad: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  --studio-tiktok-grad: linear-gradient(135deg, #fe2c55 0%, #25f4ee 100%);
  --studio-tiktok-red: #fe2c55;
  --studio-tiktok-cyan: #25f4ee;
  --studio-text: #f0f4f8;
  --studio-muted: #8b9bb4;
  --studio-font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --studio-font-display: 'Outfit', 'Inter', system-ui, sans-serif;
}

body.studio-body {
  background-color: var(--studio-bg);
  color: var(--studio-text);
  font-family: var(--studio-font-sans);
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
}

/* Studio Header */
.studio-header {
  background: rgba(12, 15, 20, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--studio-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.studio-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--studio-font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  color: #fff;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--studio-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.header-auth-slot {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.account-badge {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--studio-border);
}

.creator-avatar {
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--studio-tiktok-cyan);
}

.creator-nickname {
  font-weight: 600;
  font-size: 0.88rem;
  color: #fff;
}

.badge-connected {
  background: rgba(37, 244, 238, 0.15);
  color: var(--studio-tiktok-cyan);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.btn-tiktok {
  background: #111;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-tiktok:hover {
  border-color: var(--studio-tiktok-cyan);
  box-shadow: 0 0 16px rgba(37, 244, 238, 0.35), 0 0 8px rgba(254, 44, 85, 0.35);
  transform: translateY(-1px);
}

/* Studio Main */
.studio-main {
  flex: 1;
  padding-top: 1.75rem;
  padding-bottom: 3rem;
}

/* View 1: Connect State */
.view-connect {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem 0;
}

.connect-card {
  background: var(--studio-card);
  border: 1px solid var(--studio-border);
  border-radius: 16px;
  padding: 2.75rem 2.5rem;
  max-width: 720px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
}

.connect-card h1 {
  font-family: var(--studio-font-display);
  font-size: 2.3rem;
  margin: 0.5rem 0 1rem;
}

.connect-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  margin: 2.25rem 0;
  text-align: left;
}

.cf-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--studio-border);
  border-radius: 12px;
  padding: 1.15rem;
}

.cf-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  display: block;
}

.cf-item h3 {
  font-size: 1rem;
  margin: 0 0 0.35rem;
  color: #fff;
}

.cf-item p {
  font-size: 0.82rem;
  color: var(--studio-muted);
  margin: 0;
  line-height: 1.4;
}

.connect-action-box {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.connect-legal-note {
  font-size: 0.76rem;
  color: var(--studio-muted);
  max-width: 480px;
}

/* View 2: Workspace Grid */
.workspace-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.75rem;
  align-items: start;
}

@media (max-width: 960px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

.panel-card {
  background: var(--studio-card);
  border: 1px solid var(--studio-border);
  border-radius: 14px;
  padding: 1.4rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.1rem;
}

.panel-header h2 {
  font-family: var(--studio-font-display);
  font-size: 1.15rem;
  margin: 0;
  color: #fff;
}

.meta-hint {
  font-size: 0.78rem;
  color: var(--studio-muted);
}

/* Dropzone */
.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
}

.dropzone:hover, .dropzone.is-dragover {
  border-color: var(--studio-accent);
  background: rgba(0, 242, 254, 0.05);
}

.upload-icon {
  color: var(--studio-muted);
  margin-bottom: 0.6rem;
}

.dropzone-content p {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
}

.sample-loader-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.85rem;
}

/* Thumbnail Tray */
.thumbnail-tray {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  padding: 0.85rem 0 0.4rem;
  margin-top: 0.85rem;
  border-top: 1px solid var(--studio-border);
}

.thumb-card {
  position: relative;
  flex: 0 0 76px;
  height: 106px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: #000;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.thumb-card.is-active {
  border-color: var(--studio-accent);
  transform: scale(1.04);
}

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

.thumb-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
}

.thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  border: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.8;
}

.thumb-remove:hover {
  background: var(--studio-tiktok-red);
  opacity: 1;
}

/* Phone Mockup */
.phone-mockup {
  width: 280px;
  height: 520px;
  margin: 0 auto;
  background: #000;
  border: 10px solid #222630;
  border-radius: 36px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
}

.phone-notch {
  width: 100px;
  height: 18px;
  background: #222630;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  z-index: 20;
}

.phone-screen {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.phone-slide-container {
  width: 100%;
  height: 100%;
  position: relative;
  background: #111;
}

.phone-active-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.phone-empty-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  color: var(--studio-muted);
  font-size: 0.85rem;
}

.phone-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  font-size: 1.5rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 15;
}

.phone-nav-prev { left: 8px; }
.phone-nav-next { right: 8px; }

.phone-dots {
  position: absolute;
  bottom: 110px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 5px;
  z-index: 15;
}

.p-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
}

.p-dot.is-active {
  background: #fff;
  width: 14px;
  border-radius: 999px;
}

/* Phone Overlay */
.phone-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
}

.phone-sidebar-mock {
  align-self: flex-end;
  margin-top: auto;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.mock-avatar img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid #fff;
}

.mock-btn {
  font-size: 1.1rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

.phone-caption-box {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
  padding: 1.5rem 0.5rem 0.75rem;
  margin: -1rem;
}

.mock-username {
  font-weight: 700;
  font-size: 0.82rem;
  margin: 0 0 0.2rem;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.mock-title {
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--studio-accent);
  margin: 0 0 0.25rem;
  line-height: 1.25;
}

.mock-caption {
  font-size: 0.72rem;
  color: #eee;
  margin: 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Right Column Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.char-counter {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--studio-muted);
}

.char-counter.is-warning { color: #f59e0b; }
.char-counter.is-limit { color: #ef4444; }

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: rgba(12, 15, 20, 0.75);
  border: 1px solid var(--studio-border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  color: #fff;
  font-family: inherit;
  font-size: 0.92rem;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--studio-accent);
}

.field-hint {
  font-size: 0.75rem;
  color: var(--studio-muted);
  display: block;
  margin-top: 0.35rem;
}

.hashtag-pill-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.pill-label {
  font-size: 0.75rem;
  color: var(--studio-muted);
}

.hashtag-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--studio-border);
  border-radius: 999px;
  color: #cbd5e1;
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.hashtag-pill:hover {
  background: rgba(0, 242, 254, 0.15);
  color: var(--studio-accent);
  border-color: var(--studio-accent);
}

/* Toggle Switch */
.toggle-group {
  margin-top: 1.5rem;
}

.toggle-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
}

.toggle-label input { display: none; }

.toggle-switch {
  width: 38px;
  height: 20px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.toggle-switch::after {
  content: '';
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s ease;
}

.toggle-label input:checked + .toggle-switch {
  background: var(--studio-accent);
}

.toggle-label input:checked + .toggle-switch::after {
  transform: translateX(18px);
}

.toggle-text {
  display: flex;
  flex-direction: column;
}

.toggle-text strong {
  font-size: 0.9rem;
}

.toggle-sub {
  font-size: 0.75rem;
  color: var(--studio-muted);
}

/* Compliance Box */
.compliance-box {
  display: flex;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--studio-border);
  border-radius: 8px;
  padding: 0.85rem;
  margin: 1.5rem 0;
}

.comp-icon {
  font-size: 1.25rem;
}

.comp-text strong {
  font-size: 0.85rem;
  color: #fff;
  display: block;
}

.comp-text p {
  font-size: 0.76rem;
  color: var(--studio-muted);
  margin: 0.2rem 0 0;
  line-height: 1.35;
}

.btn-block {
  width: 100%;
  justify-content: center;
  font-size: 1rem;
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.modal-dialog {
  background: var(--studio-surface);
  border: 1px solid var(--studio-border-hover);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--studio-border);
}

.modal-header h3 {
  font-family: var(--studio-font-display);
  font-size: 1.2rem;
  margin: 0;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--studio-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-body {
  padding: 1.5rem;
}

.modal-intro {
  font-size: 0.88rem;
  color: var(--studio-muted);
  margin: 0 0 1.25rem;
}

.confirm-summary-list {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--studio-border);
  border-radius: 8px;
  padding: 0.85rem;
  margin-bottom: 1.25rem;
}

.cs-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cs-row:last-child { border-bottom: none; }

.cs-label { color: var(--studio-muted); }
.cs-val { color: #fff; font-weight: 600; }

.modal-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  font-size: 0.8rem;
  padding: 0.75rem;
  border-radius: 6px;
  line-height: 1.4;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--studio-border);
}

/* Status Modal */
.status-dialog {
  max-width: 440px;
  text-align: center;
  padding: 2rem 1.5rem;
}

.spinner-ring {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--studio-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.25rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.status-steps {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1.5rem 0;
  text-align: left;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.85rem;
  border-radius: 8px;
}

.step-item {
  font-size: 0.82rem;
  color: var(--studio-muted);
}

.step-item.is-active {
  color: var(--studio-accent);
  font-weight: 600;
}

.step-item.is-done {
  color: #10b981;
}

.success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.error-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.receipt-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--studio-border);
  border-radius: 8px;
  padding: 0.85rem;
  margin: 1.25rem 0;
  text-align: left;
}

.receipt-code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--studio-accent);
}

.receipt-action-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}
