/* ==========================================================================
   xmaster.buzz - SaaS Transcription Stylesheet
   Color Scheme: White background, Blue accents (#2563eb), Light Green buttons (#22c55e)
   PHP 7.4 - 8.2 & cPanel Optimized
   ========================================================================== */

:root {
  --bg-main: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;
  
  /* Blue accents */
  --blue-primary: #2563eb;
  --blue-hover: #1d4ed8;
  --blue-subtle: #eff6ff;
  --blue-border: #bfdbfe;

  /* Light Green buttons & accents */
  --green-btn: #22c55e;
  --green-hover: #16a34a;
  --green-subtle: #f0fdf4;
  --green-border: #86efac;

  /* Alert & Warning */
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #dc2626;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #b45309;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px 60px 20px;
}

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

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

.logo-badge {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--blue-primary), #3b82f6);
  color: #fff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.brand-domain {
  color: var(--blue-primary);
}

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

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

/* Hero Intro */
.hero-section {
  text-align: center;
  margin-bottom: 35px;
}

.hero-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin-bottom: 10px;
}

.hero-title span {
  color: var(--blue-primary);
}

.hero-desc {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* User Account Banner */
.user-status-bar {
  background: var(--blue-subtle);
  border: 1px solid var(--blue-border);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  font-size: 14px;
}

.user-status-bar strong {
  color: var(--blue-primary);
}

/* Transcribe Card (Pre-Generation View) */
.transcribe-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-md);
  margin-bottom: 35px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Bandwidth & Minutes Banner inside Upload Section */
.minutes-badge-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--blue-primary);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 14px;
}

.minutes-badge-box.exhausted {
  border-left-color: var(--danger-text);
  background: var(--danger-bg);
  border-color: var(--danger-border);
}

.minutes-stat {
  font-weight: 700;
  color: var(--blue-primary);
}

.minutes-stat.zero {
  color: var(--danger-text);
}

/* Language Selection */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.select-input, .text-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background-color: #fff;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease;
}

.select-input:focus, .text-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Upload Dropzone */
.dropzone {
  border: 2px dashed #cbd5e1;
  background-color: #f8fafc;
  border-radius: var(--radius-md);
  padding: 35px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  margin-bottom: 18px;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--blue-primary);
  background-color: var(--blue-subtle);
}

.dropzone.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  border-color: #e2e8f0;
  background-color: #f1f5f9;
}

.dropzone-icon {
  font-size: 38px;
  color: var(--blue-primary);
  margin-bottom: 8px;
}

.dropzone-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

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

.file-input {
  display: none;
}

/* Selected File Bar */
.selected-file-info {
  display: none;
  background: var(--blue-subtle);
  border: 1px solid var(--blue-border);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

/* Or record audio */
.record-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.record-divider::before, .record-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.record-divider:not(:empty)::before {
  margin-right: .75em;
}

.record-divider:not(:empty)::after {
  margin-left: .75em;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

/* Light Green buttons requested */
.btn-green {
  background-color: var(--green-btn);
  color: #ffffff;
}

.btn-green:hover:not(:disabled) {
  background-color: var(--green-hover);
}

.btn-blue {
  background-color: var(--blue-primary);
  color: #ffffff;
}

.btn-blue:hover:not(:disabled) {
  background-color: var(--blue-hover);
}

.btn-outline {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover:not(:disabled) {
  background-color: var(--bg-subtle);
  border-color: #cbd5e1;
}

.btn-outline-blue {
  background-color: #ffffff;
  border: 1px solid var(--blue-primary);
  color: var(--blue-primary);
}

.btn-outline-blue:hover:not(:disabled) {
  background-color: var(--blue-subtle);
}

.btn-record {
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid var(--border-color);
  width: 100%;
}

.btn-record.recording {
  background-color: var(--danger-bg);
  color: var(--danger-text);
  border-color: var(--danger-border);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 12px;
}

.btn-full {
  width: 100%;
}

/* Bandwidth Exhausted Notice */
.exhausted-notice {
  display: none;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 15px;
  color: var(--danger-text);
  text-align: center;
  font-size: 14px;
}

.exhausted-notice.active {
  display: block;
}

/* Loading Spinner */
.loading-box {
  display: none;
  text-align: center;
  padding: 30px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(37, 99, 235, 0.2);
  border-radius: 50%;
  border-top-color: var(--blue-primary);
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

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

/* Post-Generation Transcription Layout */
.output-section {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 25px;
  box-shadow: var(--shadow-md);
  margin-bottom: 35px;
}

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

.output-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

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

.output-box {
  display: flex;
  flex-direction: column;
}

.output-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.output-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--blue-subtle);
  color: var(--blue-primary);
  font-weight: 600;
}

.transcript-textarea {
  width: 100%;
  height: 280px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #1e293b;
  background-color: #fafafa;
  resize: vertical;
  margin-bottom: 12px;
}

.transcript-textarea.clean {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
}

.transcript-textarea:focus {
  border-color: var(--border-focus);
  background-color: #fff;
  outline: none;
}

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

.combined-actions {
  display: flex;
  justify-content: center;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

/* Pricing Section */
.pricing-section {
  margin-top: 50px;
  margin-bottom: 40px;
}

.section-head {
  text-align: center;
  margin-bottom: 30px;
}

.section-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.section-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

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

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

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
}

.pricing-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.pricing-card.featured {
  border-color: var(--blue-primary);
  border-width: 2px;
}

.popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--blue-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: 9999px;
  letter-spacing: 0.05em;
}

.plan-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.plan-price {
  font-size: 34px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.plan-price span {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.plan-minutes {
  font-size: 14px;
  font-weight: 600;
  color: var(--blue-primary);
  margin-bottom: 16px;
}

.plan-features {
  list-style: none;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  text-align: left;
  flex: 1;
}

.plan-features li {
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-features li::before {
  content: '✓';
  color: var(--green-btn);
  font-weight: bold;
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.modal-content {
  background: #fff;
  width: 100%;
  max-width: 440px;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

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

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.close-btn {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-alert {
  display: none;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.5;
}

.modal-alert.active {
  display: block;
}

.modal-alert.danger {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
}

.modal-alert.success {
  background: var(--green-subtle);
  color: var(--green-hover);
  border: 1px solid var(--green-border);
}

.modal-alert a {
  color: var(--blue-primary);
  font-weight: bold;
  text-decoration: underline;
}

/* Toast Message */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.2s ease;
  z-index: 2000;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Footer */
.footer {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid var(--border-color);
  font-size: 13px;
  color: var(--text-muted);
}

.footer a {
  color: var(--blue-primary);
  text-decoration: none;
}

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