:root {
  --bg-color: #0d1117;
  --bg-card: rgba(22, 27, 34, 0.75);
  --bg-card-hover: rgba(33, 38, 45, 0.85);
  --border-color: rgba(255, 255, 255, 0.1);
  --text-main: #f0f6fc;
  --text-muted: #8b949e;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --accent: #06b6d4;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --radius-lg: 16px;
  --radius-md: 10px;
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-code: 'Fira Code', monospace;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

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

body {
  background-color: var(--bg-color);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.15) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 1050px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navbar */
.navbar {
  background: rgba(13, 17, 23, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.5px;
}

.brand-domain {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
}

.nav-links {
  display: flex;
  gap: 8px;
}

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

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: #fff;
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
}

/* Card General */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

/* Main Content Tabs */
.tab-content {
  display: none;
  padding: 30px 0;
}

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

/* Email Generator Card */
.email-generator-card {
  text-align: center;
  position: relative;
  overflow: hidden;
}

.card-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--success);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #fff 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.email-input-box {
  display: flex;
  gap: 10px;
  max-width: 720px;
  margin: 0 auto 20px auto;
}

.email-field {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.email-field-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.email-field input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: var(--accent);
  font-family: var(--font-code);
  font-size: 1.1rem;
  font-weight: 600;
  padding: 14px 16px 14px 46px;
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.2s ease;
}

.email-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.domain-selector-wrapper {
  display: flex;
  align-items: center;
}

.domain-select-dropdown {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-code);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 14px 14px;
  border-radius: var(--radius-md);
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.domain-select-dropdown:hover {
  border-color: var(--accent);
}

.domain-select-dropdown option {
  background: #161b22;
  color: #fff;
}

/* Quick Code Banner Box (Ổ nhỏ hiển thị mã OTP Code) */
.code-banner-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.2);
  animation: glowPulse 2s infinite alternate;
}

@keyframes glowPulse {
  0% { border-color: rgba(99, 102, 241, 0.4); box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2); }
  100% { border-color: rgba(6, 182, 212, 0.7); box-shadow: 0 8px 30px rgba(6, 182, 212, 0.4); }
}

.code-banner-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.code-badge-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.code-info {
  display: flex;
  flex-direction: column;
}

.code-title {
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 1px;
  color: var(--accent);
}

.code-sender {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.code-banner-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.code-display {
  font-family: var(--font-code);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 4px;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 18px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--accent);
}

.btn-copy-code-fast {
  background: linear-gradient(135deg, #10b981, #059669);
  padding: 10px 18px;
}

.btn-copy-code-fast:hover {
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.6);
}

/* Mail Code Badge */
.mail-code-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--success);
  font-family: var(--font-code);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 2px 8px;
  border-radius: 6px;
  margin-left: 8px;
}

.mail-code-badge:hover {
  background: rgba(16, 185, 129, 0.4);
}

/* Buttons */
.btn {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

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

.btn-danger-sm {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 6px;
  cursor: pointer;
}

.btn-danger-sm:hover {
  background: rgba(239, 68, 68, 0.3);
}

.email-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* Inbox List */
.inbox-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}

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

.inbox-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.inbox-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
}

.empty-inbox {
  text-align: center;
  padding: 45px 20px;
  color: var(--text-muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s infinite linear;
  margin: 0 auto 16px auto;
}

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

.empty-inbox .sub-text {
  display: block;
  font-size: 0.85rem;
  margin-top: 6px;
  opacity: 0.7;
}

/* Mail Item Row */
.mail-item {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mail-item:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
}

.mail-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #4b5563, #1f2937);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 1rem;
}

.mail-info {
  flex: 1;
  overflow: hidden;
}

.mail-sender {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.mail-subject {
  color: var(--text-muted);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mail-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* API Docs Section */
.api-docs-header h2 {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.api-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.api-meta-info {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.meta-item .label {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-right: 6px;
}

.code-inline {
  background: rgba(0, 0, 0, 0.4);
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font-code);
  color: var(--accent);
  font-size: 0.85rem;
}

.badge-free {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}

.api-endpoints-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.endpoint-card {
  margin-bottom: 0;
}

.highlight-endpoint {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.http-method {
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.8rem;
  font-family: var(--font-code);
}

.method-get { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.method-delete { background: rgba(239, 68, 68, 0.2); color: var(--danger); }

.endpoint-path {
  font-family: var(--font-code);
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
}

.endpoint-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.code-block-wrapper {
  background: #090d13;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 12px;
}

.code-header {
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.btn-copy-code {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-copy-code:hover { color: #fff; }

.code-block-wrapper pre {
  padding: 14px;
  font-family: var(--font-code);
  font-size: 0.85rem;
  color: #e6edf3;
  overflow-x: auto;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

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

.modal-card {
  background: #161b22;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 800px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal-sm { max-width: 380px; }

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

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.btn-close-modal:hover { color: #fff; }

.modal-meta {
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.meta-row { margin-bottom: 4px; }
.meta-label { color: var(--text-muted); width: 90px; display: inline-block; }
.meta-val { color: var(--text-main); font-weight: 600; }

.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.3);
}

.modal-tab-btn {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-weight: 600;
  cursor: pointer;
}

.modal-tab-btn.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

.modal-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #fff;
  min-height: 300px;
}

#modal-html-frame {
  width: 100%;
  height: 380px;
  border: none;
  background: #fff;
}

#modal-text-content {
  background: #0d1117;
  color: #e6edf3;
  padding: 16px;
  font-family: var(--font-code);
  font-size: 0.9rem;
  white-space: pre-wrap;
  height: 380px;
  overflow-y: auto;
}

/* Toast */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease;
}

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

.modal-body-qr {
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

#qrcode-container img {
  border-radius: 8px;
  border: 4px solid #fff;
}

.qr-email-text {
  font-family: var(--font-code);
  color: var(--accent);
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  .email-input-box { flex-direction: column; }
  .email-actions { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
  .hero-title { font-size: 1.5rem; }
  .code-banner-box { flex-direction: column; gap: 16px; text-align: center; }
  .code-banner-left { flex-direction: column; }
}
