/* DRAMIU - World-Class Drama Screenplay Studio
   Pure Vanilla CSS (No framework dependencies, compatible with all hosting)
   Color Palette: Cinematic Pink & Purple Luxe Theme
*/

:root {
  --bg-main: #0c0714;
  --bg-surface: #150c22;
  --bg-card: #1c102e;
  --bg-card-hover: #26163e;
  --bg-input: #12091e;
  
  --primary-pink: #ff2a85;
  --primary-pink-hover: #ff4d9c;
  --primary-purple: #8b32eb;
  --primary-purple-hover: #a14fff;
  
  --grad-pink-purple: linear-gradient(135deg, #ff2a85 0%, #8b32eb 100%);
  --grad-purple-pink: linear-gradient(135deg, #7928ca 0%, #ff0080 100%);
  --grad-dark-card: linear-gradient(145deg, rgba(35, 17, 58, 0.7) 0%, rgba(20, 10, 36, 0.9) 100%);
  --grad-glow: radial-gradient(circle at 50% 0%, rgba(255, 42, 133, 0.15) 0%, rgba(139, 50, 235, 0.05) 60%, transparent 100%);
  
  --border-subtle: rgba(255, 42, 133, 0.15);
  --border-focus: rgba(255, 42, 133, 0.6);
  --border-glow: rgba(139, 50, 235, 0.4);
  
  --text-main: #ffffff;
  --text-muted: #b9a9d0;
  --text-dim: #7d6b94;
  --text-pink: #ff66a8;
  --text-purple: #c084fc;
  
  --accent-gold: #f59e0b;
  --accent-green: #10b981;
  --accent-blue: #38bdf8;
  --accent-red: #ef4444;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 42, 133, 0.1);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(139, 50, 235, 0.2);
  --shadow-glow: 0 0 25px rgba(255, 42, 133, 0.35);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  --transition-fast: 0.18s ease;
  --transition-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Plus Jakarta Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(139, 50, 235, 0.18) 0%, transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(255, 42, 133, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(121, 40, 202, 0.12) 0%, transparent 50%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #3c1e5c;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-pink);
}

/* Container */
.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Navigation */
header.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 7, 20, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  cursor: pointer;
}

.brand-logo-img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(255, 42, 133, 0.5));
  transition: transform var(--transition-fast);
}
.brand-wrapper:hover .brand-logo-img {
  transform: scale(1.06) rotate(2deg);
}

.brand-text-block h1 {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
  background: var(--grad-purple-pink);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 7px;
  background: rgba(255, 42, 133, 0.18);
  color: var(--primary-pink);
  border: 1px solid rgba(255, 42, 133, 0.3);
  border-radius: var(--radius-full);
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(25, 13, 42, 0.7);
  padding: 5px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.nav-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.nav-tab-btn:hover {
  color: #fff;
  background: rgba(255, 42, 133, 0.12);
}

.nav-tab-btn.active {
  color: #fff;
  background: var(--grad-pink-purple);
  box-shadow: 0 4px 14px rgba(255, 42, 133, 0.4);
}

.nav-tab-btn .tab-icon {
  font-size: 1rem;
}

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

.btn-header-cta {
  background: var(--grad-pink-purple);
  color: #fff;
  border: none;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 0 18px rgba(255, 42, 133, 0.35);
  transition: all var(--transition-fast);
}

.btn-header-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 25px rgba(255, 42, 133, 0.6);
  background: var(--primary-pink-hover);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary {
  background: var(--grad-pink-purple);
  color: #fff;
  box-shadow: 0 4px 16px rgba(255, 42, 133, 0.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #ff4d9c 0%, #a14fff 100%);
  box-shadow: 0 6px 22px rgba(255, 42, 133, 0.55);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(45, 23, 72, 0.8);
  color: #fff;
  border: 1px solid var(--border-subtle);
}
.btn-secondary:hover {
  background: rgba(60, 30, 95, 0.9);
  border-color: var(--primary-pink);
  transform: translateY(-1px);
}

.btn-outline-pink {
  background: transparent;
  color: var(--primary-pink);
  border: 1px solid var(--primary-pink);
}
.btn-outline-pink:hover {
  background: rgba(255, 42, 133, 0.15);
  color: #fff;
}

.btn-outline-purple {
  background: transparent;
  color: var(--text-purple);
  border: 1px solid var(--primary-purple);
}
.btn-outline-purple:hover {
  background: rgba(139, 50, 235, 0.15);
  color: #fff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
  font-weight: 700;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Sections & Tabs */
.tab-content {
  display: none;
  padding: 32px 0 60px;
  animation: fadeIn 0.3s ease forwards;
}

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

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

/* Hero Section */
.hero-banner {
  background: linear-gradient(135deg, rgba(38, 14, 66, 0.85) 0%, rgba(20, 9, 36, 0.95) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 38px 36px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 30px;
}

.hero-banner::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(255, 42, 133, 0.3) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 820px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 42, 133, 0.15);
  border: 1px solid rgba(255, 42, 133, 0.35);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-pink);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-title {
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1.22;
  margin-bottom: 14px;
  letter-spacing: -0.5px;
}

.hero-title .gradient-text {
  background: var(--grad-purple-pink);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.02rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Stats Row */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 36px;
}

.stat-card {
  background: var(--grad-dark-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.stat-card:hover {
  border-color: var(--primary-pink);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

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

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-icon {
  font-size: 1.4rem;
  background: rgba(255, 42, 133, 0.12);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--primary-pink);
}

.stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 4px;
}

.stat-subtext {
  font-size: 0.74rem;
  color: var(--text-dim);
}

/* Country Selector Pills */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  background: rgba(22, 11, 37, 0.6);
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-pill {
  background: rgba(40, 20, 65, 0.6);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.filter-pill:hover {
  color: #fff;
  border-color: var(--primary-pink);
}

.filter-pill.active {
  background: var(--grad-pink-purple);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(255, 42, 133, 0.35);
}

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

.section-title-wrap h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Trends Grid */
.trends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.trend-card {
  background: var(--grad-dark-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.trend-card:hover {
  border-color: var(--primary-pink);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.trend-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.trend-platform-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(139, 50, 235, 0.2);
  color: var(--text-purple);
  border: 1px solid rgba(139, 50, 235, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trend-growth-badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.trend-growth-badge.positive {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.trend-growth-badge.negative {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.trend-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.3;
}

.trend-genre-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.genre-tag {
  font-size: 0.72rem;
  padding: 2px 8px;
  background: rgba(255, 42, 133, 0.1);
  color: var(--text-pink);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 42, 133, 0.2);
  font-weight: 500;
}

.trend-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.trend-score-bar-wrap {
  margin-bottom: 18px;
}

.trend-score-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  margin-bottom: 6px;
}

.trend-score-label {
  color: var(--text-dim);
  font-weight: 600;
}

.trend-score-num {
  font-weight: 700;
  color: var(--primary-pink);
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(45, 23, 72, 0.8);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--grad-pink-purple);
  box-shadow: 0 0 8px rgba(255, 42, 133, 0.5);
  transition: width 0.8s ease;
}

.trend-card-btn {
  width: 100%;
}

/* History Projects Section */
.history-section {
  margin-top: 40px;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
}

.history-card {
  background: var(--grad-dark-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.history-card:hover {
  border-color: var(--primary-pink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.history-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.history-country-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 42, 133, 0.15);
  color: var(--text-pink);
}

.history-date {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.history-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.history-synopsis {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 12px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  background: var(--grad-dark-card);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}
.empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.8;
}

/* ===============================
   GENERATE SEKENARIO FORM STYLING
   =============================== */
.generate-layout {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 28px;
  align-items: start;
}

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

.form-panel {
  background: var(--grad-dark-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 26px;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.form-panel-header {
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.form-panel-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

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

.form-control, .form-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-pink);
  box-shadow: 0 0 10px rgba(255, 42, 133, 0.35);
  background: #180b29;
}

.input-with-btn {
  display: flex;
  gap: 8px;
}

.input-with-btn .form-control {
  flex: 1;
}

/* Country Selector Cards */
.country-selector-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.country-card-option {
  background: rgba(30, 15, 50, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.country-card-option:hover {
  border-color: var(--primary-pink);
  background: rgba(45, 20, 75, 0.8);
}

.country-card-option.active {
  background: var(--grad-pink-purple);
  border-color: transparent;
  box-shadow: 0 0 14px rgba(255, 42, 133, 0.4);
}

.country-flag {
  font-size: 1.4rem;
  display: block;
  margin-bottom: 3px;
}

.country-name {
  font-size: 0.78rem;
  font-weight: 700;
  display: block;
  color: #fff;
}

.country-sub {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Genre Chips Multi-Select */
.genre-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 135px;
  overflow-y: auto;
  padding: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.genre-chip {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 10px;
  background: rgba(45, 23, 72, 0.7);
  color: var(--text-muted);
  border: 1px solid rgba(255, 42, 133, 0.15);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.genre-chip:hover {
  color: #fff;
  border-color: var(--primary-pink);
}

.genre-chip.selected {
  background: var(--primary-pink);
  color: #fff;
  border-color: var(--primary-pink);
  box-shadow: 0 0 8px rgba(255, 42, 133, 0.4);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-actions-bar {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.form-actions-bar .btn {
  flex: 1;
}

/* Screenplay Output Panel */
.output-panel {
  background: var(--grad-dark-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 30px;
  box-shadow: var(--shadow-lg);
  position: relative;
  min-height: 600px;
}

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}

.output-title-area h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.output-tools-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Screenplay Markdown Output Renderer */
.screenplay-container {
  font-family: inherit;
  color: #f3f0f7;
  line-height: 1.7;
}

.screenplay-tag-block {
  margin-bottom: 26px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  background: rgba(22, 11, 37, 0.7);
  border: 1px solid var(--border-subtle);
  position: relative;
}

.screenplay-tag-block.highlight {
  border-color: rgba(255, 42, 133, 0.4);
  background: rgba(35, 14, 55, 0.75);
}

.screenplay-badge-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--grad-pink-purple);
  color: #fff;
  margin-bottom: 12px;
  text-transform: uppercase;
  box-shadow: 0 0 10px rgba(255, 42, 133, 0.3);
}

.screenplay-title-display {
  font-size: 1.85rem;
  font-weight: 800;
  background: var(--grad-purple-pink);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.screenplay-hook-display {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffe0ef;
  font-style: italic;
  border-left: 3px solid var(--primary-pink);
  padding-left: 14px;
  margin: 10px 0;
}

/* Scene Box */
.scene-card {
  background: rgba(18, 9, 32, 0.95);
  border: 1px solid rgba(139, 50, 235, 0.3);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 24px;
  position: relative;
}

.scene-header {
  font-size: 1.08rem;
  font-weight: 800;
  color: #ffd277;
  letter-spacing: 0.5px;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.prompt-box {
  background: rgba(28, 12, 48, 0.7);
  border-left: 3px solid var(--primary-pink);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 12px 16px;
  margin: 12px 0;
  font-size: 0.86rem;
  color: #e9d5ff;
}

.prompt-box-ref {
  background: rgba(20, 16, 45, 0.7);
  border-left: 3px solid var(--primary-purple);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 12px 16px;
  margin: 12px 0;
  font-size: 0.86rem;
  color: #cbd5e1;
}

.prompt-box-video {
  background: linear-gradient(135deg, rgba(42, 14, 68, 0.85) 0%, rgba(26, 10, 44, 0.9) 100%);
  border: 1px solid var(--primary-pink);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin: 16px 0;
  box-shadow: 0 0 16px rgba(255, 42, 133, 0.2);
}

.prompt-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.prompt-label {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--primary-pink);
  text-transform: uppercase;
}

.action-block {
  margin: 12px 0;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: #e2e8f0;
}

.dialogue-block {
  margin: 14px 0;
  padding-left: 10px;
}

.dialogue-line {
  margin-bottom: 8px;
  font-size: 0.92rem;
}

.dialogue-character {
  font-weight: 700;
  color: #f472b6;
}

.dialogue-text {
  color: #ffffff;
  font-style: italic;
}

/* Multi-Episode Navigation Bar & Block Cards */
.episodes-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(30, 15, 52, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 24px;
}

.episodes-nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.episode-jump-btn {
  background: rgba(45, 20, 75, 0.7);
  border: 1px solid rgba(255, 42, 133, 0.25);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.episode-jump-btn:hover {
  background: var(--primary-pink);
  border-color: var(--primary-pink);
  box-shadow: 0 0 10px rgba(255, 42, 133, 0.4);
}

.episode-block-card {
  background: rgba(20, 10, 36, 0.65);
  border: 1px solid rgba(139, 50, 235, 0.25);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 32px;
  position: relative;
  transition: border-color 0.2s ease;
}

.episode-block-card:hover {
  border-color: rgba(255, 42, 133, 0.35);
}

.episode-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 22px;
}

.episode-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.episode-badge-pill {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  background: var(--grad-pink-purple);
  color: #fff;
  text-transform: uppercase;
  box-shadow: 0 0 12px rgba(255, 42, 133, 0.35);
}

.episode-header-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.episode-scene-counter {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(139, 50, 235, 0.2);
  color: var(--text-purple);
  border: 1px solid rgba(139, 50, 235, 0.3);
}

/* Next Episode Generator Card */
.next-episode-card {
  margin-top: 30px;
  background: linear-gradient(135deg, rgba(65, 20, 95, 0.8) 0%, rgba(35, 12, 60, 0.95) 100%);
  border: 1px solid var(--primary-pink);
  border-radius: var(--radius-xl);
  padding: 26px;
  text-align: center;
  box-shadow: var(--shadow-glow);
}

.next-episode-card h4 {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.next-episode-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 18px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ===============================
   KARAKTER STUDIO STYLING
   =============================== */
.character-layout {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 28px;
  align-items: start;
}

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

/* Trait Selector Multi-Chips (30+ options) */
.traits-chips-box {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.trait-chip {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 5px 10px;
  background: rgba(40, 20, 65, 0.7);
  color: var(--text-muted);
  border: 1px solid rgba(255, 42, 133, 0.15);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.trait-chip:hover {
  color: #fff;
  border-color: var(--primary-pink);
}

.trait-chip.selected {
  background: var(--grad-pink-purple);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 8px rgba(255, 42, 133, 0.35);
}

/* Turnaround Output Display */
.turnaround-card {
  background: var(--grad-dark-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 34px;
  box-shadow: var(--shadow-lg);
}

.turnaround-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

/* Turnaround Mockup Visual Grid */
.turnaround-visual-mockup {
  background: #0f081b;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 22px;
}

.turnaround-views-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
  gap: 12px;
}

@media (max-width: 768px) {
  .turnaround-views-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.view-card {
  background: rgba(28, 14, 48, 0.8);
  border: 1px solid rgba(255, 42, 133, 0.2);
  border-radius: var(--radius-md);
  padding: 14px 8px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.view-card-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  margin: 0 auto 10px;
  background: var(--grad-pink-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 0 14px rgba(255, 42, 133, 0.4);
}

.view-card.full-body .view-card-figure {
  height: 95px;
  width: 44px;
  margin: 0 auto 10px;
  background: linear-gradient(180deg, #9333ea 0%, #ec4899 100%);
  border-radius: 12px 12px 6px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.view-card-title {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-pink);
  margin-bottom: 2px;
}

.view-card-sub {
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* Prompt Code Area */
.prompt-code-area {
  background: #0d0617;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.84rem;
  color: #cbd5e1;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 16px;
}

/* Character Gallery Grid */
.character-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

.character-card {
  background: var(--grad-dark-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.character-card:hover {
  border-color: var(--primary-pink);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.char-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.char-card-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: var(--grad-pink-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(255, 42, 133, 0.4);
}

.char-card-info h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.char-card-info .char-role-badge {
  font-size: 0.7rem;
  color: var(--text-pink);
  font-weight: 600;
}

.char-card-details {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.char-card-details strong {
  color: #e2e8f0;
}

.char-card-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
}

.char-trait-pill {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(139, 50, 235, 0.2);
  color: var(--text-purple);
  border: 1px solid rgba(139, 50, 235, 0.3);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 3, 11, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: scale(0.96);
  transition: transform var(--transition-fast);
}

.modal-overlay.active .modal-dialog {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  color: #fff;
  background: rgba(255, 42, 133, 0.2);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
}

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

.toast {
  pointer-events: auto;
  background: var(--grad-dark-card);
  border: 1px solid var(--primary-pink);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-md);
  animation: slideInToast 0.25s ease forwards;
}

@keyframes slideInToast {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Loading Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

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

/* Screenplay Save Bar / Alert */
.screenplay-save-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, rgba(255, 42, 133, 0.15), rgba(139, 50, 235, 0.15));
  border: 1px solid rgba(255, 42, 133, 0.4);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.3s ease;
}

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

.save-bar-icon {
  font-size: 1.6rem;
}

.save-bar-info strong {
  display: block;
  font-size: 0.95rem;
  color: #fff;
}

.save-bar-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Scenarios Tab & Grid */
.tab-header-box {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.scenarios-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-box-wrap {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-box-wrap .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box-wrap input {
  padding-left: 38px;
}

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

/* Scenario Card */
.scenario-card {
  background: var(--grad-dark-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.scenario-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-pink), var(--primary-purple));
  opacity: 0.7;
}

.scenario-card:hover {
  border-color: rgba(255, 42, 133, 0.45);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.scenario-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.scenario-country-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
}

.scenario-card-date {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.scenario-card-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.35;
  margin-bottom: 10px;
}

.scenario-card-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.scenario-card-actors {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.scenario-card-actors strong {
  color: #fff;
}

.scenario-card-synopsis {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.scenario-card-meta-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.scenario-card-actions .btn {
  font-size: 0.78rem;
  padding: 7px 12px;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .nav-tabs {
    overflow-x: auto;
    max-width: 100%;
  }
  .scenarios-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .hero-banner {
    padding: 24px 20px;
  }
  .hero-title {
    font-size: 1.7rem;
  }
  .header-actions .btn-header-cta span.btn-text {
    display: none;
  }
  .form-panel {
    position: static;
    max-height: none;
  }
}

/* Close Screenplay Output Button Styling */
#btn-close-screenplay, #btn-close-screenplay-header {
  transition: all 0.2s ease;
}
#btn-close-screenplay:hover, #btn-close-screenplay-header:hover {
  background: rgba(255, 42, 133, 0.2) !important;
  color: #fff !important;
  border-color: var(--pink-hot) !important;
}

/* Sketch Prompt Button */
.btn-sketch-prompt {
  font-weight: 600;
  border-color: rgba(255, 120, 149, 0.35);
}
.btn-sketch-prompt:hover {
  background: rgba(255, 42, 133, 0.22);
  color: #fff;
  border-color: var(--pink-hot);
  box-shadow: 0 0 10px rgba(255, 42, 133, 0.35);
}

/* ==========================================
   MARKET ANALYTICS & TREND INTELLIGENCE STYLES
   ========================================== */
.market-analytics-section {
  background: rgba(18, 9, 31, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  margin-bottom: 36px;
  position: relative;
  overflow: hidden;
}

.market-analytics-section::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.analytics-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 42, 133, 0.14);
  border: 1px solid rgba(255, 42, 133, 0.35);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-pink);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.analytics-live-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #a78bfa;
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #10b981;
  animation: pulseGreen 1.8s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.analytics-controls-bar {
  background: rgba(24, 12, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.analytics-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.analytics-controls-row-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.analytics-control-group, .analytics-region-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.control-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.analytics-search-wrap {
  position: relative;
  min-width: 280px;
  flex: 1;
  max-width: 440px;
}

.analytics-search-field {
  width: 100%;
  background: rgba(14, 7, 24, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  padding: 8px 36px 8px 36px;
  font-size: 0.84rem;
  color: #fff;
  transition: all var(--transition-fast);
}

.analytics-search-field:focus {
  outline: none;
  border-color: var(--primary-pink);
  box-shadow: 0 0 12px rgba(255, 42, 133, 0.35);
  background: rgba(18, 9, 31, 0.95);
}

.analytics-search-wrap .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: var(--text-dim);
  pointer-events: none;
}

.analytics-search-wrap .search-clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  cursor: pointer;
}

.analytics-quick-summary {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Analytics Cards & Grid */
.analytics-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.analytics-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.analytics-card {
  background: var(--grad-dark-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.analytics-card:hover {
  border-color: rgba(255, 42, 133, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.analytics-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.analytics-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Keyword Rank Table/List */
.keyword-rank-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.keyword-rank-item {
  background: rgba(26, 13, 44, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition: all var(--transition-fast);
}

.keyword-rank-item:hover {
  border-color: rgba(255, 42, 133, 0.4);
  background: rgba(38, 18, 64, 0.85);
  transform: translateX(3px);
}

.keyword-rank-badge {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.rank-top1 { background: linear-gradient(135deg, #ffd700, #ff8c00); color: #000; box-shadow: 0 0 10px rgba(255, 215, 0, 0.4); }
.rank-top2 { background: linear-gradient(135deg, #e0e0e0, #9e9e9e); color: #000; }
.rank-top3 { background: linear-gradient(135deg, #cd7f32, #8b4513); color: #fff; }
.rank-normal { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }

.keyword-main-info {
  flex: 1;
  min-width: 0;
}

.keyword-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}

.keyword-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
}

.keyword-category-tag {
  font-size: 0.68rem;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.keyword-meta-row {
  font-size: 0.74rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.keyword-vol {
  color: #38bdf8;
  font-weight: 600;
}

.keyword-growth-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.keyword-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Viral Titles Cards */
.viral-title-card {
  background: rgba(25, 12, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: all var(--transition-fast);
}

.viral-title-card:hover {
  border-color: var(--primary-pink);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 42, 133, 0.2);
}

.viral-title-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.title-platform-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: #f472b6;
  background: rgba(244, 114, 182, 0.12);
  border: 1px solid rgba(244, 114, 182, 0.25);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.title-ctr-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.viral-title-text {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
}

.viral-hook-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary-pink);
}

.viral-title-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-dim);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 10px;
}

/* Genre Share Card */
.genre-progress-item {
  margin-bottom: 14px;
}

.genre-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.genre-progress-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.genre-progress-metric {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-pink);
}

.genre-progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.genre-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--grad-pink-purple);
  transition: width 0.6s ease;
}

.genre-progress-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 3px;
  display: flex;
  justify-content: space-between;
}

/* Tropes Cards */
.trope-card-item {
  background: rgba(24, 11, 40, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--transition-fast);
}

.trope-card-item:hover {
  border-color: rgba(168, 85, 247, 0.5);
  background: rgba(35, 17, 58, 0.85);
  transform: translateY(-2px);
}

.trope-name {
  font-size: 0.94rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.trope-why {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.trope-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .analytics-grid-2, .analytics-grid-3 {
    grid-template-columns: 1fr;
  }
  .analytics-controls-row, .analytics-controls-row-sub {
    flex-direction: column;
    align-items: flex-start;
  }
  .analytics-search-wrap {
    width: 100%;
    max-width: 100%;
  }
}

/* Modal Wide & Title Inspiration Auto-Search Styles */
.modal-dialog-wide {
  max-width: 860px !important;
  width: 95% !important;
}

.filter-pill-sm {
  font-size: 0.72rem !important;
  padding: 3px 10px !important;
}

.title-inspo-card {
  padding: 12px 16px;
  background: rgba(30, 14, 52, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.18s ease;
  cursor: pointer;
}

.title-inspo-card:hover {
  background: rgba(48, 20, 80, 0.9);
  border-color: rgba(255, 42, 133, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.title-inspo-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.title-rank-num {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  width: 38px;
  text-align: center;
  flex-shrink: 0;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
}

.title-inspo-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.title-inspo-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  word-break: break-word;
}

.title-inspo-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.75rem;
}

.title-badge-country {
  padding: 1px 7px;
  border-radius: 9999px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-sub);
}

.title-badge-genre {
  padding: 1px 7px;
  border-radius: 9999px;
  font-weight: 600;
  background: rgba(184, 41, 247, 0.18);
  border: 1px solid rgba(184, 41, 247, 0.3);
  color: #d8b4fe;
}

.title-inspo-score {
  color: #ff7895;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 3px;
}

.title-inspo-searches {
  color: var(--text-muted);
}

.title-highlight {
  background: rgba(255, 42, 133, 0.35);
  color: #fff;
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 800;
}

.title-inspo-btn {
  font-weight: 600;
  flex-shrink: 0;
}

/* ==========================================
   SMART FILTER (FILTER CERDAS KONSISTENSI)
   ========================================== */
.smart-filter-toggle-wrap {
  display: flex;
  align-items: center;
}

.btn-smart-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(184, 41, 247, 0.12);
  border: 1px solid rgba(184, 41, 247, 0.4);
  color: #d8b4fe;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(184, 41, 247, 0.15);
}

.btn-smart-filter-toggle:hover {
  background: rgba(184, 41, 247, 0.22);
  border-color: rgba(184, 41, 247, 0.6);
  transform: translateY(-1px);
}

.btn-smart-filter-toggle.active {
  background: linear-gradient(135deg, rgba(184, 41, 247, 0.25), rgba(255, 42, 133, 0.25));
  border-color: rgba(255, 42, 133, 0.5);
  color: #fff;
  box-shadow: 0 0 15px rgba(255, 42, 133, 0.3);
}

.smart-filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-filter-dot 2s infinite ease-in-out;
}

.btn-smart-filter-toggle:not(.active) .smart-filter-dot {
  background: #64748b;
  box-shadow: none;
  animation: none;
}

@keyframes pulse-filter-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

.smart-filter-banner {
  margin-top: 14px;
  background: linear-gradient(135deg, rgba(20, 24, 45, 0.85), rgba(30, 20, 48, 0.85));
  border: 1px solid rgba(184, 41, 247, 0.25);
  border-radius: 10px;
  padding: 10px 14px;
}

.smart-filter-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.smart-filter-pill-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.smart-filter-pill-badge.badge-active {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.smart-filter-summary-text {
  font-size: 0.8rem;
  color: var(--text-sub);
}

.smart-filter-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.76rem;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}

.legend-suggested {
  color: #fbbf24;
}

.legend-compatible {
  color: #60a5fa;
}

.legend-locked {
  color: #ef4444;
  opacity: 0.85;
}

/* Genre Chip Smart States */
.genre-chip.chip-suggested {
  border-color: rgba(251, 191, 36, 0.6);
  background: rgba(251, 191, 36, 0.12);
  color: #fef08a;
  position: relative;
}

.genre-chip.chip-suggested::after {
  content: "★";
  font-size: 0.65rem;
  margin-left: 4px;
  color: #fbbf24;
}

.genre-chip.chip-compatible {
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(96, 165, 250, 0.08);
  color: #bfdbfe;
}

.genre-chip.chip-locked {
  opacity: 0.45;
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
  cursor: not-allowed;
  text-decoration: line-through;
}

.genre-chip.chip-locked::before {
  content: "🔒 ";
  font-size: 0.7rem;
}

/* Dropdown Option Smart Classes / Styling */
select.form-select optgroup {
  background: #151930;
  color: #cbd5e1;
  font-weight: 700;
  padding: 4px 6px;
}

select.form-select optgroup[label*="Disarankan"] {
  color: #fbbf24;
  background: #181d33;
}

select.form-select optgroup[label*="Kompatibel"] {
  color: #93c5fd;
  background: #151930;
}

select.form-select optgroup[label*="Terkunci"] {
  color: #ef4444;
  background: #1c1524;
}

select.form-select option:disabled {
  color: #94a3b8;
  opacity: 0.4;
  background: #141120;
}

/* ==========================================
   PARAMETER VALIDATION ALERT & INPUT HIGHLIGHTS
   ========================================== */
.parameter-validation-alert {
  margin: 18px 0;
  background: linear-gradient(135deg, rgba(38, 14, 25, 0.95), rgba(45, 16, 32, 0.95));
  border: 1px solid rgba(239, 68, 68, 0.6);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 8px 30px rgba(239, 68, 68, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: fadeInAlert 0.3s ease-out;
  position: relative;
  overflow: hidden;
}

.parameter-validation-alert::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(180deg, #ef4444, #f59e0b);
}

@keyframes fadeInAlert {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.validation-alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.validation-alert-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.validation-alert-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.validation-alert-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: #fecaca;
  letter-spacing: -0.2px;
}

.validation-alert-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #ff8b8b;
  text-transform: uppercase;
}

.validation-alert-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s ease;
}

.validation-alert-close-btn:hover {
  color: #fff;
}

.validation-alert-desc {
  font-size: 0.84rem;
  color: #cbd5e1;
  margin-bottom: 12px;
  line-height: 1.5;
}

.validation-issues-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.validation-issue-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.84rem;
  line-height: 1.5;
}

.validation-issue-item.issue-locked {
  border-color: rgba(239, 68, 68, 0.45);
}

.validation-issue-item.issue-empty {
  border-color: rgba(245, 158, 11, 0.45);
}

.validation-issue-left {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #f1f5f9;
}

.validation-issue-tag {
  font-weight: 700;
  color: #fca5a5;
  white-space: nowrap;
}

.validation-issue-jump-btn {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fecaca;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.validation-issue-jump-btn:hover {
  background: rgba(239, 68, 68, 0.4);
  color: #fff;
}

.validation-alert-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-auto-harmonize {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  transition: all 0.2s ease;
}

.btn-auto-harmonize:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-dismiss-alert {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-dismiss-alert:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Input validation highlights */
.input-validation-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.35) !important;
  animation: pulse-validation-error 2s infinite ease-in-out !important;
}

@keyframes pulse-validation-error {
  0%, 100% { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.35); }
  50% { box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.55); }
}

.input-validation-warning {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3) !important;
}

/* ==========================================
   500 STRUCTURED EPISODES ARCHITECTURE
   ========================================== */
.structure-500-banner {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.95), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.structure-500-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(180deg, #ec4899, #8b5cf6, #06b6d4);
}

.structure-500-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.structure-500-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.structure-500-badge {
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.35);
}

.structure-500-progress-bar-wrap {
  margin: 12px 0 16px;
}

.structure-500-progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.structure-500-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ec4899, #8b5cf6, #38bdf8);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.structure-500-tools-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.jump-episode-group {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 6px;
  border-radius: 8px;
}

.jump-episode-input {
  width: 72px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #fff;
  font-size: 0.84rem;
  font-weight: 700;
  text-align: center;
  padding: 5px 4px;
}

.arcs-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0;
}

.arc-filter-pill {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #cbd5e1;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.arc-filter-pill:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: #8b5cf6;
  color: #fff;
}

.arc-filter-pill.active {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.3), rgba(139, 92, 246, 0.4));
  border-color: #ec4899;
  color: #fff;
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.3);
}

.arcs-500-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.arc-card-item {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.arc-card-item:hover {
  border-color: #8b5cf6;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.2);
}

.arc-card-item.active-arc {
  border-color: #ec4899;
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.25);
}

.arc-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.arc-number-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: #c084fc;
  background: rgba(139, 92, 246, 0.2);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.arc-range-tag {
  font-size: 0.74rem;
  font-weight: 700;
  color: #94a3b8;
}

.arc-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.35;
}

.arc-card-desc {
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin-bottom: 10px;
}

.arc-milestone-box {
  background: rgba(30, 41, 59, 0.6);
  border-left: 3px solid #8b5cf6;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  color: #e2e8f0;
  line-height: 1.45;
  margin-bottom: 12px;
}

.arc-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

/* ==========================================
   STAT CARD INTERACTIVE BUTTON
   ========================================== */
.stat-card-interactive {
  cursor: pointer;
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: linear-gradient(145deg, rgba(30, 16, 50, 0.95), rgba(15, 10, 28, 0.98));
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.stat-card-interactive:hover {
  border-color: #ec4899;
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(236, 72, 153, 0.25), inset 0 0 20px rgba(139, 92, 246, 0.2);
}

.stat-card-interactive:focus-visible {
  outline: 2px solid #ec4899;
  outline-offset: 3px;
}

.stat-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 700;
  margin-top: 10px;
  border-color: rgba(236, 72, 153, 0.5);
  color: #f472b6;
  background: rgba(236, 72, 153, 0.1);
  padding: 5px 10px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.stat-card-interactive:hover .stat-action-btn {
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.35);
}

/* ==========================================
   STRUCTURED EPISODES MODAL TABS & COMPONENTS
   ========================================== */
.structure-modal-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 24px 12px 24px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.structure-modal-tab-btn {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: #cbd5e1;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.structure-modal-tab-btn:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: #8b5cf6;
  color: #fff;
}

.structure-modal-tab-btn.active {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.35), rgba(139, 92, 246, 0.45));
  border-color: #ec4899;
  color: #fff;
  box-shadow: 0 2px 10px rgba(236, 72, 153, 0.3);
}

.structure-modal-summary-banner {
  background: rgba(30, 27, 75, 0.65);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* Format Matrix Cards */
.format-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}

.format-matrix-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.format-matrix-card:hover {
  border-color: #ec4899;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(236, 72, 153, 0.18);
}

.format-matrix-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.format-ep-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(236, 72, 153, 0.2);
  border: 1px solid rgba(236, 72, 153, 0.4);
  color: #f472b6;
}

.format-matrix-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.format-matrix-acts {
  background: rgba(30, 41, 59, 0.5);
  border-left: 3px solid #8b5cf6;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 0.74rem;
  color: #e2e8f0;
  line-height: 1.5;
  margin-bottom: 10px;
}

.format-matrix-meta {
  font-size: 0.74rem;
  color: #94a3b8;
  margin-bottom: 12px;
  line-height: 1.4;
}

/* Saved Structures List */
.saved-structures-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.saved-structure-item {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  transition: all 0.2s ease;
}

.saved-structure-item:hover {
  border-color: #8b5cf6;
  background: rgba(20, 28, 55, 0.9);
}

/* ==========================================
   USER AUTH & LOGIN MODAL STYLES
   ========================================== */
.auth-header-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 9px;
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.9), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(139, 92, 246, 0.45);
  padding: 4px 12px 4px 6px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  transition: all 0.2s ease;
}

.user-profile-badge:hover {
  border-color: #ec4899;
  box-shadow: 0 4px 18px rgba(236, 72, 153, 0.25);
}

.user-avatar-mini {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(236, 72, 153, 0.4);
}

.user-info-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-name-display {
  font-size: 0.82rem;
  font-weight: 800;
  color: #fff;
  text-transform: capitalize;
}

.user-role-badge {
  font-size: 0.62rem;
  font-weight: 800;
  color: #c084fc;
  letter-spacing: 0.5px;
}

.btn-logout-mini {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 4px;
}

.btn-logout-mini:hover {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* ==========================================
   SYSTEM LOGIN GATE & AUTHENTICATION GUARD
   (Ketika keluar, pengguna TIDAK masuk dalam sistem)
   ========================================== */
body.unauthenticated-lock {
  overflow-x: hidden;
  background-color: #080c14 !important;
}

body.unauthenticated-lock .app-header,
body.unauthenticated-lock main,
body.unauthenticated-lock footer,
body.unauthenticated-lock .floating-actions,
body.unauthenticated-lock .modal-overlay:not(#modal-login) {
  display: none !important;
}

body.unauthenticated-lock #system-login-gate {
  display: flex !important;
}

body:not(.unauthenticated-lock) #system-login-gate {
  display: none !important;
}

.system-login-gate {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
  background: radial-gradient(circle at 50% 15%, rgba(139, 92, 246, 0.22) 0%, rgba(15, 23, 42, 0.98) 70%), #070a12;
  box-sizing: border-box;
}

.login-gate-backdrop {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(236, 72, 153, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(99, 102, 241, 0.12) 0%, transparent 40%);
  pointer-events: none;
}

.login-gate-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 20px;
  padding: 34px 30px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 50px rgba(139, 92, 246, 0.15);
  animation: fadeInGate 0.35s ease-out;
}

@keyframes fadeInGate {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-gate-header {
  text-align: center;
  margin-bottom: 22px;
}

.login-gate-logo-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(30, 27, 75, 0.8);
  border: 1px solid rgba(139, 92, 246, 0.4);
  padding: 6px 14px 6px 8px;
  border-radius: var(--radius-full);
  margin-bottom: 14px;
}

.login-gate-logo {
  width: 26px;
  height: 26px;
}

.login-gate-glow-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #c084fc;
}

.login-gate-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 8px 0;
  line-height: 1.25;
}

.login-gate-subtitle {
  font-size: 0.83rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.5;
}

.login-gate-cred-callout {
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.35), rgba(30, 27, 75, 0.5));
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.login-cred-badge-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #e9d5ff;
  margin-bottom: 3px;
}

.login-cred-row {
  font-size: 0.82rem;
  color: #cbd5e1;
  font-family: monospace;
}

.login-cred-divider {
  margin: 0 6px;
  color: #a855f7;
}

.login-cred-row strong.text-highlight {
  color: #f472b6;
  font-weight: 800;
}

.login-gate-alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  margin-bottom: 18px;
  line-height: 1.45;
  animation: fadeInGate 0.2s ease-out;
}

.login-gate-alert.error {
  display: block !important;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.login-gate-alert.success {
  display: block !important;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
}

.login-gate-alert.info {
  display: block !important;
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.5);
  color: #93c5fd;
}

.login-gate-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  text-align: center;
}

.login-gate-feature-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.feature-chip {
  font-size: 0.72rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

/* ==========================================
   KARAKTER STUDIO - PAKAIAN & WARDROBE STYLING
   (Baju, Celana, Topi, Jaket, Sepatu)
   ========================================== */
.outfit-form-section {
  background: rgba(20, 10, 36, 0.65);
  border: 1px solid rgba(139, 50, 235, 0.25);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 22px;
}

.outfit-auto-indicator {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary-pink);
  background: rgba(255, 42, 133, 0.12);
  border: 1px solid rgba(255, 42, 133, 0.25);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.outfit-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
  width: 100%;
}

.outfit-slots-grid.edit-mode {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 10px;
  width: 100%;
}

@media (min-width: 768px) {
  .outfit-slots-grid.edit-mode {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 520px) {
  .outfit-slots-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .outfit-slots-grid.edit-mode {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

@media (max-width: 340px) {
  .outfit-slots-grid,
  .outfit-slots-grid.edit-mode {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.outfit-card {
  background: rgba(14, 7, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-fast);
  position: relative;
  min-width: 0;
  box-sizing: border-box;
}

.outfit-card:hover {
  border-color: rgba(255, 42, 133, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.outfit-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.outfit-card-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.outfit-status-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.outfit-status-badge.system {
  background: rgba(139, 92, 246, 0.18);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.outfit-status-badge.custom {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.45);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.3);
}

.outfit-img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #090412;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.outfit-img-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.outfit-card:hover .outfit-img-preview {
  transform: scale(1.04);
}

.outfit-upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 6, 28, 0.75);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  cursor: pointer;
  transition: opacity var(--transition-fast);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  padding: 6px;
}

.outfit-img-wrapper:hover .outfit-upload-overlay {
  opacity: 1;
}

.outfit-hidden-file {
  display: none !important;
}

.outfit-item-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 8px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 16px;
  width: 100%;
}

.outfit-card-footer {
  display: flex;
  gap: 4px;
  margin-top: auto;
  width: 100%;
  align-items: center;
}

.btn-outfit-upload {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 0.7rem !important;
  padding: 5px 6px !important;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 6px;
}

.btn-outfit-reset, .btn-edit-outfit-reset {
  flex-shrink: 0;
  font-size: 0.66rem !important;
  padding: 5px 6px !important;
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  color: #fca5a5 !important;
  border-radius: 6px;
}

.btn-outfit-reset:hover, .btn-edit-outfit-reset:hover {
  background: rgba(239, 68, 68, 0.35) !important;
}

/* Character Card Mini Outfit Strip */
.char-card-outfit-section {
  margin: 10px 0 12px;
  padding: 8px 10px;
  background: rgba(15, 7, 28, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
}

.char-card-outfit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.char-card-outfit-head strong {
  color: #fff;
}

.char-card-outfit-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

.char-outfit-mini-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #090412;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.char-outfit-mini-thumb:hover {
  transform: scale(1.12);
  border-color: var(--primary-pink);
  z-index: 2;
}

.char-outfit-mini-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.char-outfit-mini-thumb.custom-indicator::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 4px #10b981;
}

/* Turnaround Outfit Showcase */
.turnaround-outfit-showcase {
  background: rgba(15, 8, 27, 0.85);
  border: 1px solid rgba(255, 42, 133, 0.2);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.turnaround-outfit-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

@media (min-width: 900px) {
  .turnaround-outfit-strip {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 820px) {
  .turnaround-outfit-strip {
    grid-template-columns: repeat(3, 1fr);
  }
}

.turnaround-outfit-item {
  background: rgba(28, 14, 48, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 10px;
  text-align: center;
}

.turnaround-outfit-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: #0a0414;
  margin-bottom: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.turnaround-outfit-item-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.turnaround-outfit-item-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.25;
}

/* Outfit Modal View Grid */
.outfit-modal-view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 12px;
  width: 100%;
}

@media (min-width: 860px) {
  .outfit-modal-view-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 600px) {
  .outfit-modal-view-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

@media (max-width: 350px) {
  .outfit-modal-view-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.modal-outfit-card {
  background: rgba(24, 12, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-sizing: border-box;
}

.modal-outfit-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.modal-outfit-card-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-outfit-img-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #090312;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 10px;
}

.modal-outfit-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
}

.modal-outfit-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fce7f3;
  margin-bottom: 4px;
}

.modal-outfit-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 8px;
}

/* ==========================================
   ADVANCED RESPONSIVE SYSTEM (MOBILE & TABLET OPTIMIZATIONS)
   ========================================== */

/* Universal container responsive padding */
@media (max-width: 768px) {
  .app-container {
    padding-left: 14px;
    padding-right: 14px;
  }
}

@media (max-width: 480px) {
  .app-container {
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* Header & Navigation Bar Responsiveness */
@media (max-width: 960px) {
  .header-container {
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 0;
  }

  .nav-tabs {
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: flex-start;
    padding: 4px;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tab-btn {
    flex-shrink: 0;
    padding: 7px 14px;
    font-size: 0.82rem;
  }
}

@media (max-width: 640px) {
  .brand-logo-img {
    width: 38px;
    height: 38px;
  }

  .brand-text-block h1 {
    font-size: 1.3rem;
  }

  .brand-badge {
    display: none;
  }

  .header-actions {
    gap: 8px;
  }

  .btn-header-cta {
    padding: 7px 12px;
    font-size: 0.78rem;
  }
}

@media (max-width: 420px) {
  .brand-subtitle {
    display: none;
  }

  .nav-tab-btn {
    padding: 6px 11px;
    font-size: 0.78rem;
    gap: 5px;
  }

  .nav-tab-btn .tab-icon {
    font-size: 0.9rem;
  }
}

/* Form Grids & Controls Responsiveness */
@media (max-width: 768px) {
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .form-panel {
    padding: 18px 14px;
    position: static;
    max-height: none;
    overflow-y: visible;
  }

  .generate-layout,
  .character-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .form-actions-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .form-actions-bar .btn {
    width: 100%;
    justify-content: center;
  }

  /* Prevent iOS zoom on input focus */
  .form-control,
  .form-select {
    font-size: 16px;
  }
}

/* Character Studio Wardrobe & Outfit Responsive Refinements */
@media (max-width: 900px) {
  .outfit-slots-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .outfit-slots-grid.edit-mode {
    grid-template-columns: repeat(3, 1fr);
  }

  .outfit-modal-view-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 580px) {
  .outfit-slots-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .outfit-slots-grid.edit-mode {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .outfit-modal-view-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .turnaround-outfit-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .turnaround-views-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .outfit-card {
    padding: 8px;
  }

  .outfit-card-title {
    font-size: 0.78rem;
  }

  .outfit-item-name {
    font-size: 0.72rem;
  }

  .btn-outfit-upload {
    padding: 5px 8px;
    font-size: 0.68rem;
  }

  .btn-outfit-reset {
    padding: 5px 6px;
    font-size: 0.68rem;
  }
}

@media (max-width: 380px) {
  /* Ultra-compact single column layout for tiny screens */
  .outfit-slots-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .outfit-slots-grid.edit-mode {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .outfit-card {
    display: grid;
    grid-template-columns: 80px 1fr;
    grid-template-rows: auto auto auto;
    gap: 6px 10px;
    align-items: center;
  }

  .outfit-card-header {
    grid-column: 1 / -1;
    margin-bottom: 2px;
  }

  .outfit-img-wrapper {
    grid-row: 2 / 4;
    width: 80px;
    height: 80px;
    margin-bottom: 0;
  }

  .outfit-item-name {
    grid-column: 2;
    grid-row: 2;
    margin-bottom: 0;
    align-self: end;
  }

  .outfit-card-footer {
    grid-column: 2;
    grid-row: 3;
    align-self: start;
    justify-content: flex-start;
  }

  .turnaround-outfit-strip {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .outfit-modal-view-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* Character Gallery & Cards Responsiveness */
@media (max-width: 768px) {
  .character-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 14px;
  }

  .gallery-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .gallery-filter-pills {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .turnaround-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .turnaround-header > div:last-child {
    width: 100%;
  }

  .turnaround-header .btn {
    flex: 1;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .character-gallery-grid {
    grid-template-columns: 1fr;
  }

  .character-card {
    padding: 14px 12px;
  }

  .char-outfit-strip {
    gap: 4px;
  }

  .char-outfit-thumb-wrap {
    width: 32px;
    height: 32px;
  }

  .character-card-footer {
    flex-direction: column;
    gap: 6px;
  }

  .character-card-footer .btn {
    width: 100%;
  }
}

/* Modals & Dialogs Mobile Ergonomics */
@media (max-width: 768px) {
  .modal-dialog,
  .modal-dialog-wide {
    width: 95% !important;
    max-width: 95% !important;
    max-height: 94vh;
    border-radius: 16px;
    margin: 10px auto;
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-title {
    font-size: 1.1rem;
  }

  .modal-body {
    padding: 16px 14px;
  }

  .modal-footer {
    padding: 12px 14px;
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-footer .btn {
    width: 100%;
    justify-content: center;
  }

  .login-gate-card {
    padding: 24px 18px;
    width: 92%;
    border-radius: 16px;
  }

  .login-gate-title {
    font-size: 1.35rem;
  }

  .login-gate-cred-callout {
    padding: 10px 12px;
  }

  .login-gate-cred-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* Storyboard Screenplay & Episodes Responsive Enhancements */
@media (max-width: 768px) {
  .screenplay-header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .screenplay-tools-bar {
    width: 100%;
    flex-wrap: wrap;
    gap: 6px;
  }

  .screenplay-tools-bar .btn {
    flex: 1 1 calc(50% - 6px);
    font-size: 0.78rem;
    padding: 8px 10px;
  }

  .episode-block-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .scene-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .scene-card {
    padding: 14px 12px;
  }

  .prompt-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .prompt-title-row .btn {
    width: 100%;
  }

  .structure-500-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* Toast Notification Mobile Positioning */
@media (max-width: 640px) {
  .toast-container {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }

  .toast {
    width: 100%;
    font-size: 0.82rem;
    padding: 10px 14px;
  }
}



