/* Custom Design System: Premium Light Glassmorphic Marketing Suite */

:root {
  /* Colors */
  --bg-app: #f8fafc;
  --bg-sidebar: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-bg-hover: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(15, 23, 42, 0.08);
  --glass-border-focus: rgba(147, 51, 234, 0.5);
  
  --accent-purple: #9333ea;
  --accent-purple-rgb: 147, 51, 234;
  --accent-blue: #0891b2;
  --accent-blue-rgb: 8, 145, 178;
  --accent-emerald: #059669;
  --accent-emerald-rgb: 5, 150, 105;
  --accent-amber: #d97706;
  --accent-amber-rgb: 217, 119, 6;
  --accent-rose: #e11d48;

  --text-primary: #0f172a; /* Slate 900 */
  --text-secondary: #475569; /* Slate 600 */
  --text-muted: #64748b; /* Slate 500 */
  --border-muted: rgba(15, 23, 42, 0.04);

  /* Fonts */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  /* Shadows & Glows */
  --shadow-sm: 0 2px 12px -2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.05), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
  --glow-purple: 0 0 25px rgba(147, 51, 234, 0.1);
  --glow-blue: 0 0 25px rgba(8, 145, 178, 0.1);
  --glow-emerald: 0 0 25px rgba(5, 150, 105, 0.1);
  --glow-amber: 0 0 25px rgba(217, 119, 6, 0.1);
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.2);
}

/* Layout Framework */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Styling */
.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 0 8px 32px 8px;
  border-bottom: 1px solid var(--border-muted);
  margin-bottom: 24px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}

.accent-text {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.nav-item {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  font-family: var(--font-heading);
  font-weight: 500;
  text-align: left;
  transition: var(--transition-fast);
  outline: none;
}

.nav-item i {
  width: 18px;
  height: 18px;
  transition: var(--transition-fast);
}

.nav-item:hover {
  background-color: rgba(15, 23, 42, 0.03);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(147, 51, 234, 0.08) 0%, rgba(8, 145, 178, 0.03) 100%);
  border-color: rgba(147, 51, 234, 0.15);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(147, 51, 234, 0.04);
}

.nav-item.active i {
  color: var(--accent-purple);
  filter: drop-shadow(0 0 4px rgba(147, 51, 234, 0.2));
}

.sidebar-status {
  padding-top: 16px;
  border-top: 1px solid var(--border-muted);
}

.status-indicator-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-emerald);
}

.status-dot.pulses {
  animation: pulse-glow 2s infinite;
}

.status-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.status-clock {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-left: 16px;
}

@keyframes pulse-glow {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.5);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(5, 150, 105, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(5, 150, 105, 0);
  }
}

/* Main Content Styling */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 32px 32px 24px;
  max-width: 100%;
  width: 100%;
  margin: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-container.sidebar-collapsed .sidebar {
  width: 72px;
  padding-left: 12px;
  padding-right: 12px;
  align-items: center;
}

.app-container.sidebar-collapsed .sidebar-brand span,
.app-container.sidebar-collapsed .nav-item span,
.app-container.sidebar-collapsed .sidebar-status {
  display: none;
}

.app-container.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding: 0 0 32px 0;
}

.app-container.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 12px 0;
  width: 48px;
  height: 48px;
}

.app-container.sidebar-collapsed .main-content {
  padding-left: 24px;
}

/* Header */
.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-muted);
  margin-bottom: 28px;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: rgba(15, 23, 42, 0.02);
  border: 1px solid var(--glass-border);
  padding: 8px 16px;
  border-radius: 20px;
  width: 320px;
  opacity: 0.6;
}

.header-search i {
  color: var(--text-secondary);
  width: 16px;
}

.header-search input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  width: 100%;
  outline: none;
}

.header-profile {
  display: flex;
  align-items: center;
  gap: 20px;
}

.quick-stat {
  font-size: 0.85rem;
  background: rgba(15, 23, 42, 0.02);
  border: 1px solid var(--glass-border);
  padding: 6px 12px;
  border-radius: 8px;
  display: flex;
  gap: 6px;
}

.qs-label {
  color: var(--text-secondary);
}

.qs-value {
  color: var(--accent-blue);
  font-weight: 700;
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(147, 51, 234, 0.2);
}

/* Glassmorphic Panels */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-panel:hover {
  border-color: rgba(15, 23, 42, 0.12);
}

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

.panel-header h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
}

/* Views Management */
.view-wrapper {
  position: relative;
  flex-grow: 1;
}

.content-view {
  display: none;
  animation: fade-in-up var(--transition-normal);
}

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

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-header {
  margin-bottom: 24px;
}

.view-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.view-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 10px 18px;
  border-radius: 10px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-fast);
  outline: none;
  user-select: none;
}

.btn i {
  width: 16px;
  height: 16px;
}

.btn:hover {
  background: rgba(15, 23, 42, 0.08);
  border-color: rgba(15, 23, 42, 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple) 0%, rgba(147, 51, 234, 0.85) 100%);
  border: none;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(147, 51, 234, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.9) 0%, rgba(147, 51, 234, 0.75) 100%);
  box-shadow: 0 4px 20px rgba(147, 51, 234, 0.35);
  transform: translateY(-1px);
}

.btn-full {
  width: 100%;
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--accent-blue);
  padding: 4px 8px;
  font-weight: 500;
}

.btn-text:hover {
  background: rgba(8, 145, 178, 0.08);
  text-decoration: underline;
}

.btn-text-danger {
  background: transparent;
  border: none;
  color: var(--accent-rose);
  padding: 4px 8px;
  font-weight: 500;
}

.btn-text-danger:hover {
  background: rgba(225, 29, 72, 0.08);
  text-decoration: underline;
}

.btn-icon {
  padding: 6px 12px;
  background: #ffffff;
  border-color: var(--glass-border);
}

.btn-icon i {
  color: var(--accent-emerald);
}

.btn-icon:hover {
  border-color: rgba(5, 150, 105, 0.3);
  box-shadow: 0 0 10px rgba(5, 150, 105, 0.05);
}

/* Metric Cards */
.media-bin-scroll {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 8px;
}

.media-bin-accordion {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
}

.media-bin-accordion-header {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.2s;
  font-weight: 600;
  font-family: var(--font-heading);
}

.media-bin-accordion-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.media-bin-accordion-content {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: none;
}

.media-bin-accordion-content.expanded {
  display: block;
}


.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 20px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.metric-card:hover {
  transform: translateY(-3px);
  border-color: rgba(15, 23, 42, 0.12);
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-icon i {
  width: 24px;
  height: 24px;
}

.purple-bg { background-color: rgba(147, 51, 234, 0.08); color: var(--accent-purple); }
.blue-bg { background-color: rgba(8, 145, 178, 0.08); color: var(--accent-blue); }
.emerald-bg { background-color: rgba(5, 150, 105, 0.08); color: var(--accent-emerald); }
.amber-bg { background-color: rgba(217, 119, 6, 0.08); color: var(--accent-amber); }

.card-glow-purple:hover { box-shadow: var(--glow-purple); }
.card-glow-blue:hover { box-shadow: var(--glow-blue); }
.card-glow-emerald:hover { box-shadow: var(--glow-emerald); }
.card-glow-amber:hover { box-shadow: var(--glow-amber); }

.metric-info {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 2px;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.metric-delta {
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 2px;
  font-weight: 600;
}

.metric-delta.positive { color: var(--accent-emerald); }
.metric-delta.negative { color: var(--accent-rose); }
.metric-delta.neutral { color: var(--text-secondary); }

.metric-delta i {
  width: 12px;
  height: 12px;
}

/* Dashboard Specific Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.8fr 1.2fr;
  gap: 24px;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .app-container {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    padding: 16px;
  }
  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 8px;
  }
  .nav-item span {
    display: none;
  }
}

.chart-container {
  height: 280px;
  position: relative;
  width: 100%;
}

.chart-legend {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 16px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.legend-dot.purple { background-color: var(--accent-purple); }
.legend-dot.blue { background-color: var(--accent-blue); }

/* Dashboard Active Campaigns */
.campaign-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.campaign-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.015);
  border: 1px solid var(--border-muted);
  border-radius: 10px;
  transition: var(--transition-fast);
}

.campaign-item:hover {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.06);
}

.camp-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.camp-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
}

.camp-tags {
  display: flex;
  gap: 6px;
}

.camp-tag {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.tag-purple { background: rgba(147, 51, 234, 0.08); color: #7e22ce; }
.tag-blue { background: rgba(8, 145, 178, 0.08); color: #0e7490; }
.tag-emerald { background: rgba(5, 150, 105, 0.08); color: #047857; }

.camp-stats {
  text-align: right;
}

.camp-roi {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--accent-emerald);
  font-size: 0.95rem;
}

.camp-action {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
  width: 100%;
  background-color: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.15);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--glass-border-focus);
  box-shadow: 0 0 10px rgba(147, 51, 234, 0.15);
  background-color: #ffffff;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Checkboxes */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 6px;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  position: relative;
  padding-left: 28px;
  cursor: pointer;
  font-size: 0.85rem;
  user-select: none;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.custom-checkbox:hover {
  color: var(--text-primary);
}

.custom-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  height: 18px;
  width: 18px;
  background-color: rgba(15, 23, 42, 0.02);
  border: 1px solid rgba(15, 23, 42, 0.15);
  border-radius: 4px;
  transition: var(--transition-fast);
}

.custom-checkbox input:checked ~ .checkmark {
  background-color: var(--accent-purple);
  border-color: var(--accent-purple);
  box-shadow: 0 0 8px rgba(147, 51, 234, 0.3);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.custom-checkbox input:checked ~ .checkmark:after {
  display: block;
}

.custom-checkbox .checkmark:after {
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Campaign Generator Layout */
.generator-container {
  display: grid;
  grid-template-columns: 1.1fr 1.9fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .generator-container {
    grid-template-columns: 1fr;
  }
}

.generator-preview-panel {
  min-height: 480px;
  display: flex;
  flex-direction: column;
}

.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-grow: 1;
  padding: 40px;
  color: var(--text-muted);
}

.placeholder-icon {
  width: 54px;
  height: 54px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.placeholder-icon.anim-pulse {
  animation: anim-pulse-icon 3s infinite alternate;
}

@keyframes anim-pulse-icon {
  from { transform: scale(1); opacity: 0.3; }
  to { transform: scale(1.1); opacity: 0.6; }
}

.preview-placeholder h3 {
  font-family: var(--font-heading);
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
}

.preview-placeholder p {
  max-width: 320px;
  font-size: 0.85rem;
}

/* Generated Preview Styles */
.generated-bundle-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fade-in-up var(--transition-normal);
}

.bundle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-muted);
  padding-bottom: 12px;
}

.bundle-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-purple);
}

.bundle-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.02);
  border: 1px solid var(--glass-border);
  padding: 4px;
  border-radius: 8px;
  gap: 4px;
}

.bundle-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.bundle-tab-btn.active {
  background: var(--accent-purple);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(147, 51, 234, 0.25);
}

.bundle-preview-card {
  background: rgba(15, 23, 42, 0.01);
  border: 1px solid var(--border-muted);
  border-radius: 12px;
  padding: 20px;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-muted);
  padding-bottom: 10px;
}

.card-top h4 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  font-size: 1rem;
}

.preview-content-box {
  background: #f1f5f9;
  border-radius: 8px;
  padding: 16px;
  font-family: var(--font-body);
  white-space: pre-wrap;
  font-size: 0.9rem;
  border-left: 3px solid var(--accent-blue);
  color: #1e293b;
  margin-bottom: 16px;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.preview-meta-list {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.preview-meta-item {
  font-size: 0.75rem;
  background: rgba(15, 23, 42, 0.03);
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--text-secondary);
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.preview-actions {
  display: flex;
  gap: 12px;
}

/* Idea Generator Grid styling */
.ideas-layout {
  display: grid;
  grid-template-columns: 1.1fr 1.9fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .ideas-layout {
    grid-template-columns: 1fr;
  }
}

.ideas-control-card {
  display: flex;
  flex-direction: column;
}

.ideas-control-card h3 {
  font-family: var(--font-heading);
  margin-bottom: 6px;
}

.help-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.category-selectors {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
}

.category-btn {
  background: rgba(15, 23, 42, 0.02);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-weight: 500;
  transition: var(--transition-fast);
  outline: none;
  text-align: left;
}

.category-btn i {
  width: 16px;
  height: 16px;
}

.category-btn:hover {
  background: rgba(15, 23, 42, 0.04);
  color: var(--text-primary);
}

.category-btn.active {
  background: rgba(8, 145, 178, 0.06);
  border-color: var(--accent-blue);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(8, 145, 178, 0.05);
}

.ideas-results-panel {
  min-height: 480px;
  display: flex;
  flex-direction: column;
}

.idea-count {
  font-size: 0.75rem;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--glass-border);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
  color: var(--accent-blue);
}

.ideas-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-grow: 1;
}

.idea-card {
  background: rgba(15, 23, 42, 0.01);
  border: 1px solid var(--border-muted);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
  animation: fade-in-up var(--transition-normal);
}

.idea-card:hover {
  border-color: rgba(15, 23, 42, 0.1);
  transform: translateX(4px);
}

.idea-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
}

.idea-card.social::before { background-color: var(--accent-purple); }
.idea-card.email::before { background-color: var(--accent-blue); }
.idea-card.ads::before { background-color: var(--accent-rose); }
.idea-card.content::before { background-color: var(--accent-emerald); }
.idea-card.event::before { background-color: var(--accent-amber); }

.idea-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.idea-card-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
}

.idea-badge {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
}

.badge-social { background: rgba(147, 51, 234, 0.08); color: #7e22ce; }
.badge-email { background: rgba(8, 145, 178, 0.08); color: #0e7490; }
.badge-ads { background: rgba(225, 29, 72, 0.08); color: #be123c; }
.badge-content { background: rgba(5, 150, 105, 0.08); color: #047857; }
.badge-event { background: rgba(217, 119, 6, 0.08); color: #b45309; }

.idea-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.idea-meta {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.idea-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.idea-meta i {
  width: 12px;
  height: 12px;
}

.idea-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border-muted);
  padding-top: 12px;
  margin-top: 4px;
}

/* Creative copy Hub Styles */
.creative-hub-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.creative-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.filter-chip {
  background: rgba(15, 23, 42, 0.02);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition-fast);
  outline: none;
}

.filter-chip:hover {
  background: rgba(15, 23, 42, 0.04);
  color: var(--text-primary);
}

.filter-chip.active {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(147, 51, 234, 0.2);
}

.filter-campaign-dropdown select {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  padding: 6px 12px;
  border-radius: 8px;
  outline: none;
}

.creative-assets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.creative-asset-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  animation: fade-in-up var(--transition-normal);
}

.creative-asset-card:hover {
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: var(--shadow-sm);
}

.asset-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-muted);
  padding-bottom: 8px;
}

.asset-campaign-name {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.asset-body {
  font-family: var(--font-body);
  background: #f8fafc;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  white-space: pre-wrap;
  color: #1e293b;
  flex-grow: 1;
  border-left: 2px solid var(--accent-purple);
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid rgba(15, 23, 42, 0.04);
}

.asset-body.email { border-left: 2px solid var(--accent-blue); }
.asset-body.ads { border-left: 2px solid var(--accent-rose); }

.asset-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.asset-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

/* Personas Styling */
.personas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.persona-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  animation: fade-in-up var(--transition-normal);
}

.persona-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
}

.persona-header-img {
  height: 110px;
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 16px;
}

.persona-header-img.orange { background: linear-gradient(135deg, var(--accent-amber) 0%, var(--accent-rose) 100%); }
.persona-header-img.green { background: linear-gradient(135deg, var(--accent-emerald) 0%, var(--accent-blue) 100%); }

.avatar-badge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: #ffffff;
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  position: absolute;
  bottom: -24px;
  left: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.persona-camp-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.65rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 8px;
  border-radius: 10px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 500;
}

.persona-content {
  padding: 36px 20px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.persona-name-wrap {
  display: flex;
  flex-direction: column;
}

.persona-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
}

.persona-role {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.persona-demographics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border-top: 1px solid var(--border-muted);
  border-bottom: 1px solid var(--border-muted);
  padding: 8px 0;
  font-size: 0.75rem;
}

.demo-item {
  color: var(--text-secondary);
}

.demo-val {
  color: var(--text-primary);
  font-weight: 600;
}

.persona-list-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.section-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.persona-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.trait-pill {
  font-size: 0.7rem;
  background: rgba(15, 23, 42, 0.04);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--text-secondary);
  border: 1px solid rgba(15, 23, 42, 0.02);
}

.persona-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Scheduler & Logs Layout */
.scheduler-layout {
  display: grid;
  grid-template-columns: 1.1fr 1.9fr;
  gap: 24px;
  margin-bottom: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .scheduler-layout {
    grid-template-columns: 1fr;
  }
}

.schedules-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.schedule-card {
  background: rgba(15, 23, 42, 0.01);
  border: 1px solid var(--border-muted);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: var(--transition-fast);
}

.schedule-card:hover {
  background: rgba(15, 23, 42, 0.02);
  border-color: rgba(15, 23, 42, 0.05);
}

.sched-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sched-title-wrap {
  display: flex;
  flex-direction: column;
}

.sched-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
}

.sched-detail {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.sched-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Custom switch toggle styling */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.1);
  border: 1px solid var(--glass-border);
  transition: .4s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

input:checked + .slider {
  background-color: var(--accent-emerald);
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.2);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

.delete-sched-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition-fast);
}

.delete-sched-btn:hover {
  color: var(--accent-rose);
  background: rgba(225, 29, 72, 0.08);
}

.sched-progress {
  height: 4px;
  background: rgba(15, 23, 42, 0.05);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.sched-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-blue));
  transition: width 1s linear;
}

/* Execution logs table styles */
.logs-table-wrapper {
  overflow-x: auto;
  max-height: 320px;
  overflow-y: auto;
}

.logs-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8rem;
}

.logs-table th {
  padding: 12px 16px;
  font-family: var(--font-heading);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.logs-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-muted);
  color: var(--text-secondary);
}

.logs-table tr:hover td {
  background: rgba(15, 23, 42, 0.01);
  color: var(--text-primary);
}

.log-status-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-success { background: rgba(5, 150, 105, 0.1); color: var(--accent-emerald); }
.badge-pending { background: rgba(217, 119, 6, 0.1); color: var(--accent-amber); }

.log-impact-up {
  color: var(--accent-emerald);
  font-weight: 600;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-left: 4px solid var(--accent-purple);
  padding: 14px 18px;
  border-radius: 8px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  pointer-events: auto;
  animation: slide-in-toast 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 320px;
  font-size: 0.85rem;
}

.toast.success { border-left-color: var(--accent-emerald); }
.toast.info { border-left-color: var(--accent-blue); }
.toast.warning { border-left-color: var(--accent-amber); }

.toast-icon {
  flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--accent-emerald); }
.toast.info .toast-icon { color: var(--accent-blue); }
.toast.warning .toast-icon { color: var(--accent-amber); }

.toast-message-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-grow: 1;
  overflow: hidden;
  word-wrap: break-word;
  word-break: break-word;
}

.toast-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.3;
}

.toast-desc {
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.4;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.toast-close:hover {
  color: var(--text-primary);
}

@keyframes slide-in-toast {
  from {
    transform: translateX(100%) translateY(0);
    opacity: 0;
  }
  to {
    transform: translateX(0) translateY(0);
    opacity: 1;
  }
}

.toast.removing {
  animation: slide-out-toast 0.2s ease-in forwards;
}

@keyframes slide-out-toast {
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

/* Video Studio Styles */
.video-studio-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.video-form-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.video-form-card {
  padding: 20px;
}

.character-scroll-grid {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.character-profile-card {
  min-width: 120px;
  background: rgba(15, 23, 42, 0.02);
  border: 1px solid var(--border-muted);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.character-profile-card:hover, .character-profile-card.selected {
  border-color: var(--accent-purple);
  background: rgba(147, 51, 234, 0.05);
}

.char-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-purple);
  margin: 0 auto 8px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.audio-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.audio-clip-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.02);
  border: 1px solid var(--border-muted);
  border-radius: 8px;
  cursor: pointer;
}

.audio-clip-item:hover, .audio-clip-item.selected {
  border-color: var(--accent-blue);
  background: rgba(8, 145, 178, 0.05);
}

.audio-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.video-result-column {
  display: flex;
  flex-direction: column;
}

.video-result-card {
  padding: 20px;
}

.video-player-container {
  background: #000 !important;
  border-radius: 12px !important;
  width: 100% !important;
  max-width: 800px !important;
  aspect-ratio: 16/9 !important;
  height: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  margin: 0 auto 16px auto !important;
  position: relative !important;
}

.video-player-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Media Upload Area */
.media-upload-area {
  border: 1px dashed var(--border-muted);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.03);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.media-upload-area:hover {
  background: rgba(15, 23, 42, 0.08);
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

.ingredient-badge {
  background: var(--glass-bg);
  border: 1px solid var(--border-muted);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.7rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* NLE Timeline Styles */
.advanced-generation-options {
  background: rgba(15, 23, 42, 0.02);
  border: 1px solid var(--border-muted);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.timeline-actions {
  display: flex;
  gap: 8px;
}

.media-bin-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.media-bin-item {
  min-width: 80px;
  height: 60px;
  background: var(--glass-bg);
  border: 1px dashed var(--border-muted);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: grab;
}

.timeline-panel {
  display: flex;
  flex-direction: column;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.4);
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-muted);
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
}

.timeline-timecode {
  font-family: monospace;
  color: var(--accent-blue);
  font-size: 1rem;
}

.timeline-tracks-container {
  padding: 16px;
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #0f131f;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
  overflow-x: auto;
  min-height: 200px;
  position: relative;
}

.timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background-color: #ef4444; /* red */
  z-index: 50;
  cursor: ew-resize;
  pointer-events: auto;
  transform: translateX(-50%);
}

.playhead-handle {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0; 
  height: 0; 
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 12px solid #ef4444;
}

.timeline-track {
  display: flex;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  min-height: 64px;
  position: relative;
}

.track-header {
  width: 60px;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-right: 1px solid var(--border-muted);
  flex-shrink: 0;
  position: sticky;
  left: 0;
  z-index: 100;
}

.track-header i {
  width: 16px;
  height: 16px;
  margin-bottom: 4px;
}

.track-content {
  flex-grow: 1;
  position: relative;
  height: 64px;
  min-width: 3000px;
  padding: 0;
}

.timeline-clip {
  position: absolute;
  height: 56px;
  background: rgba(147, 51, 234, 0.2);
  border: 1px solid var(--accent-purple);
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 0.75rem;
  color: #fff;
  cursor: grab;
  overflow: hidden;
}

.timeline-clip.audio {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent-blue);
  height: 40px;
}

.timeline-clip.external {
  background: rgba(5, 150, 105, 0.2);
  border-color: var(--accent-emerald);
}

.timeline-blend {
  position: absolute;
  width: 24px;
  height: 56px;
  background: linear-gradient(90deg, rgba(147, 51, 234, 0.5), rgba(6, 182, 212, 0.5));
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: #fff;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  z-index: 10;
  border: 1px solid #fff;
  cursor: grab;
}

.clip-delete-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.85);
  border: none;
  color: white;
  font-size: 11px;
  line-height: 14px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  padding: 0;
}

.timeline-clip:hover .clip-delete-btn,
.timeline-blend:hover .clip-delete-btn {
  display: flex;
}

.clip-delete-btn:hover {
  background: rgba(220, 38, 38, 1);
}

/* Timeline & Media Bin Clickable Previews styling */
.timeline-clip.active,
.timeline-blend.active {
  border: 1px solid #ffffff !important;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.6);
}

.media-bin-item.video-item {
  transition: all 0.2s ease-in-out;
}

.media-bin-item.video-item:hover {
  background: rgba(168, 85, 247, 0.15) !important;
  border-color: var(--accent-purple) !important;
  color: #ffffff !important;
}

/* Script Generator Tabs & Segment Cards */
.studio-tab {
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.85rem;
}
.studio-tab:hover {
  color: var(--text-primary) !important;
}
.studio-tab.active {
  color: var(--text-primary) !important;
  border-bottom: 2px solid var(--accent-purple) !important;
}

.script-segment-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s ease;
}
.script-segment-card:hover {
  border-color: rgba(168, 85, 247, 0.3);
}

.script-segment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
}

.script-segment-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.script-segment-duration {
  font-size: 0.75rem;
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.script-segment-body {
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.script-segment-prompt {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 10px;
  border-radius: 6px;
  border-left: 2px solid var(--accent-purple);
}

.script-segment-voiceover {
  color: var(--text-secondary);
  font-style: italic;
  padding: 4px 10px;
  border-left: 2px solid var(--accent-blue);
}

.script-segment-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.segment-preview-box {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  width: 100%;
  display: none;
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.segment-preview-box video {
  width: 100%;
  height: auto;
  max-height: 180px;
  display: block;
}

/* Sequence Player Layers */
.sequence-player-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.seq-video-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity linear; /* JS will set duration */
  z-index: 1;
}

.seq-video-layer.active {
  opacity: 1;
  z-index: 2;
}

.seq-control-bar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.seq-control-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 50%;
  transition: all 0.2s;
}

.seq-control-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--accent-emerald);
}

.seq-control-btn svg {
  width: 20px;
  height: 20px;
}

/* Export Modal Styles */
.export-progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.export-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent-blue);
  transition: width 0.3s ease;
}

.download-clip-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
}

.download-clip-btn:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: var(--bg-sidebar);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
}
.modal-close:hover {
  color: var(--text-primary);
}
.modal-body {
  padding: 20px;
}
.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.transition-item {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.transition-item:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}
.transition-icon {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.5), rgba(147, 51, 234, 0.5));
  border-radius: 4px;
  margin: 0 auto 8px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.transition-item span {
  font-size: 0.8rem;
  color: var(--text-primary);
}

.trim-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10px;
  background: rgba(255, 255, 255, 0.8);
  cursor: ew-resize;
  z-index: 10;
  display: none;
  border-radius: 2px;
}

.timeline-clip.active .trim-handle {
  display: block;
}

.trim-handle.left {
  left: 0;
}

.trim-handle.right {
  right: 0;
}
