/* ========================================
   DevMail TempMail - Design System
   Dark theme inspired by giaodien.txt
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* === RESET & BASE === */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-base: #0a0a0a;
  --bg-card: #121212;
  --bg-elevated: #171717;
  --bg-input: #050505;
  --bg-hover: #1a1a1a;

  --border: #262626;
  --border-light: #333;

  --text-primary: #ffffff;
  --text-secondary: #d4d4d4;
  --text-muted: #737373;
  --text-dim: #525252;

  --cyan: #22d3ee;
  --cyan-light: #67e8f9;
  --cyan-bg: rgba(34, 211, 238, 0.1);
  --cyan-border: rgba(34, 211, 238, 0.2);

  --emerald: #34d399;
  --emerald-bg: rgba(52, 211, 153, 0.2);

  --yellow: #eab308;
  --yellow-fill: #eab308;

  --red: #ef4444;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.3);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
}

body {
  font-family: var(--font-sans);
  background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  cursor: url('../img/mouse-f1.png'), auto;
}

/* Anti-FOUC for Lucide Icons */
i[data-lucide] {
  display: inline-block;
  width: 24px;
  height: 24px;
  vertical-align: middle;
}

/* Custom Pointer Cursors */
a,
button,
select,
input[type="button"],
input[type="submit"],
[role="button"],
.pointer,
label,
.message-item,
.product-card,
.shop-product,
.offer-badge-row,
.domain-display,
.list-item,
.card-link {
  cursor: url('../img/mouse-f2.png'), pointer !important;
}


/* Space background - stars container */
#stars-container {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  animation: starTwinkle 3s ease-in-out infinite;
}

@keyframes starTwinkle {

  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.shooting-star {
  position: absolute;
  height: 2px;
  background: linear-gradient(-45deg, rgba(34, 211, 238, 1), rgba(34, 211, 238, 0));
  filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.8));
  animation: shootTail 3s ease-in-out, shootMove 3s ease-in-out;
}

@keyframes shootTail {
  0% {
    width: 0;
  }

  30% {
    width: 100px;
  }

  100% {
    width: 0;
  }
}

@keyframes shootMove {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(300px);
  }
}

/* Floating nebula blobs */
.nebula-blob {
  position: fixed;
  border-radius: 50%;
  mix-blend-mode: screen;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.nebula-blob-1 {
  top: -10%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: rgba(88, 28, 135, 0.3);
  animation: nebulaFloat 8s ease-in-out infinite;
}

.nebula-blob-2 {
  bottom: -10%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: rgba(30, 58, 138, 0.3);
  animation: nebulaFloat 8s ease-in-out 4s infinite;
}

.nebula-blob-3 {
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 400px;
  background: rgba(49, 46, 129, 0.2);
  animation: nebulaPulse 4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes nebulaFloat {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-20px) scale(1.05);
  }
}

@keyframes nebulaPulse {

  0%,
  100% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }
}

/* Terminal cursor blink for header */
.header-title .cursor, .shop-title .cursor {
  display: inline-block;
  color: var(--cyan);
  font-weight: 800;
  margin-left: 2px;
  animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

.header-icon {
  animation: iconGlow 2s ease-in-out infinite alternate;
}

@keyframes iconGlow {
  0% {
    box-shadow: 0 0 5px rgba(34, 211, 238, 0.2);
  }

  100% {
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.5), 0 0 30px rgba(34, 211, 238, 0.15);
  }
}

::selection {
  background: rgba(34, 211, 238, 0.3);
  color: var(--cyan-light);
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  color: var(--cyan-light);
}

/* === LAYOUT === */
.app-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  z-index: 1;
}

/* === CARD === */
.card {
  background: #12121270;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* === HEADER === */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

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

.header-icon {
  padding: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-icon svg {
  width: 24px;
  height: 24px;
  color: var(--cyan);
}

.header-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.header-title .dot {
  color: var(--cyan);
}

.header-subtitle {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.1);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--cyan-border);
  transition: all 0.2s ease;
}

.status-badge:hover {
  background: rgba(34, 211, 238, 0.2);
  color: var(--cyan-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 211, 238, 0.2);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

/* === EMAIL CONTROLS === */
.email-controls {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.email-controls-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.email-input-group {
  flex: 1;
  display: flex;
  height: 54px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s;
}

.btn-group {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.btn-group .btn {
  height: 52px;
}

.email-input-group:focus-within {
  border-color: rgba(34, 211, 238, 0.5);
}

.email-input-icon {
  display: flex;
  align-items: center;
  padding: 0 8px 0 16px;
  color: var(--text-dim);
  transition: color 0.2s;
}

.email-input-group:focus-within .email-input-icon {
  color: var(--cyan);
}

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

.email-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 14px 8px;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-primary);
  min-width: 0;
}

.email-input::placeholder {
  color: var(--text-dim);
}

.email-domain-wrap {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-left: 1px solid var(--border);
  background: var(--bg-base);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  gap: 4px;
}

.email-at {
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.email-subdomain-input {
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--cyan-light);
  width: 50px;
  min-width: 30px;
  max-width: 100px;
  padding: 4px 2px;
  text-align: right;
}

.email-subdomain-input::placeholder {
  color: var(--text-dim);
  opacity: 0.4;
}

.email-subdomain-dot {
  font-family: var(--font-mono);
  color: var(--text-dim);
  user-select: none;
}

.email-domain-select {
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 14px 4px;
  appearance: none;
}

.email-domain-select:hover {
  color: var(--text-primary);
}

.email-domain-select option {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

/* Custom Domain Dropdown - Glassmorphism */
.email-domain-wrap {
  position: relative;
}

.domain-display {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 14px 4px;
  transition: color 0.2s;
  white-space: nowrap;
  user-select: none;
}

.domain-display:hover {
  color: var(--cyan-light);
}

.domain-display svg {
  flex-shrink: 0;
  transition: transform 0.2s;
}

.domain-custom-dropdown {
  position: fixed;
  min-width: 200px;
  background: rgba(20, 20, 30, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(34, 211, 238, 0.15);
  border-radius: 16px;
  padding: 8px;
  z-index: 9999;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  animation: dropdownFadeIn 0.15s ease-out;
}

.domain-custom-dropdown.hidden {
  display: none;
}

.domain-option {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-secondary);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.domain-option:hover {
  background: rgba(34, 211, 238, 0.12);
  color: var(--cyan);
}

.domain-option:active {
  background: rgba(34, 211, 238, 0.2);
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn-group {
  display: flex;
  gap: 8px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  border: 1px solid;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.96);
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-cyan {
  background: var(--cyan-bg);
  color: var(--cyan);
  border-color: var(--cyan-border);
}

.btn-cyan:hover {
  background: rgba(34, 211, 238, 0.2);
}

.btn-neutral {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-color: var(--border-light);
}

.btn-neutral:hover {
  background: var(--bg-hover);
}

.btn-primary {
  background: var(--cyan);
  color: #000;
  border-color: var(--cyan);
  font-weight: 700;
}

.btn-primary:hover {
  background: var(--cyan-light);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.btn-sm svg {
  width: 16px;
  height: 16px;
}

/* === SHOP BANNER / SLIDER === */
.offer-banner {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: #12121270;
  padding: 20px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: var(--shadow-sm);
  margin-top: 8px;
}

.offer-badge-row {
  position: absolute;
  top: -14px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 5;
}

.offer-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.offer-badge svg {
  width: 14px;
  height: 14px;
  color: var(--cyan);
}

.offer-badge span {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.btn-view-shop {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-view-shop:hover {
  color: var(--cyan);
  border-color: var(--cyan-border);
}

.btn-view-shop svg {
  width: 12px;
  height: 12px;
}

.slider-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.slider-fade-left,
.slider-fade-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 32px;
  z-index: 10;
  pointer-events: none;
}

.slider-fade-left {
  left: 0;
  background: linear-gradient(to right, var(--bg-card), transparent);
}

.slider-fade-right {
  right: 0;
  background: linear-gradient(to left, var(--bg-card), transparent);
}

.slider-track {
  display: flex;
  gap: 12px;
  overflow-x: hidden;
  scroll-behavior: smooth;
  padding: 4px 4px;
}

.slider-track::-webkit-scrollbar {
  display: none;
}

.slider-track {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.product-card {
  flex-shrink: 0;
  width: calc(50% - 6px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(23, 23, 23, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}

.product-card:hover {
  background: var(--bg-hover);
  border-color: var(--cyan-border);
}

.product-card-icon {
  padding: 10px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card:hover .product-card-icon {
  border-color: rgba(34, 211, 238, 0.4);
}

.product-card-icon svg,
.product-card-icon img {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: color 0.2s;
}

.product-card-icon img {
  border-radius: 4px;
  object-fit: cover;
}

.product-card:hover .product-card-icon svg {
  color: var(--cyan);
}

.product-card-info {
  flex: 1;
  min-width: 0;
}

.product-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s;
}

.product-card:hover .product-card-name {
  color: var(--text-primary);
}

.product-card-desc {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card-price {
  text-align: right;
  flex-shrink: 0;
  padding-right: 4px;
}

.product-price-current {
  color: var(--cyan);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.03em;
}

.product-price-old {
  color: var(--text-dim);
  font-size: 10px;
  text-decoration: line-through;
}

.btn-close-banner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-full);
  transition: all 0.2s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: -14px;
  right: 16px;
  z-index: 5;
}

.btn-close-banner:hover {
  color: var(--text-primary);
  border-color: var(--cyan-border);
}

.btn-close-banner svg {
  width: 16px;
  height: 16px;
}

/* === INBOX === */
.inbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.inbox-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.inbox-title-group svg {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

.inbox-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.inbox-count {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.inbox-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.inbox-time {
  display: flex;
  align-items: center;
  gap: 6px;
}

.inbox-time svg {
  width: 14px;
  height: 14px;
}

.btn-refresh {
  padding: 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.btn-refresh svg {
  width: 16px;
  height: 16px;
}

.btn-refresh.spinning svg {
  animation: spin 0.8s linear infinite;
  color: var(--cyan);
}

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

.inbox-content {
  min-height: 400px;
}

/* Empty state */
.inbox-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  gap: 16px;
  color: var(--text-dim);
  padding: 40px;
}

.inbox-empty-icon {
  padding: 16px;
}

.inbox-empty-icon svg {
  width: 32px;
  height: 32px;
  color: var(--text-dim);
  stroke-width: 1.5;
}

.inbox-empty-title {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-muted);
}

.inbox-empty-desc {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  max-width: 320px;
  line-height: 1.6;
}

/* Message list */
.message-list {
  overflow-y: auto;
  max-height: 450px;
}

.message-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(38, 38, 38, 0.5);
  cursor: pointer;
  transition: background 0.15s;
}

.message-item:hover {
  background: rgba(38, 38, 38, 0.5);
}

.message-item:last-child {
  border-bottom: none;
}

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

.message-subject {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s;
}

.message-item:hover .message-subject {
  color: var(--cyan);
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-dim);
}

.message-from {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.message-arrow {
  color: var(--text-dim);
  transition: color 0.15s;
}

.message-item:hover .message-arrow {
  color: var(--cyan);
}

.message-arrow svg {
  width: 16px;
  height: 16px;
}

/* Message Detail View */
.message-detail {
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
}

.message-detail-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.message-detail-subject {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.message-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.message-detail-from {
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-detail-from-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.message-detail-from-value {
  font-family: var(--font-mono);
  color: var(--cyan);
  background: var(--cyan-bg);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--cyan-border);
  font-size: 13px;
}

.message-detail-date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.message-detail-date svg {
  width: 14px;
  height: 14px;
}

.message-body {
  background: #ffffff;
  overflow: hidden;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.message-body iframe {
  width: 100%;
  border: none;
  min-height: 600px;
  display: block;
}

.message-body pre {
  padding: 24px;
  white-space: pre-wrap;
  font-family: var(--font-sans);
  color: #333;
  font-size: 14px;
  line-height: 1.7;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
}

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

.btn-back svg {
  width: 18px;
  height: 18px;
}

/* Loading spinner */
.loading-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: var(--text-muted);
}

.loading-center svg {
  width: 24px;
  height: 24px;
  color: var(--cyan);
  animation: spin 0.8s linear infinite;
}

.loading-center p {
  font-family: var(--font-mono);
  font-size: 14px;
}

/* Error state */
.error-center {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--red);
  font-size: 14px;
}

/* === MODAL === */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal {
  background: var(--bg-card);
  width: 100%;
  max-width: 440px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: zoomIn 0.2s ease;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes zoomIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

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

.modal-title {
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

.modal-title svg {
  width: 16px;
  height: 16px;
  color: var(--yellow);
  fill: var(--yellow-fill);
}

.btn-close-modal {
  background: var(--bg-base);
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close-modal:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.btn-close-modal svg {
  width: 18px;
  height: 18px;
}

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

/* Product Detail (Step 1) */
.product-detail-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.product-detail-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.product-detail-icon svg {
  width: 32px;
  height: 32px;
  color: var(--cyan);
}

.product-detail-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-detail-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.product-detail-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.product-detail-prices {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-detail-price-current {
  font-size: 18px;
  font-weight: 700;
  color: var(--cyan);
}

.product-detail-price-old {
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: line-through;
}

/* Stock & Quantity */
.stock-quantity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg-input);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(38, 38, 38, 0.5);
}

.stock-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.stock-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quantity-label {
  font-size: 12px;
  color: var(--text-dim);
}

.quantity-input-group {
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.quantity-btn {
  padding: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-btn:hover {
  color: var(--text-primary);
}

.quantity-btn svg {
  width: 14px;
  height: 14px;
}

.quantity-value {
  width: 32px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Full description */
.product-full-desc h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.product-full-desc p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Form inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 4px;
}

.form-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
  font-family: var(--font-sans);
}

.form-input::placeholder {
  color: var(--text-dim);
}

.form-input:focus {
  border-color: rgba(34, 211, 238, 0.5);
}

/* Order summary box */
.order-summary {
  background: var(--bg-input);
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(38, 38, 38, 0.5);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.order-summary-label {
  font-size: 14px;
  color: var(--text-muted);
}

.order-summary-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.order-summary-value .qty {
  color: var(--text-dim);
}

/* Button row */
.btn-row {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn-row .btn {
  flex: 1;
}

.btn-row .btn-primary {
  flex: 2;
}

/* Step 3: Payment QR */
.payment-success {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.payment-success-icon {
  width: 48px;
  height: 48px;
  background: var(--emerald-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.payment-success-icon svg {
  width: 24px;
  height: 24px;
  color: var(--emerald);
}

.payment-success-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.payment-success-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.qr-box {
  background: #fff;
  padding: 16px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 4px solid rgba(38, 38, 38, 0.5);
}

.qr-box img {
  width: 200px;
  height: 200px;
  object-fit: contain;
}

.qr-box svg {
  width: 160px;
  height: 160px;
  color: #000;
}

.payment-info-box {
  background: var(--bg-input);
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(38, 38, 38, 0.5);
}

.payment-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.payment-info-label {
  font-size: 14px;
  color: var(--text-dim);
}

.payment-info-value {
  font-weight: 700;
}

.payment-info-value.total {
  font-size: 20px;
  color: var(--cyan);
}

.payment-info-value.buyer {
  font-size: 12px;
  color: var(--text-secondary);
}

.payment-content {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--cyan);
  background: var(--cyan-bg);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--cyan-border);
}

/* === TOAST === */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  opacity: 0;
  pointer-events: none;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 500;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast svg {
  width: 16px;
  height: 16px;
  color: var(--emerald);
}

/* === SCROLLBARS === */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.message-body::-webkit-scrollbar {
  width: 8px;
}

.message-body::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.message-body::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.message-body::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .app-container {
    padding: 16px 12px;
    gap: 16px;
  }

  .email-controls-row {
    flex-direction: column;
  }

  .btn-group {
    width: 100%;
  }

  .btn-group .btn {
    flex: 1;
  }

  .btn-text {
    display: inline;
  }

  .status-badge {
    display: none;
  }

  .product-card {
    width: 85%;
  }

  .slider-track {
    overflow-x: auto;
  }

  .slider-fade-left,
  .slider-fade-right {
    display: none;
  }

  .offer-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .offer-badge-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .inbox-time {
    display: none;
  }

  .message-detail-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

/* =========================================================
   ADMIN PAGE STYLES
   ========================================================= */

.admin-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 16px;
}

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

.admin-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.admin-title .dot {
  color: var(--cyan);
}

/* Login form */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
}

.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}

.login-box h2 {
  font-size: 22px;
  color: var(--text-primary);
  margin-bottom: 8px;
  text-align: center;
}

.login-box .subtitle {
  font-size: 14px;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 24px;
}

.login-box .form-group {
  margin-bottom: 16px;
}

.login-error {
  color: var(--red);
  font-size: 13px;
  text-align: center;
  margin-bottom: 12px;
}

/* Tabs */
.admin-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-elevated);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}

.admin-tab {
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  white-space: nowrap;
  font-family: var(--font-sans);
}

.admin-tab:hover {
  color: var(--text-secondary);
}

.admin-tab.active {
  background: var(--bg-card);
  color: var(--cyan);
  box-shadow: var(--shadow-sm);
}

/* Settings sections */
.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}

.settings-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

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

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

/* Tag list (for domains) */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tag {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.tag-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px;
  border-radius: 50%;
  transition: color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tag-remove:hover {
  color: var(--red);
}

.tag-remove svg {
  width: 14px;
  height: 14px;
}

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

.add-domain-row .form-input {
  flex: 1;
}

/* Product list */
.product-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-admin-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.product-admin-info {
  flex: 1;
  min-width: 0;
}

.product-admin-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.product-admin-meta {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

.product-admin-price {
  color: var(--cyan);
  font-weight: 600;
  font-size: 14px;
}

.product-admin-actions {
  display: flex;
  gap: 8px;
}

/* Product form */
.product-form {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 16px;
}

.product-form h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.product-form .settings-row {
  margin-bottom: 12px;
}

/* Status indicator */
.gmail-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-top: 12px;
}

.gmail-status.connected {
  background: var(--emerald-bg);
  color: var(--emerald);
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.gmail-status.disconnected {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Transaction table */
.transaction-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.transaction-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-base);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.transaction-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(38, 38, 38, 0.5);
  color: var(--text-secondary);
}

.transaction-table tr:hover td {
  background: rgba(38, 38, 38, 0.3);
}

.amount-positive {
  color: var(--emerald);
  font-weight: 600;
}

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

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

  .product-admin-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* === PAGE NAVIGATION === */
.page-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 0;
}

.page-nav-btn,
.page-nav-num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(20, 20, 30, 0.6);
  backdrop-filter: blur(8px);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.page-nav-btn:hover,
.page-nav-num:hover {
  background: rgba(34, 211, 238, 0.1);
  border-color: rgba(34, 211, 238, 0.3);
  color: var(--cyan);
}

.page-nav-num.active {
  background: rgba(34, 211, 238, 0.15);
  border-color: var(--cyan);
  color: var(--cyan-light);
  font-weight: 600;
}

.page-nav-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.page-nav-btn svg {
  width: 16px;
  height: 16px;
}

/* === MESSAGE BODY (READING CONTENT) === */
.message-body {
  max-height: 550px;
  overflow-y: auto;
  padding-right: 8px;
  /* space for scrollbar */
  margin-right: -4px;
  /* offset for padding */
}

/* Custom Scrollbar for message body */
.message-body::-webkit-scrollbar {
  width: 6px;
}

.message-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}

.message-body::-webkit-scrollbar-thumb {
  background: rgba(34, 211, 238, 0.2);
  border-radius: 4px;
}

.message-body::-webkit-scrollbar-thumb:hover {
  background: rgba(34, 211, 238, 0.5);
}

/* === SLIDER NAVIGATION === */
.slider-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: color 0.2s ease;
  padding: 8px;
}

.slider-nav-btn:hover {
  color: var(--cyan);
}

.slider-nav-prev {
  left: 0;
}

.slider-nav-next {
  right: 0;
}

.slider-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px;
}

.slider-track::-webkit-scrollbar {
  display: none;
}