/* ═══════════════════════════════════════
   TempMail - Clean Fresh Theme
   ═══════════════════════════════════════ */

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

:root {
  --bg-body: #f5f7fa;
  --bg-card: #ffffff;
  --bg-surface: #f8fafc;
  --bg-hover: #f1f5f9;
  --border: #e8ecf0;
  --border-light: #e2e8f0;
  --text: #1e293b;
  --text-dim: #64748b;
  --text-muted: #94a3b8;
  --accent: #6366f1;
  --accent-light: #eef2ff;
  --accent-hover: #818cf8;
  --green: #22c55e;
  --green-light: #f0fdf4;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --font-mono: 'SF Mono', 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', system-ui, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: var(--font-sans);
  background: var(--bg-body);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
header {
  background: rgba(255,255,255,0.8);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
}

.logo h1 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-surface);
}

/* ── Layout ── */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 40px;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  align-items: start;
}

/* ── Control Panel ── */
.control-panel {
  position: sticky;
  top: 80px;
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.email-display {
  background: var(--accent-light);
  border: 1.5px dashed var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.2s var(--ease);
  margin-bottom: 18px;
}

.email-display:hover {
  border-style: solid;
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.email-display:active { transform: scale(0.99); }

#emailAddress {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--accent);
  word-break: break-all;
}

.copy-icon { color: var(--text-muted); flex-shrink: 0; }

.copy-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--green);
  color: #fff;
  padding: 4px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease);
}

.copy-toast.show { opacity: 1; }

.controls { display: flex; flex-direction: column; gap: 14px; }

.control-row select {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.15s;
}

.control-row select:focus {
  outline: none;
  border-color: var(--accent);
}

.button-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  font-family: var(--font-sans);
}

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

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(99,102,241,0.35);
}

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

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

.meta-info {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.73rem;
  color: var(--text-muted);
  padding-top: 2px;
}

.meta-info svg { flex-shrink: 0; opacity: 0.7; }

/* ── Inbox ── */
.inbox-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  min-height: 450px;
}

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

.inbox-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
}

.inbox-header-left h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  display: none;
}

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

.poll-status {
  font-size: 0.7rem;
  color: var(--green);
}

.poll-dot {
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── Email List ── */
.email-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.email-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s var(--ease);
  border: 1px solid transparent;
  position: relative;
}

.email-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.email-item.unread {
  background: var(--accent-light);
  border-color: rgba(99,102,241,0.15);
}

.email-item.unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.email-item-content { min-width: 0; }

.email-item-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}

.email-from {
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.email-subject {
  font-size: 0.82rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-expand-icon {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: transform 0.25s var(--ease);
  flex-shrink: 0;
  align-self: center;
  margin-top: 4px;
}

.email-item.expanded .email-expand-icon { transform: rotate(180deg); }

/* ── Email Detail (inline) ── */
.email-detail {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.4s var(--ease), opacity 0.25s var(--ease);
  opacity: 0;
}

.email-detail.expanded {
  max-height: 2000px;
  opacity: 1;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.detail-subject {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 14px;
  color: var(--text);
  line-height: 1.4;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.detail-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

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

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

.email-body { font-size: 0.9rem; line-height: 1.7; }

.email-body iframe {
  width: 100%;
  min-height: 400px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}

.email-body pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-sans);
  color: var(--text);
  line-height: 1.75;
  padding: 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
}

.email-body .no-content {
  color: var(--text-muted);
  font-style: italic;
}

/* ── Empty State ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
}

.empty-state svg { color: var(--text-muted); }

.empty-state p {
  margin-top: 16px;
  font-size: 0.95rem;
  color: var(--text-dim);
  font-weight: 500;
}

.empty-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── SEO Content Section ── */
.seo-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

.seo-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 40px;
  box-shadow: var(--shadow);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.feature-card {
  text-align: center;
  padding: 24px 20px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.feature-card:hover { background: var(--bg-surface); }

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 14px;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.content-block {
  max-width: 720px;
  margin: 0 auto 48px;
}

.content-block h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.content-block p {
  font-size: 0.92rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 16px;
}

.content-block ul {
  list-style: none;
  padding: 0;
}

.content-block ul li {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.7;
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
}

.content-block ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.content-block ul li strong {
  color: var(--text);
}

.faq-block {
  max-width: 720px;
  margin: 0 auto;
}

.faq-block h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text);
}

.faq-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

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

.faq-item h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.faq-item p {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.65;
}

/* ── Footer ── */
footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  text-align: center;
}

.footer-inner p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-inner a {
  color: var(--accent);
  text-decoration: none;
}

.footer-inner a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 768px) {
  main {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }

  .control-panel { position: static; }

  header { padding: 0 16px; }

  .header-tag { display: none; }

  .inbox-panel { min-height: 350px; }

  .seo-section { padding: 0 16px 40px; }

  .seo-inner { padding: 32px 20px; }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 36px;
    padding-bottom: 32px;
  }

  .feature-card {
    display: grid;
    grid-template-columns: auto 1fr;
    text-align: left;
    gap: 14px;
    align-items: center;
    padding: 16px;
  }

  .feature-card .feature-icon {
    margin-bottom: 0;
    width: 44px;
    height: 44px;
    border-radius: 10px;
  }

  .feature-card h3 { margin-bottom: 4px; }
}
