/* ==========================================================================
   Design System & Theme Tokens (Minimalist Modern SaaS)
   ========================================================================== */
:root {
  --bg-main: #09090b;
  --bg-surface: #121215;
  --bg-card: #18181b;
  --bg-card-hover: #202024;
  --bg-input: #27272a;
  
  --border-color: #27272a;
  --border-subtle: #1f1f23;
  --border-focus: #3f3f46;

  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-slate: #f8fafc;
  
  --text-main: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;

  --status-pending: #eab308;
  --status-pending-bg: rgba(234, 179, 8, 0.1);
  --status-processing: #3b82f6;
  --status-processing-bg: rgba(59, 130, 246, 0.1);
  --status-success: #10b981;
  --status-success-bg: rgba(16, 185, 129, 0.1);
  --status-error: #ef4444;
  --status-error-bg: rgba(239, 68, 68, 0.1);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* App Container */
.app-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

/* Top Navigation Bar */
.top-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 36px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-logo-icon {
  width: 28px;
  height: 28px;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Language Switcher Dropdown */
.language-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: 0.875rem;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition-fast);
}

.language-switcher:hover {
  border-color: var(--border-focus);
}

.lang-select {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
}

.lang-select option {
  background-color: var(--bg-card);
  color: var(--text-main);
}

/* Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: 48px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-full);
  color: var(--accent-primary);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--text-main);
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Main Grid Layout */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-bottom: 64px;
}

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

/* Minimalist Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

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

.card-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.custom-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-fast);
}

.custom-select:focus {
  border-color: var(--accent-primary);
}

/* Toggle Group */
.toggle-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.form-group .toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
  user-select: none;
  position: relative;
  gap: 16px;
}


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

.toggle-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.toggle-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.toggle-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.toggle-switch {
  display: inline-block;
  width: 44px;
  height: 24px;
  background: #3f3f46;
  border-radius: 999px;
  position: relative;
  transition: background 0.2s ease;
  flex-shrink: 0;
}



.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.toggle-checkbox:checked + .toggle-switch {
  background: var(--accent-primary);
}

.toggle-checkbox:checked + .toggle-switch::after {
  transform: translateX(20px);
}

/* Dropzone Minimalist */
.dropzone-card {
  margin-top: 20px;
}

.dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
  background: var(--bg-surface);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.03);
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-icon {
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
}

.drop-icon svg {
  width: 40px;
  height: 40px;
}


.dropzone h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.dropzone p {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.limit-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Supported Formats */
.supported-formats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
}

.supported-formats span {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  background: var(--bg-input);
  border-radius: 4px;
  color: var(--text-dim);
}

/* Results Panel */
.results-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.results-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.results-title h2 {
  font-size: 1rem;
  font-weight: 600;
}

.badge-count {
  font-size: 0.75rem;
  padding: 2px 8px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  color: var(--text-muted);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-primary-hover);
}

.btn-secondary {
  background: var(--bg-input);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--border-focus);
}

.btn-danger-outline {
  background: transparent;
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--status-error);
}

.btn-danger-outline:hover:not(:disabled) {
  background: var(--status-error-bg);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  margin: auto 0;
}

.empty-icon {
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}

.empty-icon svg {
  width: 44px;
  height: 44px;
}


.empty-state h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.825rem;
  color: var(--text-dim);
  max-width: 320px;
  margin: 0 auto;
}

/* Transcription Items List */
.transcription-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: 480px;
}

.transcription-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
}

.item-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.item-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.item-icon {
  color: var(--accent-primary);
}

.item-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  word-break: break-all;
}

.item-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.item-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.item-status.queued {
  background: var(--status-pending-bg);
  color: var(--status-pending);
}

.item-status.processing {
  background: var(--status-processing-bg);
  color: var(--status-processing);
}

.item-status.completed {
  background: var(--status-success-bg);
  color: var(--status-success);
}

.item-status.error {
  background: var(--status-error-bg);
  color: var(--status-error);
}

.item-preview {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
  white-space: pre-wrap;
  max-height: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 760px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

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

.modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title h3 {
  font-size: 1rem;
  font-weight: 600;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-text {
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-main);
  white-space: pre-wrap;
  line-height: 1.6;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* SEO Content Sections */
.seo-section {
  margin-bottom: 64px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 12px;
}

.section-subtitle {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 36px;
}

/* Steps Grid */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

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

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  position: relative;
}

.step-number {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: 12px;
}

.step-card h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.step-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

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

.feature-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
}

.feature-icon {
  width: 36px;
  height: 36px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  margin-bottom: 12px;
}

.feature-item h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.feature-item p {
  font-size: 0.825rem;
  color: var(--text-muted);
}

/* FAQ Accordion */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 16px 20px;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.faq-question i {
  transition: transform var(--transition-fast);
}

.faq-item.active .faq-question i {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 20px 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
  display: none;
  line-height: 1.6;
}

.faq-item.active .faq-answer {
  display: block;
}

/* Footer */
.app-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 32px;
  text-align: center;
  font-size: 0.825rem;
  color: var(--text-dim);
}

/* Admin Dashboard Styles */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 32px;
}

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

.admin-login-card {
  max-width: 400px;
  margin: 60px auto;
}

.stats-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

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

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--accent-primary);
  margin-top: 4px;
}

.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 28px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 0.85rem;
}

.admin-table th, .admin-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.admin-table th {
  color: var(--text-dim);
  font-weight: 600;
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: #fff;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideIn 0.2s ease forwards;
}

.toast.success { background: #059669; }
.toast.error { background: #dc2626; }
.toast.info { background: #2563eb; }

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

/* PWA Install Banner styling */
.pwa-install-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  animation: slideIn 0.3s ease;
}

.pwa-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-icon {
  width: 36px;
  height: 36px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.pwa-text h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.pwa-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

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

/* Mobile Media Queries */
@media (max-width: 768px) {
  .app-container {
    padding: 0 16px 48px;
  }
  
  .top-navbar {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
    padding: 16px 0;
    margin-bottom: 24px;
  }
  
  .navbar-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .hero-title {
    font-size: 1.85rem;
  }
  
  .hero-subtitle {
    font-size: 0.95rem;
  }
  
  .results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .results-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .results-actions .btn {
    flex: 1;
    min-width: 100px;
  }
  
  .steps-grid, .features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .pwa-install-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .pwa-actions {
    width: 100%;
    justify-content: flex-end;
  }
  
  .modal-container {
    max-height: 90vh;
  }
  
  .modal-footer {
    flex-direction: column;
    gap: 8px;
  }
  
  .modal-footer .btn {
    width: 100%;
  }

  .stats-overview-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

