:root {
  --bg: #0b0f14;
  --glass: rgba(255,255,255,0.06);
  --glass-strong: rgba(255,255,255,0.12);
  --white: #f7f8fa;
  --muted: #a0a9b4;
  --accent: #e5e7eb;
  --success: #22c55e;
  --danger: #ef4444;
  --free: #64748b;
  --starter: #22c55e;
  --pro: #60a5fa;
  --business: #f59e0b;
  --ring: rgba(255,255,255,0.28);
  --focus: rgba(255,255,255,0.16);
}
* { box-sizing: border-box; }
html { 
  min-height: 100%; 
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(1000px 600px at 10% 0%, rgba(255,255,255,0.06), transparent),
              radial-gradient(800px 500px at 90% 10%, rgba(255,255,255,0.04), transparent),
              var(--bg);
  background-attachment: fixed;
  background-color: var(--bg);
  color: var(--white);
  overflow-x: hidden;
}
.glass-bg { position: fixed; inset: 0; pointer-events: none; }
.topbar {
  position: sticky; top: 0; display: flex; align-items: center; gap: 20px;
  padding: 20px 32px; backdrop-filter: blur(18px); background: linear-gradient(180deg, rgba(11,15,20,0.9), rgba(11,15,20,0.85));
  border-bottom: 1px solid rgba(255,255,255,0.06);
  z-index: 100;
}
.logo { 
  font-weight: 700; 
  letter-spacing: 0.5px; 
  color: var(--accent); 
  font-size: 18px; 
  transition: color 0.2s ease, transform 0.2s ease;
  user-select: none;
}

.logo:hover {
  color: var(--white);
  transform: scale(1.05);
}
.spacer { flex: 1; }
.profile { display: flex; align-items: center; gap: 16px; }
.signin { color: var(--accent); text-decoration: none; padding: 12px 20px; font-size: 15px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.14); transition: all .18s ease; }
.signin:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.avatar { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.18); background: var(--glass); color: var(--white); cursor: pointer; transition: transform .15s ease, box-shadow .2s ease; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.avatar:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.06); }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: 52px; background: rgba(20,24,28,0.9); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 10px; width: 240px; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all .18s ease; backdrop-filter: blur(12px); pointer-events: none; z-index: 101; }
.dropdown-menu.open { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.dropdown-item { display: block; padding: 12px 14px; font-size: 15px; color: var(--accent); text-decoration: none; border-radius: 10px; }
.dropdown-item:hover { background: rgba(255,255,255,0.06); }
.dropdown-item.email { color: var(--white); font-weight: 600; }
.dropdown-item.danger { color: var(--danger); background: transparent; border: none; width: 100%; text-align: left; cursor: pointer; }
.dropdown-item.admin { color: var(--business); font-weight: 600; }
.dropdown-item.admin:hover { background: rgba(245, 158, 11, 0.1); color: var(--business); }

.plan-badge { padding: 8px 14px; border-radius: 999px; font-size: 13px; border: 1px solid rgba(255,255,255,0.14); font-weight: 500; }
.plan-badge.free { color: var(--free); }
.plan-badge.starter { color: var(--starter); }
.plan-badge.pro { color: var(--pro); }
.plan-badge.business { color: var(--business); }

main { max-width: 1200px; margin: 50px auto; padding: 0 32px 40px 32px; min-height: calc(100vh - 250px); }
.footer { padding: 32px; text-align: center; border-top: 1px solid rgba(255,255,255,0.06); }
.footer-text { color: var(--muted); font-size: 13px; margin: 0; opacity: 0.7; }
.hero { text-align: center; }
.hero h1 { font-size: 52px; margin: 0 0 16px; letter-spacing: 0.3px; }
.hero .sub { color: var(--muted); margin: 0 0 32px; font-size: 18px; }
.cta { position: relative; background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06)); color: var(--white);
  padding: 16px 28px; font-size: 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.22); cursor: pointer; text-decoration: none; display: inline-block;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08); transition: transform .16s ease, box-shadow .2s ease, background .2s ease; }
.cta:hover { transform: translateY(-1px); background: linear-gradient(180deg, rgba(255,255,255,0.20), rgba(255,255,255,0.08)); box-shadow: 0 10px 26px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1); }
.cta:active { transform: translateY(0); box-shadow: 0 6px 16px rgba(0,0,0,0.35), inset 0 0 0 rgba(255,255,255,0.1); }
.cta:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus), 0 10px 26px rgba(0,0,0,0.4); }
.ghost { background: rgba(255,255,255,0.02); color: var(--accent); padding: 14px 22px; font-size: 15px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.16); text-decoration: none; display: inline-block; transition: all .16s ease; }
.ghost:hover { border-color: rgba(255,255,255,0.22); color: var(--white); background: rgba(255,255,255,0.05); }
.ghost:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.ghost.danger { color: var(--danger); }
#uploadForm { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.info-text { color: var(--muted); font-size: 15px; margin-top: 16px; text-align: center; animation: fadeIn .46s ease both; line-height: 1.6; }
.subscription-expiry { font-size: 13px; opacity: 0.8; }
/* File upload area */
.file-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.file { 
  cursor: pointer; 
  width: 100%;
  max-width: 400px;
}

.file input { 
  display: none; 
}

.file-upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 24px;
  border-radius: 16px;
  border: 2px dashed rgba(255,255,255,0.24);
  background: rgba(255,255,255,0.02);
  transition: all 0.3s ease;
  text-align: center;
}

.file-upload-content:hover {
  border-color: rgba(255,255,255,0.36);
  background: rgba(255,255,255,0.04);
  transform: translateY(-2px);
}

.file-upload-content.file-selected {
  border-color: var(--success);
  border-style: solid;
  background: rgba(34, 197, 94, 0.05);
}

.upload-icon {
  color: var(--accent);
  transition: color 0.3s ease;
}

.file-upload-content:hover .upload-icon {
  color: var(--white);
}

.file-upload-content.file-selected .upload-icon {
  color: var(--success);
}

.file-upload-content span {
  color: var(--accent);
  transition: color 0.3s ease;
}

.file-upload-content:hover span {
  color: var(--white);
}

.file-upload-content.file-selected span {
  color: var(--success);
}

.file-upload-content.drag-over {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.1);
  transform: scale(1.02);
}

.file-hint {
  font-size: 14px;
  opacity: 0.7;
}

#fileLabel {
  font-size: 16px;
  font-weight: 500;
}

/* Checkbox styles */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  color: var(--accent);
  font-size: 15px;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.24);
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
  position: relative;
  transition: all 0.18s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
  background: var(--success);
  border-color: var(--success);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-text {
  color: var(--accent);
  transition: color 0.18s ease;
}

.checkbox-label:hover .checkbox-text {
  color: var(--white);
}

.checkbox-label:hover .checkmark {
  border-color: rgba(255,255,255,0.36);
  background: rgba(255,255,255,0.04);
}

/* Merge option positioning */
.merge-option {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 16px 20px;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease both;
}

/* Upload tabs */
.upload-tabs { display: flex; gap: 8px; margin-bottom: 20px; justify-content: center; }
.tab-btn { background: rgba(255,255,255,0.04); color: var(--muted); padding: 12px 20px; font-size: 15px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.12); cursor: pointer; transition: all .18s ease; position: relative; }
.tab-btn:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.tab-btn.active { background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06)); color: var(--white); border-color: rgba(255,255,255,0.24); box-shadow: 0 4px 12px rgba(0,0,0,0.25); }

/* Tab content */
.tab-content { width: 100%; display: flex; justify-content: center; }

/* URL input */
.url-input-group { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 400px; }
.url-input { width: 100%; padding: 16px 20px; font-size: 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.14); background: rgba(20,24,28,0.6); color: var(--white); transition: all .18s ease; }
.url-input:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px var(--focus); background: rgba(20,24,28,0.8); }
.url-input::placeholder { color: var(--muted); }
.url-hint { color: var(--muted); font-size: 13px; text-align: center; opacity: 0.8; line-height: 1.4; }
.url-hint small { font-size: 11px; opacity: 0.7; }

.loader { margin: 20px auto; width: 56px; height: 56px; border-radius: 999px; position: relative; border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.04); backdrop-filter: blur(8px); text-indent: -9999px; overflow: hidden; }
.loader::after { content: ""; position: absolute; inset: 8px; border-radius: 999px; border: 4px solid transparent; border-top-color: var(--accent); border-right-color: rgba(255,255,255,0.3); animation: spin 1s linear infinite; }
.hidden { display: none; }

.table-wrap { margin-top: 50px; margin-bottom: 50px; }
.table-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 16px; }
.table-title-section { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.table-head h2 { font-size: 28px; margin: 0; }
.table-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Table navigation */
.table-navigation {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 8px 12px;
  backdrop-filter: blur(8px);
}

.nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}

.nav-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.08);
  color: var(--white);
  border-color: rgba(255,255,255,0.24);
  transform: translateY(-1px);
}

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

.table-counter {
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  min-width: 50px;
  text-align: center;
}
.table-container { overflow: auto; }
.glass { background: rgba(255,255,255,0.035); border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; backdrop-filter: blur(14px); box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 8px 30px rgba(0,0,0,0.25); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 16px 18px; border-bottom: 1px solid rgba(255,255,255,0.06); text-align: left; font-size: 15px; }
thead th { color: var(--muted); font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; }
tbody tr:hover { background: rgba(255,255,255,0.04); }

.auth { display: grid; place-items: center; gap: 16px; min-height: calc(100vh - 120px); }
.auth-grid { max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.card { padding: 32px; width: 480px; animation: fadeIn .24s ease both; }
.auth .card { width: 100%; max-width: 750px; }
/* Auth/register sizing tweaks */
.auth .card h2 { font-size: 28px; }
.auth input[type="email"],
.auth input[type="password"] { font-size: 17px; padding: 16px 18px; }
.auth .card .cta,
.auth .card .ghost { padding: 16px 28px; }
.card h2 { margin-top: 0; }
label { display: block; margin: 12px 0 8px; color: var(--accent); font-size: 15px; }
input[type="email"], input[type="password"] { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.14); background: rgba(20,24,28,0.6); color: var(--white); }
input[type="email"]:focus-visible, input[type="password"]:focus-visible { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px var(--focus); }
.hero h1 { animation: fadeIn .28s ease both; }
.hero .sub { animation: fadeIn .34s ease both; }
.hero .cta, #uploadForm { animation: fadeIn .4s ease both; }
.alert { margin: 16px 0; padding: 14px 18px; font-size: 15px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.06); color: var(--danger); }
.divider { margin: 20px 0; color: var(--muted); text-align: center; }
.auth .card form { display: grid; gap: 14px; }
.auth .card .cta, .auth .card .ghost { margin-top: 6px; }
.link { color: var(--accent); text-decoration: none; }

/* OTP Input */
.verify-auth { height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; overflow: hidden; }
.verify-card { max-width: 520px; padding: 28px 36px !important; }
.otp-input-group { display: flex; gap: 10px; justify-content: center; margin-bottom: 0; }
.otp-input { width: 52px; height: 60px; font-size: 26px; font-weight: 600; text-align: center; border-radius: 12px; border: 1px solid rgba(255,255,255,0.14); background: rgba(20,24,28,0.6); color: var(--white); transition: all .2s ease; caret-color: var(--white); }
.otp-input:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px var(--focus); background: rgba(20,24,28,0.8); }
.otp-input:not(:placeholder-shown) { border-color: rgba(255,255,255,0.24); background: rgba(255,255,255,0.06); }

.plans { padding: 0; }
.plans h1 { text-align: center; margin-top: 0; margin-bottom: 32px; font-size: 48px; }
.billing-toggle { display: flex; justify-content: center; gap: 12px; margin-bottom: 48px; }
.toggle-btn { background: rgba(255,255,255,0.04); color: var(--muted); padding: 14px 24px; font-size: 15px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.12); cursor: pointer; transition: all .18s ease; position: relative; }
.toggle-btn:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.toggle-btn.active { background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06)); color: var(--white); border-color: rgba(255,255,255,0.24); box-shadow: 0 4px 12px rgba(0,0,0,0.25); }
.discount-badge { display: inline-block; margin-left: 6px; padding: 2px 8px; background: var(--success); color: var(--bg); border-radius: 8px; font-size: 12px; font-weight: 600; }
.plans form { margin-top: 32px; text-align: center; }
.plans > a { display: block; text-align: center; margin-top: 24px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; margin-bottom: 32px; }
.plan { padding: 32px; text-align: center; transition: transform .16s ease, box-shadow .2s ease, border-color .2s ease; }
.plan:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(0,0,0,0.35); border-color: rgba(255,255,255,0.12); }
.plan h3 { margin: 0 0 16px; font-size: 24px; }
.price-wrapper { margin-bottom: 12px; min-height: 80px; }
.price { font-size: 40px; font-weight: 600; line-height: 1; }
.price .period { font-size: 20px; color: var(--muted); font-weight: 400; }
.yearly-total { font-size: 14px; color: var(--muted); margin-top: 8px; }
.note { color: var(--muted); margin-bottom: 20px; font-size: 15px; }
.plan .cta { width: 100%; }
button[disabled] { opacity: 0.5; cursor: not-allowed; }
.current-subscription { margin: 32px auto; max-width: 600px; }
.subscription-info { padding: 28px; }
.subscription-info h3 { margin: 0 0 20px; font-size: 22px; text-align: center; }
.subscription-details { display: grid; gap: 14px; }
.detail-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: rgba(255,255,255,0.02); border-radius: 10px; }
.detail-item .label { color: var(--muted); font-size: 15px; }
.detail-item .value { color: var(--white); font-weight: 500; font-size: 15px; }

@media (max-width: 560px) {
  .card { width: 100%; }
  .upload-tabs { flex-direction: column; gap: 6px; }
  .tab-btn { width: 100%; text-align: center; }
  .url-input-group { max-width: 100%; }
  #uploadForm { gap: 12px; }
  
  /* Document info mobile styles */
  .document-info {
    padding: 20px;
    margin-top: 16px;
  }
  
  .document-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .stat-item {
    padding: 16px 12px;
  }
  
  .stat-value {
    font-size: 20px;
  }
  
  .stat-label {
    font-size: 12px;
  }
  
  .empty-pages-list,
  .failed-documents-list {
    gap: 6px;
  }
  
  .page-badge,
  .document-badge {
    padding: 6px 12px;
    font-size: 12px;
  }
}

/* Utilities & animations */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideOutLeft { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(-20px); } }
@keyframes slideOutRight { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(20px); } }
@keyframes pdfPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.05); opacity: 0.8; } }
@keyframes dotBounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }
@keyframes progressShine { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* Document info styles */
.document-info {
  margin-top: 24px;
  padding: 28px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: fadeIn 0.6s ease both;
}

.document-info h3 {
  margin: 0 0 16px;
  font-size: 20px;
  color: var(--white);
  font-weight: 600;
}

.document-info h4 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--accent);
  font-weight: 500;
}

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

.stat-item {
  padding: 20px 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.6s ease;
}

.stat-item:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.stat-item:hover::before {
  left: 100%;
}

.stat-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 4px;
}

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

.empty-pages-info,
.failed-documents-info {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.empty-pages-info {
  transition: all 0.2s ease;
  border-radius: 8px;
  padding: 16px;
}

.empty-pages-info:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.1);
}

.empty-pages-list,
.failed-documents-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.page-badge,
.document-badge {
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.page-badge::before,
.document-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.4s ease;
}

.page-badge:hover,
.document-badge:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.page-badge:hover::before,
.document-badge:hover::before {
  left: 100%;
}

.document-badge.failed {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.08));
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--danger);
}

.document-badge.failed::before {
  background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.2), transparent);
}

.document-badge.success {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.08));
  border-color: rgba(34, 197, 94, 0.4);
  color: var(--success);
}

.document-badge.success::before {
  background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.2), transparent);
}

/* Click hint styles */
.click-hint {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  font-style: italic;
}

/* Modal styles for empty pages */
.modal-empty-pages-content {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.modal-document-group {
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}

.modal-document-group h4 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--white);
  font-weight: 600;
}

.modal-pages-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-page-badge {
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  transition: all 0.2s ease;
}

.modal-page-badge.clickable {
  cursor: pointer;
}

.modal-page-badge.clickable:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.modal-page-item {
  display: inline-block;
}

/* Screenshot modal styles */
.screenshot-modal-content {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
}

.screenshot-container {
  max-height: 70vh;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3);
  margin-bottom: 20px;
}

.screenshot-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.screenshot-error {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

/* Thank You Page Styles */
.thank-you {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 200px);
  padding: 40px 20px;
}

.thank-you-container {
  max-width: 600px;
  width: 100%;
  text-align: center;
  padding: 48px 32px;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  word-wrap: break-word;
}

.success-icon {
  margin-bottom: 32px;
  animation: successPulse 2s ease-in-out infinite;
}

@keyframes successPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.thank-you h1 {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--white);
  background: linear-gradient(135deg, var(--white), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  line-height: 1.2;
}

.thank-you-message {
  font-size: 18px;
  color: var(--muted);
  margin: 0 0 32px;
  line-height: 1.6;
}

.plan-details {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  margin: 32px 0;
  text-align: left;
}

.plan-details .detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  gap: 16px;
  min-height: 44px;
}

.plan-details .detail-item:has(.plan-badge) {
  align-items: center;
}

.plan-details .detail-item:last-child {
  border-bottom: none;
}

.plan-details .label {
  font-weight: 500;
  color: var(--muted);
  flex-shrink: 0;
  min-width: 120px;
  line-height: 28px;
  height: 28px;
  display: flex;
  align-items: center;
}

.plan-details .value {
  font-weight: 600;
  color: var(--white);
  text-align: right;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.plan-details .value.plan-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  height: 28px;
  line-height: 1;
}

.action-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 32px 0;
  flex-wrap: wrap;
}

.action-buttons .cta {
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 12px;
  transition: all 0.2s ease;
  background: linear-gradient(135deg, var(--success), #16a34a);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.action-buttons .cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(34, 197, 94, 0.4);
}

.action-buttons .ghost {
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 12px;
  transition: all 0.2s ease;
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.action-buttons .ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.help-section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.help-section h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--white);
}

.help-section p {
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}


/* Mobile responsiveness */
@media (max-width: 768px) {
  .thank-you-container {
    padding: 32px 24px;
    margin: 20px;
  }
  
  .thank-you h1 {
    font-size: 28px;
  }
  
  .thank-you-message {
    font-size: 16px;
  }
  
  .plan-details .detail-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-height: auto;
  }
  
  .plan-details .label {
    min-width: auto;
    font-size: 14px;
    height: auto;
    line-height: 1.4;
  }
  
  .plan-details .value {
    text-align: left;
    font-size: 16px;
  }
  
  .plan-details .value.plan-badge {
    max-width: 100%;
    text-align: center;
    margin-top: 4px;
  }
  
  .action-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .action-buttons .cta,
  .action-buttons .ghost {
    width: 100%;
    max-width: 280px;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .thank-you-container {
    padding: 24px 16px;
    margin: 10px;
  }
  
  .thank-you h1 {
    font-size: 24px;
  }
  
  .thank-you-message {
    font-size: 14px;
  }
  
  .plan-details {
    padding: 16px;
  }
  
  .plan-details .detail-item {
    padding: 8px 0;
  }
  
  .plan-details .label {
    font-size: 13px;
  }
  
  .plan-details .value {
    font-size: 14px;
  }
  
  .plan-details .value.plan-badge {
    font-size: 12px;
    padding: 3px 8px;
  }
}

/* Admin Panel Styles */
.admin-dashboard {
  padding: 40px 32px;
  max-width: 1400px;
  margin: 0 auto;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-header h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--white);
  margin: 0;
}

.admin-nav {
  display: flex;
  gap: 8px;
  background: var(--glass);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-link {
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: var(--white);
  background: var(--glass-strong);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.2);
}

.stat-icon {
  font-size: 24px;
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  color: var(--accent);
  font-weight: 600;
}

.stat-content h3 {
  font-size: 28px;
  font-weight: 700;
  color: var(--white);
  margin: 0 0 4px;
  line-height: 1;
}

.stat-content p {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}


.admin-section {
  margin-bottom: 40px;
}

.admin-section h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--white);
  margin: 0 0 20px;
}

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

.search-box {
  display: flex;
  align-items: center;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 4px;
  backdrop-filter: blur(20px);
}

.search-input {
  background: transparent;
  border: none;
  padding: 12px 16px;
  color: var(--white);
  font-size: 14px;
  width: 300px;
  outline: none;
}

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

.search-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.search-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--white);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
}

.admin-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-table td {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--white);
  font-size: 14px;
}

.admin-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.country-info, .location-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.flag {
  font-size: 16px;
}

.country-name, .location-text {
  font-weight: 500;
}

.percentage-bar {
  position: relative;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  height: 20px;
  overflow: hidden;
}

.percentage-fill {
  background: linear-gradient(90deg, var(--success), #16a34a);
  height: 100%;
  border-radius: 20px;
  transition: width 0.3s ease;
}

.percentage-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: 600;
  color: var(--white);
}

.ip-address {
  font-family: 'Courier New', monospace;
  color: var(--accent);
}

.timestamp {
  color: var(--muted);
  font-size: 13px;
}

.user-email {
  font-weight: 500;
  color: var(--white);
}

.subscription-end {
  color: var(--muted);
  font-size: 13px;
}

.no-date {
  color: var(--muted);
  font-style: italic;
}

.pages-used, .pages-limit {
  text-align: center;
  font-weight: 600;
}

.actions {
  text-align: center;
}

.action-btn {
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--accent);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: var(--glass-strong);
  color: var(--white);
  transform: translateY(-1px);
}

/* Modal styles for admin */
.plan-modal-content {
  max-width: 500px;
  width: 90%;
}

.modal-body {
  margin: 24px 0;
}

.plan-selection, .subscription-type {
  margin-bottom: 20px;
}

.plan-selection label, .subscription-type label {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}

.plan-select, .subscription-select {
  width: 100%;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--white);
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.plan-select:focus, .subscription-select:focus {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.plan-select option, .subscription-select option {
  background: var(--bg);
  color: var(--white);
}

/* Toast notifications */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 20px;
  color: var(--white);
  font-weight: 500;
  font-size: 14px;
  backdrop-filter: blur(20px);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 9999;
  max-width: 400px;
  min-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  pointer-events: auto;
  display: none;
}

.toast.show {
  display: block !important;
  transform: translateX(0);
}

/* Ensure toast is always on top */
.toast {
  position: fixed !important;
  z-index: 9999 !important;
}

.toast-success {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.toast-info {
  border-color: rgba(96, 165, 250, 0.3);
  background: rgba(96, 165, 250, 0.1);
  color: var(--pro);
}

/* Mobile responsiveness for admin */
@media (max-width: 768px) {
  .admin-dashboard {
    padding: 20px 16px;
  }
  
  .admin-header {
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
  }
  
  .admin-header h1 {
    font-size: 24px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .stat-card {
    padding: 20px;
  }
  
  .stat-icon {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
  
  .stat-content h3 {
    font-size: 24px;
  }
  
  .stat-content p {
    font-size: 13px;
  }
  
  .search-input {
    width: 200px;
  }
  
  .admin-table {
    font-size: 12px;
  }
  
  .admin-table th,
  .admin-table td {
    padding: 12px 8px;
  }
  
  .action-btn {
    padding: 6px 12px;
    font-size: 11px;
  }
  
  .toast {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
    min-width: auto;
    white-space: normal;
    text-align: center;
    display: none;
  }
  
  .toast.show {
    display: block;
  }
}

/* Table transition animations */
.table-container {
  position: relative;
  overflow: hidden;
}

.table-container.slide-left {
  animation: slideInLeft 0.3s ease both;
}

.table-container.slide-right {
  animation: slideInRight 0.3s ease both;
}

.table-container.slide-out-left {
  animation: slideOutLeft 0.2s ease both;
}

.table-container.slide-out-right {
  animation: slideOutRight 0.2s ease both;
}

/* Loading modal */
.loading-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 9999;
}

.loading-modal.show {
  opacity: 1;
  visibility: visible;
}

.loading-modal-content {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 40px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: modalSlideIn 0.4s ease both;
}

.loading-animation {
  margin-bottom: 24px;
  position: relative;
}

.pdf-icon {
  color: var(--accent);
  margin-bottom: 16px;
  animation: pdfPulse 2s ease-in-out infinite;
}

.loading-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: dotBounce 1.4s ease-in-out infinite both;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }
.dot:nth-child(3) { animation-delay: 0s; }

.loading-modal-content h3 {
  margin: 0 0 8px;
  font-size: 24px;
  color: var(--white);
  font-weight: 600;
}

.loading-modal-content p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.loading-progress {
  margin-top: 24px;
}

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

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: progressShine 2s ease-in-out infinite;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--accent);
}

.progress-text span:first-child {
  font-weight: 500;
}

.progress-text span:last-child {
  font-weight: 600;
  color: var(--white);
}

/* UI blocking */
body.loading-active {
  overflow: hidden;
}

body.loading-active * {
  pointer-events: none !important;
}

body.loading-active .loading-modal {
  pointer-events: auto !important;
}

/* Модальное окно */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 999;
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  padding: 36px;
  max-width: 480px;
  width: 90%;
  animation: modalSlideIn 0.3s ease both;
}

.modal-content h3 {
  margin: 0 0 16px;
  font-size: 26px;
  color: var(--white);
}

.modal-content p {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.modal-actions .ghost,
.modal-actions .cta {
  margin: 0;
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

