/* ==========================================================================
   Sonjj Realtime TempMail Studio - Design System & Modern Aesthetics
   Style: Dark Mode Glassmorphism, Linear/Vercel Aesthetic, Fluid Micro-interactions
   ========================================================================== */

:root {
  --bg-base: #0a0d14;
  --bg-surface: #111522;
  --bg-card: rgba(20, 26, 42, 0.7);
  --bg-card-hover: rgba(28, 36, 58, 0.85);
  --bg-subtle: #161d2f;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(120, 119, 198, 0.35);
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);

  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-sky: #0ea5e9;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--primary-glow);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Ambient dynamic background glows */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}

.glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
  top: -150px;
  left: 15%;
}

.glow-2 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #0ea5e9 0%, transparent 70%);
  top: 40%;
  right: -100px;
}

/* Custom modern scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 13, 20, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 24px;
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.logo-icon {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f46e5, #0ea5e9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

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

.live-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-pro {
  background: linear-gradient(90deg, #6366f1, #a855f7);
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.06em;
}

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

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

/* Credit Pill */
.credit-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(30, 41, 67, 0.6);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  transition: border-color 0.2s, background-color 0.2s;
}

.credit-pill:hover {
  border-color: rgba(99, 102, 241, 0.6);
  background: rgba(30, 41, 67, 0.85);
}

.credit-icon {
  font-size: 0.95rem;
  color: #fbbf24;
}

.credit-label {
  color: var(--text-muted);
  font-weight: 500;
}

.credit-value {
  color: #a5b4fc;
  font-weight: 700;
  font-family: var(--font-mono);
}

.icon-btn-small {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: 4px;
  transition: color 0.2s, transform 0.2s;
}

.icon-btn-small:hover {
  color: var(--text-primary);
  transform: rotate(45deg);
}

/* Action Buttons */
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

/* Main Container Layout */
.main-container {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Generator Card */
.generator-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
}

.tabs-header {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
}

.tab-icon {
  font-size: 1.1rem;
}

.tab-hint {
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--text-muted);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

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

.generator-form-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.flex-1 { flex: 1 1 180px; }
.flex-2 { flex: 2 1 280px; }

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.input-with-action {
  position: relative;
  display: flex;
  align-items: center;
}

input[type="text"], select {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.inline-btn {
  position: absolute;
  right: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.inline-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: white;
}

.form-group--submit {
  flex: 1 1 200px;
}

/* Radio Cards */
.radio-cards {
  display: flex;
  gap: 12px;
}

.radio-card {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.radio-card input {
  margin-top: 3px;
  accent-color: var(--primary);
}

.radio-card-content strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.radio-card-content small {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.radio-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.radio-card.active {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #4338ca);
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #3730a3);
  box-shadow: 0 6px 20px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-gmail {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.btn-gmail:hover {
  background: linear-gradient(135deg, #dc2626, #991b1b);
}

.btn-outlook {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.btn-outlook:hover {
  background: linear-gradient(135deg, #0369a1, #075985);
}

.btn-inboxes {
  background: linear-gradient(135deg, #d97706, #b45309);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
  color: white;
}

.btn-inboxes:hover {
  background: linear-gradient(135deg, #b45309, #92400e);
}

.btn-mailtm {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
  color: white;
}

.btn-mailtm:hover {
  background: linear-gradient(135deg, #047857, #065f46);
}

.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Active Email Card */
.active-email-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: var(--shadow-md), 0 0 25px rgba(99, 102, 241, 0.1);
}

.active-email-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.active-type-pill {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.active-type-pill.type-gmail {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
}

.active-type-pill.type-outlook {
  background: rgba(14, 165, 233, 0.2);
  color: #7dd3fc;
  border-color: rgba(14, 165, 233, 0.35);
}

.active-type-pill.type-inboxes {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.4);
}

.active-type-pill.type-mailtm {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.4);
}

.email-address-wrapper {
  background: rgba(0, 0, 0, 0.4);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.active-address {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: #e0e7ff;
  letter-spacing: -0.02em;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #e0e7ff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: rgba(99, 102, 241, 0.32);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.icon-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.active-email-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sync-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 170px;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.pulse-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
  animation: pulse-dot 1.5s infinite;
}

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

.sync-progress-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #6366f1, #0ea5e9);
  transition: width 0.1s linear;
}

.sync-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sync-actions select {
  width: auto;
  padding: 8px 12px;
  font-size: 0.82rem;
}

.btn-auto-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-auto-toggle .toggle-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-dot 1.5s infinite;
}

.btn-auto-toggle.paused {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.btn-auto-toggle.paused .toggle-dot {
  background: #ef4444;
  box-shadow: none;
  animation: none;
}

/* Multi-Inbox Chips */
.multi-inbox-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.multi-inbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.btn-link-small {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: underline;
}

.btn-link-small:hover {
  color: var(--accent-rose);
}

.multi-inbox-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inbox-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.inbox-chip:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

.inbox-chip.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
  color: #c7d2fe;
}

.chip-unread {
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-weight: 700;
}

.chip-delete {
  color: var(--text-muted);
  margin-left: 2px;
  font-size: 0.9rem;
  line-height: 1;
}

.chip-delete:hover {
  color: var(--accent-rose);
}

/* Workspace Grid (Split View) */
.workspace-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 20px;
  min-height: 580px;
}

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

/* Inbox Column (Left) */
.inbox-column {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.column-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.column-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.column-title h2 {
  font-size: 1.05rem;
  font-weight: 700;
}

.msg-counter {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--text-secondary);
  font-weight: 600;
}

.filter-wrapper input {
  padding: 8px 12px;
  font-size: 0.82rem;
}

.message-feed-container {
  flex: 1;
  overflow-y: auto;
  max-height: 650px;
  position: relative;
}

/* Empty State Radar Animation */
.empty-feed {
  padding: 60px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.radar-box {
  position: relative;
  width: 90px;
  height: 90px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-circle {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1.5px solid rgba(99, 102, 241, 0.3);
  animation: radar-wave 3s infinite cubic-bezier(0.2, 0.6, 0.35, 1);
}

.circle-2 {
  animation-delay: 1s;
}

.circle-3 {
  animation-delay: 2s;
}

@keyframes radar-wave {
  0% { transform: scale(0.3); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}

.radar-icon {
  font-size: 2.2rem;
  z-index: 2;
}

.empty-feed h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-feed p {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 280px;
}

/* Message List Items */
.message-list {
  display: flex;
  flex-direction: column;
}

.message-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  gap: 14px;
  position: relative;
}

.message-item:hover {
  background: var(--bg-card-hover);
}

.message-item.active {
  background: rgba(99, 102, 241, 0.12);
  border-left: 3px solid var(--primary);
}

.sender-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3730a3, #4338ca);
  color: #c7d2fe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.message-meta-content {
  flex: 1;
  min-width: 0;
}

.message-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.message-sender {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.message-subject {
  font-size: 0.84rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.otp-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
}

/* Reader Column (Right) */
.reader-column {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative;
}

.reader-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  color: var(--text-muted);
  text-align: center;
}

.reader-empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.reader-empty h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.reader-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* OTP Banner */
.otp-banner {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.2), rgba(6, 95, 70, 0.3));
  border-bottom: 1px solid rgba(16, 185, 129, 0.35);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.otp-badge-icon {
  font-size: 1.5rem;
}

.otp-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.otp-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #a7f3d0;
  letter-spacing: 0.05em;
}

.otp-code {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 800;
  color: #34d399;
  letter-spacing: 0.1em;
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 10px;
  border-radius: var(--radius-sm);
}

.btn-otp-copy {
  background: #10b981;
  color: #064e3b;
  border: none;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-otp-copy:hover {
  background: #34d399;
  transform: translateY(-1px);
}

/* Reader Header */
.reader-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(17, 21, 34, 0.5);
}

.email-subject {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 14px;
  line-height: 1.3;
}

.email-meta-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  margin-bottom: 16px;
}

.meta-row {
  display: flex;
  gap: 8px;
}

.meta-label {
  color: var(--text-muted);
  width: 90px;
  flex-shrink: 0;
}

.meta-value {
  color: var(--text-secondary);
}

.meta-from {
  color: #93c5fd;
  font-weight: 600;
}

.reader-view-tabs {
  display: flex;
  gap: 8px;
}

.reader-tab-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.reader-tab-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.reader-tab-btn.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  color: #c7d2fe;
}

/* Viewport */
.reader-viewport {
  flex: 1;
  position: relative;
  min-height: 400px;
  display: flex;
}

.view-panel {
  display: none;
  width: 100%;
  height: 100%;
}

.view-panel.active {
  display: block;
}

#view-html iframe {
  width: 100%;
  height: 100%;
  min-height: 480px;
  border: none;
  background: white;
  border-bottom-right-radius: var(--radius-lg);
}

.raw-text-view {
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-y: auto;
  max-height: 500px;
}

.attachment-list {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.attachment-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
}

.loading-message-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 13, 20, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.9rem;
  color: #a5b4fc;
  z-index: 10;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  background: #141a2a;
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-card--small {
  max-width: 360px;
}

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

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

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

.modal-close-btn:hover {
  color: white;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.qrcode-wrapper {
  background: white;
  padding: 16px;
  border-radius: var(--radius-md);
  display: inline-block;
  margin: 0 auto 12px;
}

.qr-desc {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: #e0e7ff;
}

.help-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.key-test-status {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  display: none;
}

.key-test-status.success {
  display: block;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.key-test-status.error {
  display: block;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

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

.toast {
  background: #1e293b;
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  color: white;
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.toast-success {
  border-color: rgba(16, 185, 129, 0.4);
}
