/* ========================================
   WordPress Docs Generator by D-Solutions
   Design System v2 - dsolutions-design-system.md
   ======================================== */

:root {
  /* ── D-Solutions Brand Colors ── */
  --yellow:       #FFD300;
  --yellow-dark:  #E6BE00;
  --yellow-light: #FFF3A3;
  --yellow-10:    rgba(255, 211, 0, 0.10);
  --yellow-20:    rgba(255, 211, 0, 0.20);

  --navy:         #1E3A8A;
  --navy-dark:    #162C6E;
  --navy-light:   #2D50B8;
  --navy-10:      rgba(30, 58, 138, 0.10);

  /* ── Legacy aliases (keep backward compat) ── */
  --primary:      var(--yellow);
  --primary-dark: var(--yellow-dark);
  --primary-glow: rgba(255, 211, 0, 0.30);

  /* ── Dark App Theme (charcoal palette) ── */
  --bg-dark:      #111827;
  --bg-card:      #1F2937;
  --bg-card-hover:#27303F;
  --bg-secondary: #374151;
  --bg-primary:   #0F172A;

  /* ── Text ── */
  --text-primary:   #F9FAFB;
  --text-secondary: #9CA3AF;
  --text-muted:     #6B7280;

  /* ── Borders ── */
  --border-color: rgba(255, 255, 255, 0.08);
  --border:       rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 211, 0, 0.40);

  /* ── Status ── */
  --success: #10B981;
  --error:   #EF4444;
  --warning: #F59E0B;

  /* ── Shadows ── */
  --shadow-glow: 0 0 30px rgba(255, 211, 0, 0.15);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.40);
  --shadow-navy: 0 4px 14px rgba(30, 58, 138, 0.25);

  /* ── Radii ── */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* ── Typography ── */
  --font-heading: 'Outfit', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'DM Mono', monospace;

  /* ── Transitions ── */
  --transition: all 0.25s ease;
  --transition-fast: all 0.15s ease;
  --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  min-height: 100vh;
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  letter-spacing: -0.025em;
}

/* Background Effects */
.background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  background: var(--bg-dark);
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  animation: float 25s infinite ease-in-out;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, var(--primary), #ff9500);
  top: -200px;
  left: -150px;
  animation-delay: 0s;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, #0066ff, #00d4ff);
  bottom: -150px;
  right: -100px;
  animation-delay: -8s;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, var(--primary), #ff6b00);
  top: 60%;
  left: 60%;
  animation-delay: -16s;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(40px, -40px) scale(1.05);
  }
  50% {
    transform: translate(-20px, 20px) scale(0.95);
  }
  75% {
    transform: translate(20px, 40px) scale(1.02);
  }
}

/* Container */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 40px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 15px;
  cursor: pointer;
  transition: var(--transition);
}

.logo:hover {
  opacity: 0.9;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  filter: drop-shadow(0 0 10px var(--primary-glow));
}

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

.logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.logo-small .logo-img {
  height: 28px;
}

/* Stats / Why-us section */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  transition: var(--transition);
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--primary-glow);
  transform: translateY(-3px);
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 2.6em;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-unit {
  font-size: 0.42em;
  font-weight: 600;
  color: var(--text-secondary);
  margin-left: 4px;
  vertical-align: middle;
}

.stat-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-size: 0.95em;
}

.stat-sub {
  font-size: 0.82em;
  color: var(--text-secondary);
}

.logo h1 {
  font-size: 2.2em;
  font-weight: 700;
  color: var(--text-primary);
}

.logo h1 span {
  color: var(--primary);
}

.tagline {
  color: var(--text-secondary);
  font-size: 1.1em;
  font-weight: 400;
}

.brand {
  color: var(--text-muted);
  font-size: 0.9em;
  margin-top: 8px;
}

.brand strong {
  color: var(--primary);
  font-weight: 600;
}

/* Cards - DS aligned dark card */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(255, 211, 0, 0.25);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.card h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.4em;
  color: var(--text-primary);
  margin-bottom: 30px;
}

.section-icon {
  font-size: 1.2em;
}

/* Form Styles */
.form-group {
  margin-bottom: 25px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-section-title {
  font-size: 1.1em;
  color: var(--primary);
  margin: 30px 0 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

label {
  display: block;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-size: 0.95em;
}

input[type="text"],
input[type="url"],
input[type="password"],
input[type="email"],
input[type="tel"] {
  width: 100%;
  padding: 16px 20px;
  font-size: 1em;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  transition: var(--transition);
  font-family: inherit;
}

input[type="text"]::placeholder,
input[type="url"]::placeholder,
input[type="password"]::placeholder,
input[type="email"]::placeholder,
input[type="tel"]::placeholder {
  color: var(--text-muted);
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: rgba(255, 255, 255, 0.08);
}

input[type="file"] {
  width: 100%;
  padding: 14px;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

input[type="file"]:hover {
  border-color: var(--primary);
  background: rgba(255, 211, 0, 0.05);
}

.hint {
  display: block;
  font-size: 0.85em;
  color: var(--text-muted);
  margin-top: 6px;
}

.hint-clickable {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.hint-clickable:hover {
  color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 32px;
  font-size: 1em;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn-icon {
  font-size: 1.2em;
}

.btn-primary {
  width: 100%;
  background: var(--yellow);
  color: var(--navy);
  margin-top: 10px;
  font-weight: 700;
  font-family: var(--font-body);
  box-shadow: 0 4px 14px rgba(255, 211, 0, 0.35);
}

.btn-primary:hover {
  background: var(--yellow-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 211, 0, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  width: 100%;
  margin-top: 20px;
  border: 1px solid var(--border-color);
}

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

.btn-danger {
  background: transparent;
  border: 1px solid var(--error);
  color: var(--error);
  padding: 12px 16px;
  width: auto;
}

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

/* Progress Section */
.progress-container {
  text-align: center;
  margin-bottom: 30px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 15px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary) 0%, #ff9500 100%);
  border-radius: 100px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 20px var(--primary-glow);
}

.progress-text {
  color: var(--text-secondary);
  font-size: 0.95em;
}

.progress-percent {
  font-size: 2.5em;
  font-weight: 700;
  color: var(--primary);
  margin-top: 10px;
  text-shadow: 0 0 30px var(--primary-glow);
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.step {
  flex: 1;
  min-width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 15px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: var(--transition);
  opacity: 0.4;
}

.step.active {
  background: rgba(255, 211, 0, 0.1);
  border-color: var(--primary);
  opacity: 1;
}

.step.completed {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--success);
  opacity: 1;
}

.step.completed .step-icon::after {
  content: "✓";
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 0.6em;
  background: var(--success);
  color: #fff;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-icon {
  font-size: 1.5em;
  position: relative;
}

.step-text {
  font-size: 0.75em;
  color: var(--text-secondary);
  text-align: center;
}

/* Results Section */
.results-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 30px;
}

.result-item {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--border-color);
}

.result-item h3 {
  font-size: 1em;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-content {
  font-size: 0.9em;
  color: var(--text-secondary);
}

.result-content ul {
  list-style: none;
  padding: 0;
}

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

.result-content li::before {
  content: "✓";
  color: var(--success);
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--primary);
  color: #000;
  border-radius: 100px;
  font-size: 0.85em;
  font-weight: 600;
}

.badge.success {
  background: var(--success);
  color: #fff;
}

/* Download Section */
.download-section {
  background: rgba(255, 211, 0, 0.05);
  border-radius: var(--radius-lg);
  padding: 25px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 211, 0, 0.2);
}

.download-section h3 {
  font-size: 1.1em;
  margin-bottom: 20px;
  text-align: center;
  color: var(--primary);
}

.download-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.btn-preview {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-preview:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--primary);
}

.btn-html {
  background: linear-gradient(135deg, #f97316, #fb923c);
  color: #fff;
}

.btn-pdf {
  background: linear-gradient(135deg, #ef4444, #f87171);
  color: #fff;
}

.btn-markdown {
  background: linear-gradient(135deg, #10b981, #34d399);
  color: #fff;
}

.btn-html:hover,
.btn-pdf:hover,
.btn-markdown:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

/* Error Section */
.error-card {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

.error-content {
  text-align: center;
}

.error-icon {
  font-size: 4em;
  display: block;
  margin-bottom: 20px;
}

.error-message {
  color: var(--error);
  margin: 15px 0 25px;
}

/* Footer */
.footer {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
  font-size: 0.9em;
}

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

.footer-sub {
  font-size: 0.8em;
  margin-top: 5px;
  opacity: 0.7;
}

/* Landing Header with Navigation */
.landing-header {
  text-align: center;
  padding: 30px 20px 50px;
}

.landing-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto 30px;
}

.landing-nav {
  display: flex;
  gap: 20px;
  align-items: center;
}

.landing-nav .nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95em;
  transition: var(--transition);
}

.landing-nav .nav-link:hover {
  color: var(--primary);
}

.landing-nav .nav-external {
  color: var(--primary);
}

.btn-small {
  padding: 10px 20px !important;
  font-size: 0.9em !important;
}

/* Landing Login Button */
.btn-login {
  width: auto !important;
  margin-top: 0 !important;
  background: var(--primary) !important;
  color: #000 !important;
  font-weight: 600;
  box-shadow: 0 2px 12px var(--primary-glow);
}

.btn-login:hover {
  background: var(--primary-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--primary-glow);
}

/* Landing Footer */
.footer-landing {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 40px 20px 20px;
  margin-top: 60px;
}

.footer-content {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  gap: 15px;
  align-items: center;
}

.footer-logo {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
}

.footer-brand-info strong {
  color: var(--text-primary);
  font-size: 1.1em;
}

.footer-brand-info p {
  color: var(--text-secondary);
  font-size: 0.9em;
  margin-top: 5px;
}

.footer-contact {
  text-align: right;
}

.footer-contact p {
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-size: 0.95em;
}

.footer-contact a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

.footer-contact a:hover {
  color: var(--primary);
}

.contact-icon {
  margin-right: 8px;
}

.footer-bottom {
  max-width: 1000px;
  margin: 30px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9em;
}

.footer-bottom strong {
  color: var(--primary);
}

/* Utilities */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  .landing-header-top {
    flex-direction: column;
    gap: 20px;
  }

  .landing-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
  }

  .footer-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-brand {
    flex-direction: column;
    text-align: center;
  }

  .footer-contact {
    text-align: center;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 20px 15px;
  }

  .card {
    padding: 25px 20px;
  }

  .logo h1 {
    font-size: 1.6em;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .progress-steps {
    flex-wrap: wrap;
  }

  .step {
    min-width: calc(33% - 10px);
  }

  .download-buttons {
    grid-template-columns: 1fr 1fr;
  }
}

/* ========================================
   Additional Styles for Auth Pages
   ======================================== */

.auth-container {
  max-width: 450px;
}

.auth-card {
  text-align: center;
}

.auth-card .logo {
  margin-bottom: 30px;
}

.auth-card h2 {
  justify-content: center;
  margin-bottom: 10px;
}

.auth-subtitle {
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.auth-footer {
  margin-top: 25px;
  padding-top: 25px;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.9em;
}

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

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

/* Landing Page Styles */
.landing-hero {
  text-align: center;
  padding: 80px 20px;
}

.landing-hero h1 {
  font-size: 3em;
  margin-bottom: 20px;
  line-height: 1.2;
}

.landing-hero h1 .highlight {
  background: var(--primary);
  color: #000;
  padding: 0 10px;
  display: inline-block;
}

.landing-hero p {
  font-size: 1.2em;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin: 60px 0;
}

.feature-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 30px;
  border: 1px solid var(--border-color);
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}

.feature-card:hover {
  border-color: var(--primary);
  transform: translateY(-5px);
  box-shadow: var(--shadow-glow);
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--primary);
}

.feature-icon svg {
  width: 48px;
  height: 48px;
}

.feature-card h3 {
  font-size: 1.2em;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95em;
}

/* ========================================
   App Header Component
   ======================================== */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  background: var(--navy);
  border-bottom: 1px solid var(--navy-dark);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-navy);
}

.app-header-left,
.app-header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Language Switcher */
.lang-switcher {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-size: 1em;
}

.lang-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
}

.lang-icon {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
}

.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 150px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  overflow: hidden;
}

.lang-menu.show {
  display: block;
}

.lang-menu button {
  display: block;
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.95em;
  color: var(--text-primary);
  transition: var(--transition);
}

.lang-menu button:hover {
  background: var(--bg-card-hover);
}

.lang-menu button.active {
  background: var(--primary);
  color: white;
}

.auth-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-small {
  transform: scale(0.8);
  margin: 0;
}

.logo-small h1 {
  font-size: 1.3em;
  color: #fff;
}

.logo-small h1 span {
  color: var(--yellow);
}

/* Navigation */
.app-nav {
  display: flex;
  gap: 10px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  background: transparent;
  color: rgba(255, 255, 255, 0.70);
  text-decoration: none;
  font-size: 0.95em;
  font-family: var(--font-body);
  font-weight: 500;
  transition: var(--transition);
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
}

.nav-link.active {
  background: var(--yellow-10);
  color: var(--yellow);
  border: 1px solid rgba(255, 211, 0, 0.30);
}

.nav-icon {
  display: flex;
  align-items: center;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

/* User Info */
.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.user-name {
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.credits-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  background: var(--primary);
  color: var(--bg-dark);
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9em;
  transition: var(--transition);
}

.credits-badge.low {
  background: var(--warning);
  animation: pulse 2s ease-in-out infinite;
}

.credits-badge.critical {
  background: var(--error);
  animation: pulse 1s ease-in-out infinite;
}

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

.credits-icon {
  font-size: 1.1em;
}

/* Logout Button */
.btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.70);
  cursor: pointer;
  font-size: 0.9em;
  font-family: var(--font-body);
  transition: var(--transition);
}

.btn-logout:hover {
  background: var(--error);
  border-color: var(--error);
  color: white;
}

/* Auth Header */
.auth-header {
  text-align: center;
  position: relative;
  margin-bottom: 30px;
  padding: 20px 0;
}

.back-link {
  position: absolute;
  top: 10px;
  left: 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9em;
  transition: var(--transition);
}

.back-link:hover {
  color: var(--primary);
}

/* Footer Enhancements */
.footer-sub {
  font-size: 0.85em;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Responsive for App Header */
@media (max-width: 768px) {
  .app-header {
    flex-wrap: wrap;
    padding: 15px 20px;
  }

  .app-nav {
    order: 3;
    width: 100%;
    margin-top: 10px;
  }

  .user-name {
    display: none;
  }
}

/* ========================================
   History Page Styles
   ======================================== */

.history-header {
  text-align: center;
  margin-bottom: 40px;
}

.history-header h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  font-size: 2.5em;
  margin-bottom: 10px;
}

.history-header .subtitle {
  color: var(--text-secondary);
  font-size: 1.1em;
}

/* Search and Filter */
.search-filter-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 18px;
  font-size: 1.2em;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  flex: 1;
  padding: 16px 50px 16px 50px;
  font-size: 1em;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  transition: var(--transition);
  font-family: inherit;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: rgba(255, 255, 255, 0.08);
}

.clear-search-btn {
  position: absolute;
  right: 15px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 1.5em;
  cursor: pointer;
  transition: var(--transition);
}

.clear-search-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.filter-controls {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95em;
  color: var(--text-secondary);
  margin: 0;
}

.filter-icon {
  font-size: 1.1em;
}

.filter-select {
  padding: 10px 16px;
  font-size: 0.95em;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.filter-select:hover {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-stats {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.95em;
}

.search-stats strong {
  color: var(--primary);
}

.documents-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
  margin-top: 30px;
}

.document-card {
  transition: var(--transition);
  cursor: default;
}

.document-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-glow);
}

.document-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 15px;
  gap: 15px;
}

.document-title {
  font-size: 1.3em;
  margin: 0;
  color: var(--text-primary);
  word-break: break-word;
}

.document-date {
  font-size: 0.85em;
  color: var(--text-muted);
  white-space: nowrap;
}

.document-url {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  background: var(--bg-dark);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.url-icon {
  font-size: 1.2em;
}

.document-url a {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9em;
  word-break: break-all;
}

.document-url a:hover {
  text-decoration: underline;
}

.document-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
}

.stat {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9em;
}

.stat-icon {
  font-size: 1.2em;
}

.stat-label {
  color: var(--text-secondary);
  min-width: 100px;
}

.stat-value {
  color: var(--text-primary);
  font-weight: 500;
}

.document-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.document-actions .btn {
  flex: 1 1 auto;
  min-width: 120px;
}

/* Dropdown menu */
.dropdown {
  position: relative;
  flex: 1 1 auto;
  min-width: 120px;
}

.dropdown-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dropdown-arrow {
  font-size: 0.7em;
  transition: var(--transition);
}

.dropdown.active .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition);
  z-index: 100;
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  font-size: 0.9em;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-item:hover {
  background: var(--bg-card-hover);
  color: var(--primary);
}

.dropdown-item + .dropdown-item {
  border-top: 1px solid var(--border-color);
}

/* Loading Spinner */
.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

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

/* Responsive History */
@media (max-width: 768px) {
  .documents-grid {
    grid-template-columns: 1fr;
  }

  .history-header h1 {
    font-size: 2em;
  }

  .document-stats {
    padding: 10px;
  }

  .stat {
    font-size: 0.85em;
  }
}

/* ========================================
   Toast Notifications
   ======================================== */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 300px;
}

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

.toast-icon {
  font-size: 1.5em;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  color: var(--text-primary);
  font-size: 0.95em;
  line-height: 1.4;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5em;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
  flex-shrink: 0;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* Toast types */
.toast-success {
  border-left-color: var(--success);
}

.toast-error {
  border-left-color: var(--error);
}

.toast-warning {
  border-left-color: var(--warning);
}

.toast-info {
  border-left-color: var(--primary);
}

/* Responsive toasts */
@media (max-width: 768px) {
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .toast {
    min-width: 0;
  }
}

/* ========================================
   Profile Page Styles
   ======================================== */

.profile-header {
  text-align: center;
  margin-bottom: 40px;
}

.profile-header h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  font-size: 2.5em;
  margin-bottom: 10px;
}

.profile-header .subtitle {
  color: var(--text-secondary);
  font-size: 1.1em;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.4em;
  margin: 0 0 25px 0;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.card-title span {
  font-size: 1.2em;
}

.credits-display {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: linear-gradient(135deg, var(--primary) 0%, #ff9500 100%);
  border-radius: var(--radius-md);
  color: #000;
  font-size: 1.8em;
  font-weight: 700;
}

.credits-display .credits-icon {
  font-size: 1.3em;
}

.member-since {
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1em;
}

/* Transactions Table */
.transactions-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.transactions-table thead {
  background: rgba(255, 255, 255, 0.03);
}

.transactions-table th {
  text-align: left;
  padding: 15px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.transactions-table td {
  padding: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.transactions-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.txn-type {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
}

.txn-deduct {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

.txn-add {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.txn-bonus {
  background: rgba(255, 211, 0, 0.2);
  color: var(--primary);
}

.txn-other {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.txn-amount {
  font-weight: 700;
  font-size: 1.05em;
}

.amount-positive {
  color: var(--success);
}

.amount-negative {
  color: var(--error);
}

/* Responsive Profile Page */
@media (max-width: 768px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .card {
    margin-bottom: 0;
  }

  .transactions-table {
    font-size: 0.9em;
  }

  .transactions-table th,
  .transactions-table td {
    padding: 10px;
  }
}

/* ========================================
   Payment Page Styles
   ======================================== */

.payment-header {
  text-align: center;
  margin-bottom: 40px;
}

.payment-header h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
}

.payment-header .subtitle {
  color: var(--text-secondary);
  font-size: 1.1em;
}

/* Credit Packs Grid */
.packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.pack-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.pack-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.pack-card.popular {
  border-color: var(--primary);
  background: linear-gradient(145deg, var(--bg-card) 0%, rgba(255, 211, 0, 0.05) 100%);
}

.popular-badge {
  position: absolute;
  top: 12px;
  right: -30px;
  background: var(--primary);
  color: #000;
  padding: 4px 40px;
  font-size: 0.75em;
  font-weight: 600;
  transform: rotate(45deg);
}

.pack-credits {
  font-size: 3.5em;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.pack-label {
  font-size: 1.2em;
  color: var(--text-secondary);
  margin: 8px 0 20px;
}

.pack-price {
  font-size: 1.5em;
  font-weight: 600;
  margin-bottom: 8px;
}

.pack-discount {
  display: inline-block;
  background: var(--success);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
  margin-bottom: 16px;
}

.pack-btn {
  width: 100%;
  margin-top: 16px;
}

/* Payment Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.modal-header h2 {
  font-size: 1.4em;
}

/* Countdown Timer */
.countdown-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-dark);
  padding: 8px 16px;
  border-radius: var(--radius-md);
}

.timer-label {
  color: var(--text-secondary);
  font-size: 0.85em;
}

.timer-value {
  font-family: monospace;
  font-size: 1.2em;
  font-weight: 600;
  color: var(--primary);
}

.countdown-timer.warning .timer-value {
  color: var(--error);
  animation: pulse 1s infinite;
}

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

/* QR Section */
.qr-section {
  text-align: center;
  margin-bottom: 24px;
}

.qr-container {
  background: #fff;
  padding: 16px;
  border-radius: var(--radius-md);
  display: inline-block;
  margin-bottom: 12px;
}

.qr-container img {
  max-width: 220px;
  height: auto;
  display: block;
}

.qr-hint {
  color: var(--text-secondary);
  font-size: 0.9em;
}

/* Bank Info Section */
.bank-info-section {
  background: var(--bg-dark);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
}

.bank-info-section h3 {
  font-size: 0.95em;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.bank-info-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bank-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bank-info-row.highlight {
  background: rgba(255, 211, 0, 0.1);
  margin: 8px -12px -4px;
  padding: 12px;
  border-radius: var(--radius-sm);
}

.info-label {
  color: var(--text-secondary);
  font-size: 0.9em;
  min-width: 120px;
}

.info-value {
  font-weight: 500;
  flex: 1;
}

.info-value.copyable {
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: var(--transition);
}

.info-value.copyable:hover {
  background: var(--bg-card-hover);
}

.amount-value {
  color: var(--primary);
  font-size: 1.1em;
  font-weight: 600;
}

.btn-copy {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
}

.btn-copy:hover {
  background: var(--bg-card-hover);
  color: var(--primary);
  border-color: var(--primary);
}

.transfer-note {
  margin-top: 16px;
  font-size: 0.85em;
  color: var(--warning);
  padding: 12px;
  background: rgba(245, 158, 11, 0.1);
  border-radius: var(--radius-sm);
}

/* Payment Status */
.payment-status {
  margin-bottom: 20px;
}

.status-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  font-weight: 500;
}

.status-indicator.waiting {
  background: rgba(255, 211, 0, 0.1);
  color: var(--primary);
}

.status-indicator.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.status-indicator.expired {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Success Modal */
.success-modal {
  text-align: center;
  padding: 48px 32px;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  color: var(--success);
}

.success-modal h2 {
  margin-bottom: 16px;
}

.success-modal p {
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.new-balance {
  font-size: 1.1em;
  margin-bottom: 24px !important;
}

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

/* Loading and Error States */
.loading-state,
.error-state {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

.error-state {
  color: var(--error);
}

/* Responsive Payment Page */
@media (max-width: 768px) {
  .payment-header h1 {
    font-size: 2em;
  }

  .packs-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .pack-card {
    padding: 24px 20px;
  }

  .pack-credits {
    font-size: 2.5em;
  }

  .modal-content {
    padding: 24px 20px;
    margin: 10px;
  }

  .modal-header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .bank-info-row {
    flex-wrap: wrap;
  }

  .info-label {
    min-width: 100%;
    margin-bottom: -4px;
  }

  .qr-container img {
    max-width: 180px;
  }
}


/* ========================================
   Admin Panel Styles
   ======================================== */

.admin-header {
  text-align: center;
  margin-bottom: 30px;
}

.admin-header h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
  color: var(--text-primary);
}

/* Admin Tabs */
.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.tab-btn {
  padding: 10px 20px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--primary);
  color: white;
}

.tab-content {
  display: none;
}

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

/* Admin Stats Grid */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-card .stat-value {
  font-size: 2.5em;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.stat-label {
  color: var(--text-secondary);
  margin-top: 8px;
  font-size: 14px;
}

/* Users Tab */
.users-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.table-container {
  overflow-x: auto;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

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

.admin-table th {
  background: rgba(139, 92, 246, 0.1);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-table tr:hover td {
  background: rgba(139, 92, 246, 0.05);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.badge-admin {
  background: var(--primary);
  color: white;
}

.empty-state {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px !important;
}

/* Pagination */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.page-btn {
  padding: 8px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.page-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.page-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.page-ellipsis {
  padding: 8px 4px;
  color: var(--text-secondary);
}

/* Settings Tab */
.settings-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.settings-section h3 {
  margin-bottom: 8px;
  color: var(--text-primary);
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.pricing-item {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.pricing-item .form-label {
  font-weight: 600;
  color: var(--primary);
}

.input-with-suffix {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-with-suffix .form-input {
  flex: 1;
}

.input-suffix {
  color: var(--text-secondary);
  font-size: 14px;
  white-space: nowrap;
}

/* Responsive Admin */
@media (max-width: 768px) {
  .admin-header h1 {
    font-size: 2em;
  }

  .admin-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    white-space: nowrap;
  }

  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-card .stat-value {
    font-size: 1.8em;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .users-toolbar {
    flex-direction: column;
  }

  .users-toolbar .form-input {
    max-width: none !important;
  }
}

/* ============================================
   Preview Modal & Editor Styles
   ============================================ */

.modal.show {
  display: flex;
}

/* Preview modal uses light theme to match document output */
.preview-modal {
  max-width: 960px;
  width: 96%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #1F2937;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--navy);
  flex-shrink: 0;
}

.preview-header h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 1.15em;
  font-family: var(--font-heading);
  color: #fff;
}

.preview-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-icon-only {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1.1em;
  color: rgba(255, 255, 255, 0.80);
  transition: var(--transition);
}

.btn-icon-only:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* Preview toolbar buttons on navy background */
.preview-toolbar .btn {
  padding: 8px 14px;
  font-size: 0.85em;
}

.preview-toolbar .btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.20);
  width: auto;
  margin-top: 0;
}

.preview-toolbar .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.40);
  color: #fff;
}

.preview-toolbar .btn-success {
  background: var(--success);
  color: #fff;
  border: none;
  width: auto;
  margin-top: 0;
}

.preview-toolbar .btn-success:hover {
  background: #0fa874;
}

.preview-toolbar .btn-primary {
  background: var(--yellow);
  color: var(--navy);
  border: none;
  width: auto;
  margin-top: 0;
  font-weight: 700;
}

.preview-toolbar .btn-primary:hover {
  background: var(--yellow-dark);
  box-shadow: 0 4px 14px rgba(255, 211, 0, 0.40);
}

.preview-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #f9fafb;
}

/* TinyMCE Container Styling - Light theme */
.preview-body .tox-tinymce {
  flex: 1;
  border: none !important;
}

/* TinyMCE Light Theme Overrides */
.tox .tox-editor-header {
  background: #f3f4f6 !important;
  border-bottom: 1px solid #e5e7eb !important;
}

.tox .tox-toolbar,
.tox .tox-toolbar__primary {
  background: #f3f4f6 !important;
}

.tox .tox-tbtn {
  color: #374151 !important;
  border-radius: 6px !important;
}

.tox .tox-tbtn:hover {
  background: var(--yellow-10) !important;
  color: var(--navy) !important;
}

.tox .tox-tbtn--enabled,
.tox .tox-tbtn--enabled:hover {
  background: var(--yellow) !important;
  color: var(--navy) !important;
}

/* Hide textarea before TinyMCE init */
#tinymce-editor {
  display: none;
}

/* Save to DB button */
#saveToDbBtn {
  background: var(--success);
  color: white;
}

#saveToDbBtn:hover {
  background: #0fa874;
}

/* Remove old contentEditable styles - deprecated */
.edit-mode .editable,
.editable:focus,
#editorToolbar,
.editor-toolbar {
  display: none !important;
}

/* Export Dropdown */
.export-dropdown {
  position: relative;
  display: inline-block;
}

.export-dropdown .dropdown-arrow {
  font-size: 10px;
  margin-left: 4px;
}

.export-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 1001;
  overflow: hidden;
}

.export-menu.show {
  display: block;
}

.export-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  text-align: left;
  border: none;
  background: transparent;
  color: #374151;
  font-size: 0.9em;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.export-menu button:hover {
  background: #f3f4f6;
  color: var(--navy);
}

.export-menu .menu-icon {
  font-size: 1em;
}

/* Preview Content Styling */
.preview-body h1 {
  font-size: 1.8em;
  margin-bottom: 16px;
  color: #1a1a1a;
}

.preview-body h2 {
  font-size: 1.4em;
  margin: 24px 0 12px;
  color: #2a2a2a;
}

.preview-body h3 {
  font-size: 1.2em;
  margin: 20px 0 10px;
  color: #3a3a3a;
}

.preview-body p {
  margin: 12px 0;
  line-height: 1.7;
}

.preview-body ul, .preview-body ol {
  margin: 12px 0;
  padding-left: 24px;
}

.preview-body li {
  margin: 6px 0;
}

.preview-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 16px 0;
}

.preview-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.preview-body th, .preview-body td {
  padding: 10px 12px;
  border: 1px solid #ddd;
  text-align: left;
}

.preview-body th {
  background: #f5f5f5;
  font-weight: 600;
}
