/* Core Design System & Tokens */
:root {
  --bg-color: #07080d;
  --bg-card: rgba(22, 23, 32, 0.6);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-card-hover: rgba(255, 255, 255, 0.15);
  
  --primary-color: #d4ff00; /* Vibrant Neon Lime */
  --primary-glow: rgba(212, 255, 0, 0.25);
  --accent-color: #a855f7;  /* Deep Purple */
  --accent-glow: rgba(168, 85, 247, 0.25);
  
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --danger-color: #f43f5e;
  
  --font-title: 'Outfit', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Background Ambient Blurs */
.ambient-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(150px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.2;
}

.purple-glow {
  background-color: var(--accent-color);
  top: -150px;
  right: -100px;
}

.lime-glow {
  background-color: var(--primary-color);
  bottom: -150px;
  left: -100px;
}

/* Glassmorphism Utility */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass:hover {
  border-color: var(--border-card-hover);
}

/* Layout Elements */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px 24px;
}

header {
  border-bottom: 1px solid var(--border-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(7, 8, 13, 0.7);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 0;
}

.logo {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 2px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.logo .badge {
  font-size: 10px;
  background-color: var(--primary-color);
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
}

/* Header right section */
.header-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Logged In Nav */
.nav-loggedin {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

/* Logged Out Nav */
.nav-loggedout {
  display: flex;
  align-items: center;
}

nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(255,255,255,0.05);
  padding: 3px 5px;
  border-radius: 20px;
  border: 1px solid var(--border-card);
  flex-shrink: 0;
}

.btn-lang-toggle {
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 12px;
  background: transparent;
  color: rgba(255,255,255,0.5);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-title);
}

.btn-lang-toggle.active {
  background: var(--primary-color);
  color: #000;
}

/* Logged In Nav */
.nav-loggedin {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

/* Logged Out Nav */
.nav-loggedout {
  display: flex;
  align-items: center;
}


.balance-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  padding: 5px 12px;
  border-radius: 30px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.balance-pill strong {
  color: var(--primary-color);
}

.balance-unit {
  color: var(--text-muted);
  font-size: 11px;
}

/* Admin button */
.btn-admin {
  background: var(--primary-color);
  color: #000;
  border: none;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-title);
  white-space: nowrap;
}

.btn-admin:hover {
  background: #b9de00;
}

/* Header Avatar Profile Button */
.btn-avatar-header {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 2px solid var(--primary-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  font-size: 16px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-avatar-header:hover {
  border-color: #b9de00;
  box-shadow: 0 0 12px rgba(212,255,0,0.4);
  transform: scale(1.05);
}

.btn-avatar-header img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Profile Quick Actions Row */
.profile-quick-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-card);
  border-radius: 10px;
}

/* Button Typography & Styles */
button, .btn {
  font-family: var(--font-title);
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #000;
  border: none;
  padding: 10px 20px;
  font-size: 14px;
}

.btn-primary:hover {
  background-color: #b9de00;
  transform: translateY(-1px);
  box-shadow: 0 0 16px var(--primary-glow);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.05);
  color: #fff;
  border: 1px solid var(--border-card);
  padding: 10px 20px;
  font-size: 14px;
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--border-card-hover);
}

.btn-secondary-sm {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  border: 1px solid var(--border-card);
  padding: 6px 12px;
  font-size: 12px;
}

.btn-secondary-sm:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.07);
}

.btn-topup {
  background: linear-gradient(135deg, var(--accent-color), #7c3aed);
  color: #fff;
  border: none;
  padding: 8px 16px;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.btn-topup:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(168, 85, 247, 0.5);
}

.btn-submit {
  background-color: var(--primary-color);
  color: #000;
  border: none;
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 8px;
  box-shadow: 0 4px 15px var(--primary-glow);
  margin-top: 10px;
}

.btn-submit:hover {
  background-color: #bdae00;
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-submit:disabled {
  background-color: var(--text-muted);
  color: rgba(0, 0, 0, 0.3);
  box-shadow: none;
  cursor: not-allowed;
}

/* Welcome Page & Hero */
.hero-section {
  text-align: center;
  padding: 60px 0 40px 0;
}

.hero-section h1 {
  font-family: var(--font-title);
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.2;
  margin-bottom: 12px;
}

.hero-section .subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.welcome-card {
  max-width: 640px;
  margin: 40px auto;
  padding: 40px;
  text-align: center;
}

.welcome-card h2 {
  font-family: var(--font-title);
  font-size: 24px;
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.welcome-card p {
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.welcome-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
}

/* Form Styles */
.form-label {
  display: block;
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

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

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 12px 16px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  transition: all 0.2s ease;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 10px rgba(212, 255, 0, 0.15);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

/* Upload Dropzone Component */
.upload-dropzone {
  border: 2px dashed var(--border-card);
  border-radius: 12px;
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.01);
  margin-bottom: 20px;
  overflow: hidden;
}

.upload-dropzone:hover {
  border-color: var(--primary-color);
  background: rgba(212, 255, 0, 0.02);
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dropzone-icon {
  font-size: 32px;
}

.dropzone-text {
  font-size: 14px;
  font-weight: 500;
}

.dropzone-subtext {
  font-size: 12px;
  color: var(--text-muted);
}

.upload-preview {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.btn-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
}

.btn-remove:hover {
  background: var(--danger-color);
}

/* Template Selector Component */
.template-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.template-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: #0d0e15;
}

.template-card:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--primary-color);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
}

.template-card.active {
  border-color: var(--primary-color);
  box-shadow: 0 0 14px rgba(212, 255, 0, 0.4);
}

.template-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.template-card .no-video-thumb {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: rgba(0, 0, 0, 0.3);
}

.template-card .template-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 6px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.5) 70%, transparent 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-title);
}

/* Duration Pickers */
.duration-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.btn-duration {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-card);
  color: #fff;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
}

.btn-duration:hover {
  border-color: var(--border-card-hover);
}

.btn-duration.active {
  background: var(--primary-color);
  color: #000;
  border-color: var(--primary-color);
  box-shadow: 0 0 12px var(--primary-glow);
}

/* Cost Box */
.cost-summary {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.cost-line {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.cost-line:last-child {
  margin-bottom: 0;
}

.cost-line.total {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  border-top: 1px solid var(--border-card);
  padding-top: 8px;
  margin-top: 8px;
}

.cost-line.total span {
  color: var(--primary-color);
}

/* Dashboard Columns */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  margin-top: 20px;
}

@media (min-width: 900px) {
  .workspace-grid {
    grid-template-columns: 460px 1fr;
  }
}

.controls-card {
  padding: 30px;
  height: fit-content;
}

.controls-card h2 {
  font-family: var(--font-title);
  font-size: 18px;
  letter-spacing: 1px;
  margin-bottom: 24px;
  border-left: 3px solid var(--primary-color);
  padding-left: 12px;
}

.outputs-column {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Monitor Card */
.monitor-card {
  padding: 24px;
  text-align: center;
  position: relative;
}

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

.monitor-header h3 {
  font-family: var(--font-title);
  font-size: 16px;
}

.status-badge {
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 4px;
}

.status-badge.processing {
  background-color: rgba(255, 179, 0, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(255, 179, 0, 0.3);
}

.progress-bar-container {
  background: rgba(255, 255, 255, 0.05);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-bar-fill {
  background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
  height: 100%;
  width: 0%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.monitor-details {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Spinner */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  margin: 16px auto 0 auto;
  animation: spin 1s infinite linear;
}

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

/* Result Showcase Card */
.result-card {
  padding: 24px;
}

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

.result-header h3 {
  font-family: var(--font-title);
  font-size: 16px;
  color: var(--primary-color);
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
}

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

.video-container {
  width: 100%;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-container video {
  width: 100%;
  height: auto;
  max-height: 550px;
  object-fit: contain;
}

.result-meta {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-meta em {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 70%;
  white-space: nowrap;
  overflow: hidden;
  text-ellipsis: true;
  display: block;
}

/* History List Card */
.history-card {
  padding: 30px;
}

.history-card h2 {
  font-family: var(--font-title);
  font-size: 18px;
  letter-spacing: 1px;
  margin-bottom: 24px;
  border-left: 3px solid var(--accent-color);
  padding-left: 12px;
}

.history-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 600px) {
  .history-list {
    grid-template-columns: 1fr 1fr;
  }
}

.history-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.history-video-box {
  width: 100%;
  background: #000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.history-video-box video {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain;
}

.history-placeholder {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.history-item-details {
  padding: 16px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.history-item-details p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

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

.history-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.history-badge.completed {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.history-badge.failed {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
}

.history-badge.processing {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 40px 0;
  grid-column: 1 / -1;
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: opacity 0.3s ease;
  padding: 16px;
}

.modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-content {
  width: 100%;
  max-width: 440px;
  padding: 32px 24px;
  position: relative;
  margin: 0 auto;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
}

.modal-close:hover {
  color: #fff;
}

.modal-content h2 {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.modal-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.modal-footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
}

.modal-footer a:hover {
  text-decoration: underline;
}

/* Quick Topup Amounts */
.quick-topup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.btn-amount {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-card);
  color: #fff;
  padding: 12px;
  font-size: 14px;
  border-radius: 8px;
}

.btn-amount:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-card-hover);
}

.btn-amount.active {
  border-color: var(--accent-color);
  background: rgba(168, 85, 247, 0.05);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* Footer Section */
footer {
  text-align: center;
  padding: 40px 0;
  border-top: 1px solid var(--border-card);
  margin-top: 60px;
  font-size: 12px;
  color: var(--text-muted);
}

.hidden {
  display: none !important;
}

/* Switch Toggle Widget styling */
.switch-container input:checked + .switch-slider {
  background-color: var(--primary-color) !important;
}
.switch-slider:before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
.switch-container input:checked + .switch-slider:before {
  transform: translateX(22px);
}

/* Explore Grid Section Styling */
.explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.explore-card {
  position: relative;
  background: #000;
  border: 1px solid var(--border-card);
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 2/3; /* Portrait short-video aspect ratio */
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
.explore-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 10px 30px rgba(212, 255, 0, 0.15);
  transform: translateY(-4px);
}
.explore-video-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.explore-video-wrapper video,
.explore-video-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Complete crop cover for portrait grid */
}
.explore-play-indicator {
  position: absolute;
  top: 15px;
  left: 15px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  pointer-events: none;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.explore-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 24px 16px 16px 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 50%, rgba(0, 0, 0, 0) 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
}
.explore-overlay-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
}
.explore-user {
  display: flex;
  align-items: center;
  gap: 8px;
}
.explore-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.explore-username {
  font-size: 13px;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  color: #f1f5f9;
}
.explore-likes {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s;
}
.explore-likes:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: rgba(244, 63, 94, 0.4);
}
.explore-likes .heart-icon {
  color: var(--danger-color);
  font-size: 14px;
}
.explore-likes.liked .heart-icon {
  animation: heart-burst 0.3s ease-out;
}
.explore-likes .like-count {
  font-size: 12px;
  font-weight: 500;
  color: #e2e8f0;
}
.explore-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}
.btn-recreate-modern {
  flex-grow: 1;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.2s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.btn-recreate-modern:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}
.btn-recreate-modern:active {
  transform: translateY(0);
}
.btn-plus-modern {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 20px;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}
.btn-plus-modern:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}
.btn-plus-modern:active {
  transform: translateY(0);
}

@keyframes heart-burst {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* History & Template Delete/Preview Button Enhancements */
.history-item {
  position: relative;
}

.btn-delete-history {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: rgba(255, 59, 48, 0.15);
  border: 1px solid rgba(255, 59, 48, 0.3);
  color: #ff453a;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  z-index: 10;
  transition: all 0.2s ease;
}

.btn-delete-history:hover {
  background: #ff3b30;
  color: #fff;
  border-color: #ff3b30;
  box-shadow: 0 0 10px rgba(255, 59, 48, 0.5);
}

.btn-preview-tpl:hover {
  background: var(--primary-color) !important;
  color: #000 !important;
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 10px rgba(212, 255, 0, 0.3);
}

/* Drawer (Burger Navigation Sidebar) */
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  visibility: hidden;
  pointer-events: none;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.drawer.active {
  display: block !important;
  visibility: visible !important;
  pointer-events: auto !important;
  opacity: 1 !important;
}
.drawer-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.drawer.active .drawer-overlay {
  opacity: 1;
}
.drawer-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 380px;
  height: 100%;
  background: rgba(12, 13, 20, 0.95);
  border-left: 1px solid var(--border-card);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}
.drawer.active .drawer-content {
  transform: translateX(0);
}
.drawer-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.drawer-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.drawer-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #000;
  font-weight: 800;
  font-family: var(--font-title);
  display: flex;
  align-items: center;
  justify-content: center;
}
.drawer-email {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drawer-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  transition: color 0.2s;
}
.drawer-close:hover {
  color: #fff;
}
.drawer-body {
  flex-grow: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
}
.drawer-menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.drawer-menu-item {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}
.drawer-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-card-hover);
}
.drawer-menu-item .icon {
  font-size: 16px;
}
.drawer-submenu {
  transition: max-height 0.3s ease;
  overflow: hidden;
}
.drawer-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding: 8px 4px;
  border-left: 2px solid var(--border-card);
  margin-left: 24px;
  margin-bottom: 8px;
}
.drawer-tx-item {
  background: rgba(255,255,255,0.01);
  border: 1px solid rgba(255,255,255,0.03);
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.drawer-tx-info {
  display: flex;
  flex-direction: column;
}
.drawer-tx-type {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.drawer-tx-date {
  font-size: 9px;
  color: var(--text-muted);
}
.drawer-tx-amount {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.drawer-tx-amount.positive {
  color: #10b981; /* green */
}
.drawer-tx-amount.negative {
  color: var(--danger-color); /* red */
}
.empty-state-sm {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  padding: 12px;
}
.btn-logout-drawer {
  width: 100%;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.2);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--danger-color);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-title);
  text-align: center;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.2s ease;
  margin-top: 30px;
}
.btn-logout-drawer:hover {
  background: var(--danger-color);
  color: #fff;
  border-color: var(--danger-color);
}

/* Admin Sub-Tabs & Panes */
.admin-pane {
  display: block;
}
.admin-pane.hidden {
  display: none !important;
}
.admin-tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}
.admin-tab-btn.active {
  color: #fff !important;
  border-bottom-color: var(--primary-color) !important;
}

/* Top-Up Tab Headers */
.topup-pane {
  display: block;
}
.topup-pane.hidden {
  display: none !important;
}
.topup-tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}
.topup-tab-btn.active {
  color: #fff !important;
  border-bottom-color: var(--primary-color) !important;
}

/* User & Manual Transaction Tables */
table th, table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* WhatsApp Roleplay Chat Design System */
.chat-profile-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.2s ease;
}
.chat-profile-item:hover {
  background: rgba(255, 255, 255, 0.03);
}
.chat-profile-item.active {
  background: rgba(212, 255, 0, 0.1) !important;
  border-left: 3px solid var(--primary-color);
}
.chat-profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.chat-profile-info {
  flex: 1;
  overflow: hidden;
}
.chat-profile-name-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
.chat-profile-name {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-profile-role {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-profile-desc {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-profile-time {
  font-size: 11px;
  color: #25D366;
  font-weight: 600;
  white-space: nowrap;
}
.chat-profile-unread-badge {
  background: #25D366;
  color: #111b21;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Chat Bubbles Layout */
.message-bubble {
  max-width: 65%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.5;
  color: #fff;
  word-wrap: break-word;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.message-bubble.assistant {
  align-self: flex-start;
  background: #202c33;
  border-top-left-radius: 2px;
}
.message-bubble.user {
  align-self: flex-end;
  background: #005c4b; /* WhatsApp Dark Mode Green Bubble */
  border-top-right-radius: 2px;
}
.message-time {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
  text-align: right;
  display: block;
}

.message-bubble .btn-delete-msg {
  opacity: 0;
  transition: opacity 0.2s ease;
  position: absolute;
  top: 4px;
  right: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  color: rgba(255, 255, 255, 0.7);
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 10px;
  cursor: pointer;
}
.message-bubble:hover .btn-delete-msg {
  opacity: 1;
}
.message-bubble.is-deleted {
  background: rgba(32, 44, 51, 0.6) !important;
  color: rgba(255, 255, 255, 0.5) !important;
}

/* Custom scrollbar for chat message list */
#roleplay-chat-messages::-webkit-scrollbar {
  width: 6px;
}
#roleplay-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
#roleplay-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
#roleplay-chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Typing indicator keyframes */
@keyframes bounce {
  0%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-6px);
  }
}

/* ==========================================================================
   Responsive Utilities & Layout Corrections (Mobile/Tablet Support)
   ========================================================================== */

/* Header Mobile Responsiveness */
@media (max-width: 767px) {
  .header-container {
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 0 !important;
    padding: 0 14px !important;
    height: 52px !important;
  }

  .header-right {
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px !important;
  }

  nav#nav-logged-in {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: flex-end;
    gap: 6px !important;
    align-items: center !important;
  }

  .balance-pill {
    font-size: 12px !important;
    padding: 4px 8px !important;
    gap: 3px !important;
  }
}


/* Workspace Tabs Responsive Swipeable List */
.workspace-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 12px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}
.workspace-tabs::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}
.workspace-tabs button {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 20px;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Profile Grid Responsiveness */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 20px;
}
@media (min-width: 768px) {
  .profile-grid {
    grid-template-columns: 1fr 2fr;
  }
}

/* Roleplay Workspace Responsiveness */
@media (max-width: 767px) {
  /* Hide main site header, hero info, and footer when roleplay view is active */
  body.roleplay-active-mode header {
    display: none !important;
  }
  body.roleplay-active-mode .hero-section {
    display: none !important;
  }
  body.roleplay-active-mode footer {
    display: none !important;
  }
  body.roleplay-active-mode .container {
    padding: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    height: 100vh !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    touch-action: manipulation; /* disables pinch-zoom and double-tap zoom gestures */
  }
  body.roleplay-active-mode #workspace {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
    margin-top: 0 !important;
  }
  body.roleplay-active-mode .workspace-tabs {
    margin-bottom: 0 !important;
    padding: 8px 12px !important;
    background: #0f1016;
    border-bottom: 1px solid var(--border-card);
    z-index: 101;
  }
  body.roleplay-active-mode #roleplay-view {
    height: calc(100vh - 54px) !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    margin-top: 0 !important;
  }

  /* Fullscreen Chat toggling mode */
  #roleplay-workspace-layout {
    border: none !important;
    border-radius: 0 !important;
    height: 100% !important;
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
  }
  
  /* Sidebar list */
  #roleplay-workspace-layout > div:first-child {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column;
    border-right: none !important;
  }
  
  /* Chat Pane (WhatsApp Chat Box) */
  #roleplay-workspace-layout > div:last-child {
    width: 100% !important;
    height: 100% !important;
    position: absolute;
    top: 0;
    left: 0;
    background: #07080d;
    z-index: 10;
  }

  /* Toggling logic */
  body:not(.chat-open) #roleplay-workspace-layout > div:first-child {
    display: flex !important;
  }
  body:not(.chat-open) #roleplay-workspace-layout > div:last-child {
    display: none !important;
  }
  body.chat-open #roleplay-workspace-layout > div:first-child {
    display: none !important;
  }
  body.chat-open #roleplay-workspace-layout > div:last-child {
    display: flex !important;
  }
  
  /* Show back button on mobile chat pane */
  #btn-roleplay-back {
    display: inline-block !important;
  }
}

/* Image generator and other workspace grids fine-tuning for mobile */
@media (max-width: 480px) {
  .hero-section h1 {
    font-size: 24px !important;
  }
  .hero-section .subtitle {
    font-size: 12px !important;
  }
  .controls-card, .preview-card {
    padding: 20px !important;
  }
  .modal-content {
    padding: 25px 20px !important;
  }
  .quick-topup-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Media Filter Pills for Explore Feed */
.btn-explore-filter {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-title);
}

.btn-explore-filter:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-explore-filter.active {
  background: var(--primary-color);
  color: #000;
  border-color: var(--primary-color);
  box-shadow: 0 0 12px rgba(212, 255, 0, 0.3);
}

/* Image Generator Square Template Cards */
.image-template-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: #0d0e15;
}

.image-template-card:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--primary-color);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
}

.image-template-card.active {
  border-color: var(--primary-color);
  box-shadow: 0 0 14px rgba(212, 255, 0, 0.4);
}

.image-template-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-template-card .template-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 6px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.5) 70%, transparent 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-title);
}

/* Prompt Generator History Item */
.prompt-gen-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
  transition: background 0.2s ease;
}

.prompt-gen-history-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.prompt-gen-history-thumb {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.prompt-gen-history-content {
  flex: 1;
  min-width: 0;
}

.prompt-gen-history-text {
  font-size: 12px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: monospace;
}

.prompt-gen-history-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Mobile Bottom Navigation Dock */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(10, 11, 18, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 900;
  justify-content: space-around;
  align-items: center;
  padding: 0 4px;
}

.mobile-nav-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 0;
  flex: 1;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.15s ease;
}

.mobile-nav-item .nav-icon {
  font-size: 18px;
}

.mobile-nav-item.active {
  color: var(--primary-color);
}

.mobile-nav-item.active .nav-icon {
  transform: scale(1.15);
}

/* Generator Floating Action Bar */
.generator-floating-bar {
  display: none;
  position: fixed;
  bottom: 66px;
  left: 14px;
  right: 14px;
  background: rgba(22, 23, 32, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card-hover);
  border-radius: 30px;
  padding: 8px 14px;
  z-index: 850;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.floating-cost-pill {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.floating-cost-pill strong {
  color: var(--primary-color);
}

.btn-floating-submit {
  background-color: var(--primary-color);
  color: #000;
  border: none;
  font-weight: 800;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 4px 15px var(--primary-glow);
}

@media (max-width: 767px) {
  .mobile-bottom-nav {
    display: flex;
  }
  .workspace-tabs {
    display: none !important;
  }

  /* ─── CORE: Container edge-to-edge on mobile ─── */
  .container {
    padding: 0 0 140px 0 !important;
  }

  /* ─── Hero section compact ─── */
  .hero-section {
    padding: 20px 16px;
  }
  .hero-section h1 {
    font-size: 20px;
  }
  .hero-section .subtitle {
    font-size: 13px;
  }

  /* ─── FEED / EXPLORE GRID: Full-width edge-to-edge ─── */
  .explore-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 3px !important;
    margin-top: 8px !important;
    padding: 0 !important;
  }
  .explore-card {
    border-radius: 4px !important;
    border: none !important;
  }
  .explore-card:hover {
    transform: none !important;
  }

  /* ─── History Grids ─── */
  .history-grid, #image-history-list, #history-list {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 4px !important;
    padding: 0 8px !important;
  }

  /* ─── Filter / Tab Buttons row ─── */
  .explore-filters {
    padding: 8px 10px;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .explore-filters::-webkit-scrollbar { display: none; }

  /* ─── Content cards inside views: reduced padding ─── */
  .controls-card,
  .preview-card {
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    margin: 0 !important;
    padding: 16px 12px !important;
  }

  /* ─── Explore view: grid is edge-to-edge, remove all card padding from sides ─── */
  #explore-view .controls-card {
    padding: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
  }
  /* Keep explore header/title with some padding */
  #explore-view .controls-card > div:first-child {
    padding: 12px 12px 4px;
  }
  #explore-view .controls-card > p {
    padding: 0 12px;
    margin-bottom: 8px !important;
  }
  /* Pagination bar: give it padding */
  #explore-pagination {
    padding: 12px !important;
  }

  /* ─── Workspace grid (generator/image): stack vertically, no side gap ─── */
  .workspace-grid {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    padding: 0 !important;
  }

  /* ─── Profile grid ─── */
  .profile-grid {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    padding: 0 !important;
  }
  .profile-grid .controls-card,
  .profile-grid .preview-card {
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    margin: 0 !important;
  }

  /* ─── Explore section title/header row ─── */
  .section-title,
  .explore-section-header {
    padding: 10px 12px 4px;
  }

  /* ─── Explore card overlay text ─── */
  .explore-card-content {
    padding: 8px 8px 8px 8px !important;
  }
  .explore-card-title {
    font-size: 11px !important;
  }
  .btn-recreate-modern {
    padding: 4px 8px !important;
    font-size: 10px !important;
  }

  /* ─── Header mobile: compact ─── */
  .header-container {
    padding: 10px 14px;
  }
  .logo {
    font-size: 18px;
  }
  .balance-pill {
    padding: 4px 8px;
    font-size: 11px;
  }
  .balance-pill .icon {
    display: none;
  }
  .btn-topup {
    padding: 6px 10px;
    font-size: 12px;
  }
  .btn-admin {
    padding: 5px 8px;
    font-size: 11px;
  }

  /* ─── Roleplay: fix input above bottom nav ─── */
  .roleplay-view-container,
  #roleplay-view {
    padding-bottom: 70px !important;
  }
  body.chat-open .roleplay-workspace-layout,
  #roleplay-view .roleplay-workspace-layout {
    padding-bottom: 70px !important;
  }

  /* ─── Task Monitor & Showcase: no side padding ─── */
  #task-monitor,
  #result-showcase,
  #image-task-monitor,
  #image-result-showcase {
    margin: 0 !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
  }

  /* ─── Image template grid ─── */
  #image-templates-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 4px !important;
    padding: 0 8px !important;
  }

  /* ─── Video template grid ─── */
  #template-list {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 4px !important;
    padding: 0 8px !important;
  }
}

/* ─── Premium Landing Page Styles ─── */
.landing-hero {
  text-align: center;
  padding: 80px 20px 40px;
  max-width: 800px;
  margin: 0 auto;
}

.landing-title {
  font-family: var(--font-title);
  font-size: 46px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #fff 30%, var(--primary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto 36px;
}

.landing-badge-bonus {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(212, 255, 0, 0.1);
  border: 1px solid rgba(212, 255, 0, 0.25);
  padding: 6px 14px;
  border-radius: 20px;
  color: var(--primary-color);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 24px;
  font-family: var(--font-title);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.landing-badge-bonus .pulse {
  width: 8px;
  height: 8px;
  background-color: var(--primary-color);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--primary-color);
  animation: bonusPulse 1.8s infinite;
}

@keyframes bonusPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(212, 255, 0, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(212, 255, 0, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(212, 255, 0, 0); }
}

.landing-cta-group {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 80px;
}

.landing-cta-group .btn-primary {
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 30px;
  box-shadow: 0 4px 20px rgba(212, 255, 0, 0.3);
}

.landing-cta-group .btn-secondary {
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.03);
}

/* Landing Features Section */
.landing-section-title {
  text-align: center;
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 40px;
  letter-spacing: -0.5px;
}

.landing-features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto 80px;
  padding: 0 20px;
}

.landing-feature-card {
  padding: 32px;
  border-radius: 16px;
  border: 1px solid var(--border-card);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.landing-feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(212, 255, 0, 0.2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.landing-feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.landing-feature-card:hover::before {
  transform: scaleX(1);
}

.feature-icon-wrapper {
  font-size: 32px;
  margin-bottom: 20px;
  display: inline-flex;
}

.landing-feature-card h3 {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 12px;
  color: #fff;
}

.landing-feature-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

/* Bottom banner */
.landing-footer-banner {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 100px;
  padding: 48px 32px;
  border-radius: 20px;
  border: 1px solid rgba(212, 255, 0, 0.15);
  box-shadow: 0 10px 40px rgba(212, 255, 0, 0.03);
}

.landing-footer-banner h2 {
  font-family: var(--font-title);
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.landing-footer-banner p {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 28px;
}

/* Responsive Overrides */
@media (max-width: 767px) {
  .landing-hero {
    padding: 40px 16px 20px;
  }
  .landing-title {
    font-size: 30px;
  }
  .landing-subtitle {
    font-size: 14px;
    margin-bottom: 24px;
  }
  .landing-badge-bonus {
    margin-bottom: 16px;
    font-size: 10px;
  }
  .landing-cta-group {
    margin-bottom: 40px;
    gap: 12px;
  }
  .landing-cta-group .btn-primary,
  .landing-cta-group .btn-secondary {
    padding: 12px 24px;
    font-size: 14px;
    width: 100%;
  }
  .landing-features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 12px;
  }
  .landing-feature-card {
    padding: 24px;
  }
  .landing-footer-banner {
    margin: 0 12px 60px;
    padding: 32px 20px;
  }
  .landing-footer-banner h2 {
    font-size: 22px;
  }
  .landing-footer-banner p {
    font-size: 13px;
  }
}

/* Video Motion Specific Styles */
.vm-editor-card {
  border: 1px solid var(--border-card);
  border-radius: 12px;
  background: rgba(18, 18, 20, 0.6);
  backdrop-filter: blur(10px);
}

.timeline-scrubber-container input[type="range"] {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  transition: background 0.2s;
}

.timeline-scrubber-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  box-shadow: 0 0 10px var(--primary-color);
}

/* Sleek TikTok URL Input Component */
.tiktok-input-wrapper {
  background: rgba(13, 14, 21, 0.7);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 4px 6px 4px 14px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.tiktok-input-wrapper:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 12px rgba(212, 255, 0, 0.25);
  background: rgba(20, 22, 34, 0.85);
}

.tiktok-input-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tiktok-input-icon {
  font-size: 18px;
  color: var(--primary-color);
  flex-shrink: 0;
}

.tiktok-input-field {
  flex: 1;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: #fff !important;
  font-size: 13px !important;
  padding: 10px 0 !important;
  box-shadow: none !important;
}

.tiktok-input-field::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.btn-tiktok-fetch {
  background: linear-gradient(135deg, var(--primary-color) 0%, #10b981 100%);
  color: #000;
  font-weight: 800;
  font-size: 12px;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-tiktok-fetch:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-tiktok-fetch:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* TikTok Frame Extractor Carousel Component (Sesuai Sketsa Gambar 2) */
.tiktok-frame-card {
  padding: 16px;
  border-radius: 14px;
  margin-top: 15px;
  margin-bottom: 20px;
  border: 1px solid var(--border-card);
  background: rgba(13, 14, 21, 0.75);
  backdrop-filter: blur(12px);
}

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

.tiktok-frame-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-color);
}

.btn-reset-tiktok {
  background: rgba(255, 51, 51, 0.15);
  border: 1px solid rgba(255, 51, 51, 0.3);
  color: #ff4d4d;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-reset-tiktok:hover {
  background: rgba(255, 51, 51, 0.3);
}

.tiktok-main-preview {
  position: relative;
  width: 100%;
  max-height: 420px;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tiktok-main-preview img {
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
  display: block;
}

.tiktok-frame-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

.tiktok-thumb-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 2px 10px 2px;
  scroll-behavior: smooth;
}

.tiktok-thumb-strip::-webkit-scrollbar {
  height: 6px;
}

.tiktok-thumb-strip::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.tiktok-thumb-item {
  position: relative;
  flex: 0 0 70px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.2s ease;
  background: #000;
}

.tiktok-thumb-item:hover {
  opacity: 0.9;
  transform: scale(1.04);
}

.tiktok-thumb-item.active {
  opacity: 1;
  border-color: var(--primary-color);
  box-shadow: 0 0 10px rgba(212, 255, 0, 0.4);
}

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

.tiktok-thumb-time {
  position: absolute;
  bottom: 2px;
  left: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  padding: 2px 0;
  border-radius: 4px;
}

/* ─── Livechat Floating Widget ─── */
#livechat-widget-container {
  position: fixed;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  z-index: 9999;
}

.btn-livechat-fab {
  background: var(--gradient-primary, linear-gradient(135deg, #d4ff00, #a0cc00));
  color: #000;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(212, 255, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-livechat-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 30px rgba(212, 255, 0, 0.6);
}

.livechat-unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  border-radius: 9px;
  text-align: center;
  padding: 0 4px;
  border: 2px solid #0c0d14;
}

.livechat-popup {
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%);
  width: 350px;
  height: 480px;
  max-height: 80vh;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-card);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  background: rgba(12, 13, 20, 0.95);
}

.livechat-header {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid var(--border-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.livechat-messages-body {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  word-wrap: break-word;
}

.chat-bubble.user {
  align-self: flex-end;
  background: rgba(212, 255, 0, 0.15);
  border: 1px solid rgba(212, 255, 0, 0.4);
  color: #fff;
  border-bottom-right-radius: 2px;
}

.chat-bubble.admin {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-card);
  color: #fff;
  border-bottom-left-radius: 2px;
}

.chat-bubble-time {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: right;
}

.livechat-footer {
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid var(--border-card);
  display: flex;
  gap: 8px;
}

/* ─── Mobile Responsive Livechat Popup ─── */
@media (max-width: 768px) {
  #livechat-widget-container {
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
  }

  .btn-livechat-fab {
    width: 42px;
    height: 42px;
    font-size: 18px;
  }

  .livechat-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: calc(100vw - 24px);
    max-width: 380px;
    height: 80vh;
    max-height: 540px;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
    z-index: 10001;
  }

  .livechat-footer {
    padding: 10px;
  }

  .livechat-footer input {
    font-size: 12px !important;
  }
}




