/* -------------------------------------------------------------------------- */
/* Temp Mail — Minimalist Light Mode & Soft Green Design System               */
/* -------------------------------------------------------------------------- */

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

:root {
  /* Color Palette - Clean Light Mode + Soft Green */
  --bg-app: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --bg-hover: #F8FAFC;
  
  --border-light: #E2E8F0;
  --border-subtle: #CBD5E1;
  
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-dim: #94A3B8;
  
  /* Primary Soft Green System */
  --green-primary: #10B981;
  --green-dark: #059669;
  --green-darker: #047857;
  --green-soft: #ECFDF5;
  --green-border: #A7F3D0;
  --green-text: #065F46;
  --green-glow: rgba(16, 185, 129, 0.16);

  /* Danger System */
  --red-primary: #EF4444;
  --red-soft: #FEF2F2;
  --red-border: #FECACA;
  --red-text: #991B1B;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;

  /* Geometry & Elevation */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-subtle: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  --shadow-dropdown: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);

  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Background Ambient Lighting */
.background-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.6;
}

.blob-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(167, 243, 208, 0.35) 0%, rgba(236, 253, 245, 0) 70%);
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
}

.blob-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(209, 250, 229, 0.25) 0%, rgba(236, 253, 245, 0) 70%);
  bottom: -100px;
  right: -50px;
}

/* Main Container */
.app {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

/* -------------------------------------------------------------------------- */
/* Header                                                                     */
/* -------------------------------------------------------------------------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

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

.brand-icon {
  width: 40px;
  height: 40px;
  background: var(--green-soft);
  color: var(--green-primary);
  border: 1px solid var(--green-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-subtle);
}

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

.brand-text h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  background: var(--green-soft);
  color: var(--green-text);
  border: 1px solid var(--green-border);
  border-radius: var(--radius-full);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-primary);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.sync-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-primary);
}

/* -------------------------------------------------------------------------- */
/* Address Hero Card                                                          */
/* -------------------------------------------------------------------------- */
.address-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
  transition: border-color var(--transition);
}

.address-card:hover {
  border-color: var(--border-subtle);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.inbox-count-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--green-text);
  background: var(--green-soft);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.address-display-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 8px 8px 16px;
  margin-bottom: 18px;
  gap: 12px;
}

.address-text-wrapper {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.address-text {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.02em;
  user-select: all;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green-primary);
  color: #FFFFFF;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
  flex-shrink: 0;
}

.btn-copy:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.btn-copy:active {
  transform: translateY(0) scale(0.98);
}

/* Toolbar Buttons */
.card-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-action:hover {
  background: var(--bg-subtle);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.btn-action:active {
  transform: scale(0.98);
}

.btn-action.primary {
  background: var(--green-soft);
  color: var(--green-text);
  border-color: var(--green-border);
}

.btn-action.primary:hover {
  background: #D1FAE5;
  border-color: #6EE7B7;
}

.btn-action.danger {
  color: var(--red-text);
  background: var(--bg-surface);
}

.btn-action.danger:hover {
  background: var(--red-soft);
  border-color: var(--red-border);
}

.btn-action.text-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
}

.btn-action.text-btn:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

/* Spinning Animation for Refresh */
.spin-icon.spinning {
  animation: spinClockwise 700ms linear infinite;
}

@keyframes spinClockwise {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Multi-inbox Selector */
.inbox-switcher {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.select-wrapper {
  flex: 1;
}

.inbox-switcher select {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--text-main);
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}

.inbox-switcher select:focus {
  border-color: var(--green-primary);
}

/* Custom Drawer */
.custom-drawer {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  animation: drawerSlide 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-drawer.hidden {
  display: none;
}

@keyframes drawerSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.input-group input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text-main);
  outline: none;
  transition: all var(--transition);
}

.input-group input:focus {
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.domain-dropdown {
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

.drawer-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* -------------------------------------------------------------------------- */
/* Messages Section                                                           */
/* -------------------------------------------------------------------------- */
.messages-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

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

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.message-count-tag {
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.section-meta .status-tip {
  font-size: 12px;
  color: var(--text-dim);
}

/* Message List */
.messages-container {
  min-height: 280px;
}

.message-card {
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
  background: var(--bg-surface);
}

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

.message-card-header {
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.message-card:hover .message-card-header {
  background: #FAFBFB;
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-dark);
  border: 1px solid var(--green-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

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

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

.sender-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-time {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  font-feature-settings: 'tnum';
}

.message-subject {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.message-snippet {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Expanded Message Body */
.message-detail {
  padding: 0 20px 20px 70px;
  display: none;
}

.message-card.expanded .message-detail {
  display: block;
  animation: fadeIn 200ms ease;
}

.message-body-box {
  background: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
}

.message-actions-bar {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.btn-mini {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-mini:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

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

.empty-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--green-soft);
  color: var(--green-primary);
  border: 1px solid var(--green-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.empty-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.5;
}

/* -------------------------------------------------------------------------- */
/* Footer                                                                     */
/* -------------------------------------------------------------------------- */
.app-footer {
  text-align: center;
  margin-top: 40px;
  font-size: 12px;
  color: var(--text-dim);
}

.app-footer p {
  margin-bottom: 4px;
}

.footer-links {
  font-size: 11px;
  color: var(--text-dim);
}

/* -------------------------------------------------------------------------- */
/* Toast Notifications                                                        */
/* -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 18px;
  background: #0F172A;
  color: #FFFFFF;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-dropdown);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastPop 250ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.toast svg {
  color: var(--green-primary);
}

.toast.fadeout {
  opacity: 0;
  transform: translateY(8px) scale(0.95);
  transition: all 200ms ease;
}

@keyframes toastPop {
  from { opacity: 0; transform: translateY(12px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.hidden {
  display: none !important;
}

/* -------------------------------------------------------------------------- */
/* Responsive                                                                 */
/* -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  .app {
    padding: 24px 16px 60px;
  }

  .address-card {
    padding: 18px 14px;
  }

  .card-actions {
    grid-template-columns: repeat(2, 1fr);
  }

  .address-text {
    font-size: 14px;
  }

  .btn-copy {
    padding: 8px 12px;
    font-size: 12px;
  }

  .section-meta {
    display: none;
  }

  .message-detail {
    padding-left: 20px;
  }
}

