/* ============================================================
   VoltMail WordPress Theme — Main Stylesheet
   ============================================================ */

:root {
  --vm-bg:         #030712;
  --vm-surface:    #0f172a;
  --vm-surface2:   #1e293b;
  --vm-border:     rgba(255,255,255,0.08);
  --vm-border2:    rgba(255,255,255,0.12);
  --vm-text:       #f8fafc;
  --vm-muted:      #94a3b8;
  --vm-accent:     #06b6d4;
  --vm-accent2:    #0891b2;
  --vm-danger:     #ef4444;
  --vm-success:    #22c55e;
  --vm-radius:     12px;
  --vm-shadow:     0 4px 24px rgba(0,0,0,0.4);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body.voltmail-body {
  background: var(--vm-bg);
  color: var(--vm-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--vm-accent); text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea { font-family: inherit; }
svg { display: block; flex-shrink: 0; }

/* ===== Header ===== */
.vm-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(3,7,18,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--vm-border);
}
.vm-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.vm-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--vm-text);
}
.vm-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--vm-accent), #7c3aed);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.vm-logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.vm-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.vm-btn-ghost {
  background: none;
  border: none;
  color: var(--vm-muted);
  font-size: 0.9rem;
  padding: 8px 12px;
  border-radius: 8px;
  transition: color .2s;
}
.vm-btn-ghost:hover { color: var(--vm-text); }
.vm-btn-outline {
  background: none;
  border: 1px solid var(--vm-border2);
  color: var(--vm-text);
  font-size: 0.85rem;
  padding: 7px 16px;
  border-radius: 8px;
  transition: all .2s;
}
.vm-btn-outline:hover { border-color: var(--vm-accent); color: var(--vm-accent); }

/* ===== Hero ===== */
.vm-hero { padding: 72px 24px 40px; text-align: center; }
.vm-hero-inner { max-width: 700px; margin: 0 auto; }
.vm-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(6,182,212,.12);
  border: 1px solid rgba(6,182,212,.25);
  color: var(--vm-accent);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 24px;
}
.vm-pulse {
  width: 8px; height: 8px;
  background: var(--vm-accent);
  border-radius: 50%;
  animation: vmPulse 2s ease-in-out infinite;
}
@keyframes vmPulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.4); opacity: .6; }
}
.vm-hero-title {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
}
.vm-gradient-text {
  background: linear-gradient(135deg, var(--vm-accent) 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.vm-hero-subtitle {
  color: var(--vm-muted);
  font-size: 1.1rem;
  max-width: 500px;
  margin: 0 auto;
}

/* ===== Email Box Card ===== */
.vm-emailbox-section { padding: 0 16px 60px; }
.vm-emailbox-card {
  max-width: 680px;
  margin: 0 auto;
  background: var(--vm-surface);
  border: 1px solid var(--vm-border);
  border-radius: 20px;
  padding: 32px 32px 24px;
  box-shadow: var(--vm-shadow);
}

/* ===== Loading & Error States ===== */
.vm-state-loading {
  text-align: center;
  padding: 40px 0;
  color: var(--vm-muted);
}
.vm-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--vm-border2);
  border-top-color: var(--vm-accent);
  border-radius: 50%;
  animation: vmSpin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes vmSpin { to { transform: rotate(360deg); } }
.vm-state-error {
  text-align: center;
  padding: 40px 0;
}
.vm-error-icon { font-size: 2.5rem; margin-bottom: 12px; }

/* ===== Label ===== */
.vm-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--vm-accent);
  text-align: center;
  margin-bottom: 16px;
}

/* ===== Address Row ===== */
.vm-address-row { margin-bottom: 16px; }
.vm-address-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid var(--vm-border2);
  border-radius: 14px;
  padding: 18px 20px;
}
.vm-address {
  flex: 1;
  font-size: clamp(1rem, 3.5vw, 1.4rem);
  font-weight: 600;
  letter-spacing: -0.3px;
  word-break: break-all;
  color: var(--vm-text);
}
.vm-icon-btn {
  background: var(--vm-accent);
  color: white;
  border: none;
  border-radius: 8px;
  width: 38px; height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s, transform .1s;
}
.vm-icon-btn:hover { background: var(--vm-accent2); }
.vm-icon-btn:active { transform: scale(.95); }
.vm-icon-btn.copied { background: var(--vm-success); }

/* ===== Meta Row ===== */
.vm-meta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}
.vm-meta-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--vm-border);
  color: var(--vm-muted);
  font-size: 0.82rem;
  padding: 5px 12px;
  border-radius: 100px;
}
.vm-dot { color: var(--vm-border2); }

/* ===== Actions ===== */
.vm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}
.vm-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--vm-border);
  color: var(--vm-text);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 10px;
  transition: all .2s;
}
.vm-action-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--vm-border2);
}
.vm-action-btn.spinning svg { animation: vmSpin 0.6s linear infinite; }
.vm-action-danger { color: var(--vm-danger); }
.vm-action-danger:hover { border-color: var(--vm-danger); background: rgba(239,68,68,.08); }

/* ===== Custom Username Form ===== */
.vm-custom-form {
  background: var(--vm-surface2);
  border: 1px solid var(--vm-border2);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.vm-custom-form-inner {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--vm-border2);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}
.vm-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--vm-text);
  font-size: 1rem;
  padding: 10px 14px;
  outline: none;
}
.vm-input::placeholder { color: var(--vm-muted); }
.vm-domain-suffix {
  color: var(--vm-muted);
  font-size: 0.9rem;
  padding: 10px 14px;
  border-left: 1px solid var(--vm-border2);
  white-space: nowrap;
}
.vm-custom-actions { display: flex; gap: 8px; }
.vm-btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all .2s;
  border: none;
}
.vm-btn-primary {
  background: var(--vm-accent);
  color: white;
}
.vm-btn-primary:hover { background: var(--vm-accent2); }
.vm-btn-ghost {
  background: rgba(255,255,255,0.06);
  color: var(--vm-muted);
}
.vm-btn-ghost:hover { color: var(--vm-text); }
.vm-username-feedback {
  font-size: 0.8rem;
  margin-top: 8px;
  min-height: 1.2em;
}
.vm-username-feedback.available { color: var(--vm-success); }
.vm-username-feedback.taken { color: var(--vm-danger); }

/* ===== QR Wrapper ===== */
.vm-qr-wrapper {
  display: flex;
  justify-content: center;
  padding: 16px 0;
}
.vm-qr-wrapper img {
  border-radius: 8px;
  background: white;
  padding: 10px;
}
.vm-qr-address {
  text-align: center;
  color: var(--vm-muted);
  font-size: 0.85rem;
  word-break: break-all;
  margin-top: 8px;
}

/* ===== Modals ===== */
.vm-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.vm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}
.vm-modal-box {
  position: relative;
  z-index: 1;
  background: var(--vm-surface);
  border: 1px solid var(--vm-border2);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.vm-modal-large { max-width: 720px; }
.vm-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.vm-modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
}
.vm-modal-close {
  background: var(--vm-surface2);
  border: none;
  color: var(--vm-muted);
  font-size: 1.3rem;
  width: 30px; height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  transition: color .2s;
}
.vm-modal-close:hover { color: var(--vm-text); }

/* ===== Message Viewer ===== */
.vm-msg-subject { font-size: 1rem; font-weight: 600; }
.vm-msg-meta { font-size: 0.8rem; color: var(--vm-muted); margin-top: 4px; }
.vm-msg-body-wrapper {
  flex: 1;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--vm-border);
  background: white;
}
.vm-msg-iframe {
  width: 100%;
  height: 400px;
  border: none;
  display: block;
}

/* ===== Inbox ===== */
.vm-inbox { margin-top: 8px; }
.vm-inbox-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--vm-muted);
}
.vm-inbox-empty-icon {
  color: rgba(255,255,255,0.15);
  margin-bottom: 16px;
}
.vm-inbox-empty p {
  font-size: 1rem;
  font-weight: 500;
  color: var(--vm-muted);
  margin-bottom: 6px;
}
.vm-inbox-empty span {
  font-size: 0.85rem;
  color: rgba(148,163,184,.6);
}
.vm-inbox-empty strong { color: var(--vm-accent); }
.vm-messages-list { display: flex; flex-direction: column; gap: 1px; }
.vm-message-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--vm-border);
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  margin-bottom: 6px;
}
.vm-message-item:hover {
  background: rgba(255,255,255,0.07);
  border-color: var(--vm-border2);
}
.vm-message-item.unread { border-left: 3px solid var(--vm-accent); }
.vm-message-avatar {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--vm-accent), #7c3aed);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: white;
  flex-shrink: 0;
}
.vm-message-content { flex: 1; min-width: 0; }
.vm-message-sender {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vm-message-subject {
  font-size: 0.82rem;
  color: var(--vm-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vm-message-time {
  font-size: 0.75rem;
  color: rgba(148,163,184,.6);
  flex-shrink: 0;
  white-space: nowrap;
}

/* ===== Features Section ===== */
.vm-features { padding: 60px 24px 80px; }
.vm-features-inner { max-width: 1000px; margin: 0 auto; }
.vm-section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 40px;
}
.vm-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.vm-feature-card {
  background: var(--vm-surface);
  border: 1px solid var(--vm-border);
  border-radius: 16px;
  padding: 28px 24px;
  transition: border-color .2s, transform .2s;
}
.vm-feature-card:hover { border-color: var(--vm-border2); transform: translateY(-2px); }
.vm-feature-icon { font-size: 1.8rem; margin-bottom: 14px; }
.vm-feature-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.vm-feature-card p { font-size: 0.875rem; color: var(--vm-muted); line-height: 1.6; }

/* ===== Footer ===== */
.vm-footer {
  border-top: 1px solid var(--vm-border);
  padding: 48px 24px 24px;
}
.vm-footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 32px;
}
.vm-footer-brand { max-width: 280px; }
.vm-footer-tagline { color: var(--vm-muted); font-size: 0.875rem; margin-top: 12px; }
.vm-footer-links { display: flex; gap: 48px; }
.vm-footer-col h4 { font-size: 0.85rem; font-weight: 600; margin-bottom: 14px; }
.vm-footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.vm-footer-col li { font-size: 0.82rem; color: var(--vm-muted); }
.vm-footer-bottom {
  max-width: 1000px;
  margin: 0 auto;
  padding-top: 20px;
  border-top: 1px solid var(--vm-border);
  text-align: center;
  font-size: 0.8rem;
  color: rgba(148,163,184,.5);
}

/* ===== Toast ===== */
.vm-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--vm-surface2);
  border: 1px solid var(--vm-border2);
  color: var(--vm-text);
  font-size: 0.875rem;
  padding: 10px 20px;
  border-radius: 100px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  z-index: 9999;
  animation: vmToastIn .2s ease;
  white-space: nowrap;
}
@keyframes vmToastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.vm-toast.success { border-color: var(--vm-success); color: var(--vm-success); }
.vm-toast.error   { border-color: var(--vm-danger); color: var(--vm-danger); }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .vm-emailbox-card { padding: 20px 16px; }
  .vm-hero { padding: 48px 16px 28px; }
  .vm-footer-inner { flex-direction: column; gap: 28px; }
  .vm-footer-links { gap: 24px; }
  .vm-actions { gap: 6px; }
  .vm-action-btn { font-size: 0.78rem; padding: 7px 12px; }
  .vm-nav .vm-btn-ghost { display: none; }
  .vm-modal-box { padding: 18px; }
  .vm-msg-iframe { height: 300px; }
}
