/* ==========================================================================
   AI Shorts Studio & Creator Hub - Modern Cyberpunk / Slate Dark Theme
   ========================================================================== */

:root {
  --bg-dark: #0b0f19;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(28, 36, 56, 0.85);
  --bg-chat-bubble-left: #1f293d;
  --bg-chat-bubble-right: #056162;
  
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --primary-glow: rgba(139, 92, 246, 0.35);
  
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-pink: #ec4899;
  --accent-amber: #f59e0b;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(139, 92, 246, 0.3);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --shadow-main: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --glass-blur: blur(16px);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-main);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(139, 92, 246, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.08) 0%, transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(11, 15, 25, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 0 15px var(--primary-glow);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(to right, #ffffff, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.header-badges {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
}

.badge-purple {
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
  border-color: rgba(139, 92, 246, 0.3);
}

.badge-green {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

.badge-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border-color: rgba(6, 182, 212, 0.3);
}

/* Nav Tabs */
.nav-tabs {
  max-width: 1400px;
  margin: 1rem auto 0;
  padding: 0 2rem;
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tab-btn.active {
  color: #ffffff;
  border-bottom-color: var(--primary);
  background: rgba(139, 92, 246, 0.1);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

/* Main Layout */
.main-container {
  max-width: 1400px;
  margin: 1.5rem auto 3rem;
  padding: 0 2rem;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

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

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-main);
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.grid-left-main {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .grid-2, .grid-3, .grid-left-main {
    grid-template-columns: 1fr;
  }
}

/* WhatsApp Chat UI Component */
.chat-window {
  background: #0b141a;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 680px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

.chat-header {
  background: #202c33;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.chat-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #128c7e, #25d366);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #fff;
  font-size: 1rem;
}

.chat-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #e9edef;
}

.chat-status {
  font-size: 0.75rem;
  color: #8696a0;
}

.chat-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.chat-search-input {
  background: #111b21;
  border: 1px solid #2a3942;
  border-radius: var(--radius-full);
  padding: 0.4rem 0.85rem;
  color: #d1d5db;
  font-size: 0.8rem;
  width: 180px;
  outline: none;
}
.chat-search-input:focus {
  border-color: #00a884;
}

.chat-body {
  flex: 1;
  background-color: #0b141a;
  background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.chat-date-divider {
  align-self: center;
  background: #182229;
  color: #8696a0;
  font-size: 0.7rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin: 0.5rem 0;
}

.chat-message {
  max-width: 78%;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  font-size: 0.9rem;
  position: relative;
  line-height: 1.4;
  animation: fadeIn 0.2s ease;
}

.chat-message.incoming {
  align-self: flex-start;
  background: #202c33;
  color: #e9edef;
  border-top-left-radius: 2px;
}

.chat-message.outgoing {
  align-self: flex-end;
  background: #005c4b;
  color: #e9edef;
  border-top-right-radius: 2px;
}

.chat-sender-name {
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.chat-message.incoming .chat-sender-name {
  color: #53bdeb;
}
.chat-message.outgoing .chat-sender-name {
  color: #25d366;
}

.chat-msg-time {
  font-size: 0.68rem;
  color: rgba(233, 237, 239, 0.6);
  float: right;
  margin-top: 0.25rem;
  margin-left: 0.75rem;
}

.chat-highlight-badge {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  display: inline-block;
  margin-top: 0.25rem;
}

/* Prompt Generator Controls */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.form-control, .form-select {
  width: 100%;
  background: rgba(11, 15, 25, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #ffffff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-green), #059669);
  color: #fff;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

/* Prompt Card Output */
.prompt-output-box {
  background: rgba(11, 15, 25, 0.9);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  font-family: 'Fira Code', monospace, sans-serif;
  font-size: 0.88rem;
  color: #e5e7eb;
  position: relative;
  min-height: 120px;
  white-space: pre-wrap;
  word-break: break-word;
}

.copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
}
.copy-btn:hover {
  background: var(--primary);
}

/* Simulator YouTube Shorts Frame */
.shorts-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.shorts-phone-frame {
  width: 320px;
  height: 568px;
  background: #000;
  border-radius: 36px;
  border: 8px solid #222634;
  position: relative;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 25px var(--primary-glow);
}

.shorts-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.5s ease;
}

.shorts-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, transparent 40%, rgba(0,0,0,0.85) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem 1rem;
  color: #fff;
}

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

.shorts-tag {
  background: rgba(236, 72, 153, 0.8);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.shorts-right-actions {
  position: absolute;
  right: 0.75rem;
  bottom: 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
}

.shorts-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  cursor: pointer;
}

.shorts-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: transform 0.2s;
}

.shorts-icon-btn:hover {
  transform: scale(1.15);
  background: rgba(255, 255, 255, 0.3);
}

.shorts-action-count {
  font-size: 0.7rem;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.shorts-bottom-meta {
  padding-right: 3.5rem;
}

.shorts-channel {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.shorts-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
}

.shorts-channel-name {
  font-size: 0.85rem;
  font-weight: 700;
}

.shorts-sub-btn {
  background: #ff0000;
  color: #fff;
  border: none;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 0.4rem;
}

.shorts-caption {
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.shorts-audio-track {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  color: #d1d5db;
}

/* Audio Visualizer Bar */
.audio-waves {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}

.wave-bar {
  width: 3px;
  background: var(--accent-cyan);
  border-radius: 2px;
  animation: waveAnim 1s ease-in-out infinite alternate;
}

.wave-bar:nth-child(1) { height: 40%; animation-delay: 0.1s; }
.wave-bar:nth-child(2) { height: 80%; animation-delay: 0.3s; }
.wave-bar:nth-child(3) { height: 100%; animation-delay: 0.2s; }
.wave-bar:nth-child(4) { height: 60%; animation-delay: 0.4s; }

@keyframes waveAnim {
  0% { transform: scaleY(0.3); }
  100% { transform: scaleY(1); }
}

/* ROI Calculator Widgets */
.stat-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
}

.stat-val {
  font-size: 1.8rem;
  font-weight: 800;
  margin: 0.3rem 0;
}

.stat-val.purple { color: #c084fc; }
.stat-val.green { color: #34d399; }
.stat-val.cyan { color: #22d3ee; }
.stat-val.amber { color: #fbbf24; }

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

/* Policy Card */
.policy-card {
  border-left: 4px solid var(--primary);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.policy-card.warning {
  border-left-color: var(--accent-amber);
}

.policy-card.danger {
  border-left-color: var(--accent-pink);
}

.policy-card.success {
  border-left-color: var(--accent-green);
}

.policy-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Table Style */
.table-custom {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.table-custom th, .table-custom td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.88rem;
}

.table-custom th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

/* Footer */
.app-footer {
  border-top: 1px solid var(--border-color);
  padding: 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(11, 15, 25, 0.95);
}

.footer-link {
  color: var(--accent-cyan);
  text-decoration: none;
}
.footer-link:hover {
  text-decoration: underline;
}
