:root {
  --bg-color: #f8fafc;
  --bg-gradient: radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.08), transparent 40%),
                 radial-gradient(circle at 85% 85%, rgba(168, 85, 247, 0.06), transparent 45%),
                 #f8fafc;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --card-border-hover: rgba(99, 102, 241, 0.4);
  
  --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #c026d3 100%);
  --primary-hover: linear-gradient(135deg, #4338ca 0%, #6d28d9 50%, #a21caf 100%);
  --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --success-hover: linear-gradient(135deg, #059669 0%, #047857 100%);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.08), 0 4px 12px -2px rgba(0, 0, 0, 0.03);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.15);
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
}

body {
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Header Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2.5rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.logo {
  font-size: 1.35rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.logo i {
  -webkit-text-fill-color: initial;
  color: #7c3aed;
  font-size: 1.4rem;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: #7c3aed;
}

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

.badge {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  padding: 0.5rem 1rem;
  border-radius: 30px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid rgba(16, 185, 129, 0.25);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-engine {
  background: rgba(124, 58, 237, 0.08);
  color: #6d28d9;
  border-color: rgba(124, 58, 237, 0.25);
}

/* AdSense Slot Styling */
.adsense-slot {
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 1.2rem;
  text-align: center;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1rem 0;
}

.ads-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Layout Container */
.container {
  max-width: 1240px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  flex: 1;
  width: 100%;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  border-color: var(--card-border-hover);
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.1);
}

.hidden {
  display: none !important;
}

h2 {
  font-size: 1.55rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

h2 i {
  color: #6d28d9;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.8rem;
  line-height: 1.5;
}

/* Article Layout Grid (Full width 2-column) */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.8rem;
  align-items: start;
}

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

.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 90px;
}

.sidebar-widget {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1.3rem;
  box-shadow: var(--shadow-lg);
}

.sidebar-widget h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 0.6rem;
}

.sidebar-articles-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.sidebar-article-item {
  display: flex;
  gap: 0.8rem;
  text-decoration: none;
  color: inherit;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}

.sidebar-article-item:hover {
  background: #f1f5f9;
}

.sidebar-article-item h5 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.sidebar-article-item p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Articles Section Styling - 100% Clickable Card (3 Articles Horizontally Per Row) */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 990px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.article-card {
  background: #f8fafc;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.article-card:hover {
  transform: translateY(-5px);
  border-color: #7c3aed;
  box-shadow: 0 15px 30px rgba(124, 58, 237, 0.12);
}

.article-card:hover .article-btn {
  background: #7c3aed;
  color: white;
}

.article-thumb {
  width: 100%;
  height: 160px;
  overflow: hidden;
}

.article-body {
  padding: 1.3rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-tag {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  margin-bottom: 0.6rem;
}

.article-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.article-body p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
  line-height: 1.5;
  flex: 1;
}

.article-btn {
  align-self: flex-start;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

/* Upload Dropzone */
.drop-zone {
  border: 2px dashed rgba(124, 58, 237, 0.35);
  border-radius: var(--radius-md);
  padding: 4rem 2rem;
  text-align: center;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.04) 0%, transparent 70%), #f8fafc;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  margin-bottom: 2rem;
}

.drop-zone:hover, .drop-zone.dragover {
  background: radial-gradient(circle, rgba(168, 85, 247, 0.08) 0%, transparent 70%), #f1f5f9;
  border-color: #7c3aed;
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.upload-icon {
  font-size: 4rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.2rem;
  display: inline-block;
  transition: transform 0.3s ease;
}

.drop-zone:hover .upload-icon {
  transform: scale(1.1) translateY(-5px);
}

.drop-zone h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.drop-zone p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}

.feature-card {
  background: #f8fafc;
  border: 1px solid var(--card-border);
  padding: 1.4rem;
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.feature-card:hover {
  background: #ffffff;
  border-color: rgba(124, 58, 237, 0.3);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 1.5rem;
  color: #7c3aed;
  margin-bottom: 0.8rem;
}

.feature-card h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-md);
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 20px rgba(109, 40, 217, 0.4);
  transform: translateY(-2px);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text-primary);
  border: 1px solid var(--card-border);
}
.btn-secondary:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.btn-success {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
}
.btn-success:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 25px rgba(109, 40, 217, 0.5);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
}
.btn-outline:hover {
  color: var(--text-primary);
  background: #f1f5f9;
  border-color: var(--text-secondary);
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 1.1rem 2.2rem;
  font-size: 1.1rem;
  border-radius: var(--radius-md);
  font-weight: 700;
}

.btn-block {
  width: 100%;
}

/* Preset Buttons Grid */
.preset-card {
  background: #f8fafc;
  padding: 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
}

.preset-card h4 {
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
  color: var(--text-secondary);
}

.preset-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.btn-preset {
  background: #ffffff;
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  padding: 0.5rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.btn-preset:hover {
  background: rgba(124, 58, 237, 0.08);
  border-color: #7c3aed;
  color: #6d28d9;
  transform: translateY(-1px);
}

/* Tips Box */
.tips-box {
  background: #fefce8;
  border: 1px solid #fef08a;
  border-radius: var(--radius-md);
  padding: 1.1rem 1.3rem;
  margin-top: 0.5rem;
}

.tips-box h4 {
  font-size: 0.9rem;
  color: #a16207;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tips-box ul {
  list-style: none;
  font-size: 0.85rem;
  color: #713f12;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.tips-box li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.4;
}

.tips-box li i {
  color: #16a34a;
  font-size: 0.75rem;
  margin-top: 3px;
}

/* Editor Workspace Layout */
.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.8rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--card-border);
}

.workspace {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.8rem;
}

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

.video-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.canvas-wrapper {
  position: relative;
  width: 100%;
  background: #000000;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--card-border);
}

#video-player {
  max-width: 100%;
  max-height: 520px;
  display: block;
}

#selection-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.video-hint {
  font-size: 0.88rem;
  color: #b45309;
  background: #fffbeb;
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid #fde68a;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Controls Side Panel */
.controls-panel {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.info-box {
  background: #f8fafc;
  padding: 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
}

.info-box h4 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-grid {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.info-grid div {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
}

.info-grid strong {
  color: var(--text-primary);
  word-break: break-all;
}

.control-group label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

select.form-control option {
  background: #ffffff;
  color: var(--text-primary);
  padding: 0.5rem;
}

.coords-card {
  background: #f8fafc;
  padding: 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
}

.coords-card h4 {
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
  color: var(--text-secondary);
}

.coords-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-bottom: 0.8rem;
}

.coords-inputs label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
  margin-bottom: 0.3rem;
}

/* Progress Card & Shimmer */
.progress-card {
  text-align: center;
  padding: 4rem 2rem;
}

.progress-bar-container {
  width: 100%;
  height: 32px;
  background: #e2e8f0;
  border-radius: 20px;
  overflow: hidden;
  margin: 2rem 0 1.2rem 0;
  border: 1px solid var(--card-border);
  padding: 3px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}

.progress-bar {
  height: 100%;
  background: var(--primary-gradient);
  background-size: 200% 200%;
  animation: shimmer 2s linear infinite;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
  color: white;
  transition: width 0.4s ease;
  box-shadow: 0 0 15px rgba(124, 58, 237, 0.3);
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

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

/* Result Section */
.result-card {
  text-align: center;
}

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

.video-preview-wrapper {
  max-width: 820px;
  margin: 0 auto 2rem auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--card-border);
}

#output-player {
  width: 100%;
  max-height: 480px;
  display: block;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* Footer & Compliance Links */
footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  border-top: 1px solid var(--card-border);
  background: #ffffff;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  margin: 0 0.3rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #7c3aed;
}

.page-card {
  width: 100%;
  margin: 0;
}

.page-content {
  line-height: 1.7;
  color: var(--text-secondary);
}

.page-content h3 {
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
}

.page-content p {
  margin-bottom: 1rem;
}

.page-content ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

/* FAQs Accordion Styling */
.faqs-card {
  margin-top: 2rem;
}

.faqs-container {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.faq-item {
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  background: #ffffff;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.faq-item:hover {
  border-color: rgba(124, 58, 237, 0.4);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.05);
}

.faq-item.active {
  border-color: #7c3aed;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.08);
}

.faq-question {
  width: 100%;
  padding: 1.1rem 1.3rem;
  background: #ffffff;
  border: none;
  text-align: left;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-family: inherit;
  transition: background-color 0.2s ease;
}

.faq-item.active .faq-question {
  background: rgba(124, 58, 237, 0.03);
  color: #7c3aed;
}

.faq-icon {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
  color: #7c3aed;
}

.faq-answer {
  padding: 0 1.3rem 1.1rem 1.3rem;
  background: #ffffff;
  color: var(--text-secondary);
  font-size: 0.93rem;
  line-height: 1.6;
  border-top: 1px solid rgba(0, 0, 0, 0.03);
}

.faq-answer p {
  margin: 0;
  padding-top: 0.8rem;
}

