/* SuperMail — Base Styles
   ═══════════════════════════════════════════════════════════════════════
   Reset, body, #app shell, login screen, loading state.
   ─────────────────────────────────────────────────────────────────────── */

/* ── Reset ────────────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 13px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Claude-like tracking + OpenType features: cv11 activa 1-storey g,
     ss01 activa altern. tipografica, tabular nums em colunas de data */
  letter-spacing: -0.003em;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  text-rendering: optimizeLegibility;
}

/* ── Scrollbars (Claude-like: thin, subtle, transparent track) ─────────── */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(60, 50, 40, 0.12);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(60, 50, 40, 0.25);
  background-clip: content-box;
  border: 2px solid transparent;
}
*::-webkit-scrollbar-corner { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: rgba(60,50,40,0.15) transparent; }

/* ── App Shell ────────────────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 24px); /* subtract shortcut bar */
  width: 100vw;
  overflow: hidden;
}

/* ── Login Screen ─────────────────────────────────────────────────────── */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--color-bg);
}

.login-card {
  text-align: center;
  padding: 48px;
  background: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  max-width: 400px;
}

.login-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.login-card h1 span { color: var(--color-primary); }
.login-card p { font-size: 13px; color: var(--color-text-muted); margin-bottom: 24px; }

.login-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 32px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition-fast);
}

.login-btn:hover { background: var(--color-primary-hover); }
.login-btn .ms-icon { width: 18px; height: 18px; }

/* ── Loading State ────────────────────────────────────────────────────── */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
}

.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

.loading-text { font-size: 13px; color: var(--color-text-muted); }

/* ── Animations ───────────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes cmdIn {
  from { transform: scale(0.96) translateY(-10px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes toastIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .bucket-name { max-width: 70px; }
  #bucketList .folder-item { padding: 0 8px; }
  .folder-item { padding: 0 10px; }
  .tracking-sidebar.open { width: 0 !important; min-width: 0 !important; }
}

@media (max-width: 768px) {
  .sidebar { overflow-x: auto; }
  .bucket-name, #bucketList { display: none !important; }
  .sidebar-footer span { display: none; }
  .email-list { width: 100%; min-width: 0; }
  .email-reader { display: none; }
  .email-reader.mobile-open {
    display: flex; position: fixed; inset: 0; z-index: 500;
  }
  .shortcut-bar { display: none; }
  #app { height: 100vh; }
}

/* ── Generic ──────────────────────────────────────────────────────────── */
mark { background: #fff3b0; color: inherit; padding: 1px 2px; border-radius: 2px; }
