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

:root {
  --bg: #090d16;
  --card-bg: rgba(17, 24, 39, 0.85);
  --card-border: rgba(255, 255, 255, 0.09);
  --card-glow: rgba(99, 102, 241, 0.2);
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --accent: #a855f7;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
  --input-bg: rgba(15, 23, 42, 0.7);
  --input-border: rgba(255, 255, 255, 0.12);
  --sidebar-w: 240px;
  --steam-blue: #66c0f4;
  --steam-dark: #171a21;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--bg);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.14) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.12) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ================= LOGIN SCREEN (EXACT SWIFTMAIL LAYOUT) ================= */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
}

.top-bar-floating {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 20;
}

.icon-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.icon-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.auth-card-swift {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(99, 102, 241, 0.1);
  animation: cardFadeIn 0.4s ease-out;
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.swift-icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
  box-shadow: 0 6px 22px rgba(99, 102, 241, 0.4);
  position: relative;
}

.store-ghost-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #090d16;
  border: 2px solid #6366f1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.store-ghost-badge img {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #fff;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

.swift-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-label {
  font-size: 13px;
  font-weight: 500;
  color: #e2e8f0;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.swift-input {
  width: 100%;
  height: 42px;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 0 14px;
  font-size: 14px;
  color: #fff;
  outline: none;
  transition: all 0.2s ease;
}

.swift-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
  background-color: rgba(15, 23, 42, 0.85);
}

.swift-input::placeholder {
  color: #475569;
}

.input-action-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.input-action-btn:hover {
  color: #cbd5e1;
}

.swift-btn-submit {
  height: 42px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
  transition: all 0.2s;
  margin-top: 4px;
}

.swift-btn-submit:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.swift-btn-submit:active {
  transform: translateY(0);
}

.swift-card-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
}

.swift-card-footer svg {
  color: var(--primary);
}


/* ================= INBOX SCREEN (EXACT SWIFTMAIL LAYOUT) ================= */
.inbox-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
  background-color: var(--bg);
  overflow: hidden;
}

/* Left Sidebar (Desktop) */
.inbox-sidebar-nav {
  width: var(--sidebar-w);
  background-color: rgba(11, 15, 23, 0.95);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .inbox-sidebar-nav {
    display: none !important;
  }
}

.sidebar-brand {
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.sidebar-brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #fff;
}

.sidebar-menu {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.sidebar-link.active {
  background: rgba(99, 102, 241, 0.12);
  color: #fff;
  font-weight: 600;
}

.sidebar-link-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill-badge {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-profile-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.15s;
}

.user-profile-bar:hover {
  background: rgba(255, 255, 255, 0.04);
}

.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.25);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-email-wrap {
  overflow: hidden;
}

.user-email-name {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  display: block;
}

.user-email-status {
  font-size: 10px;
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
}

.btn-sidebar-action {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-sidebar-action:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.25);
}


/* Middle Column: Email List */
.inbox-list-col {
  width: 360px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: rgba(13, 18, 28, 0.7);
  flex-shrink: 0;
  height: 100%;
}

@media (max-width: 768px) {
  .inbox-list-col {
    width: 100% !important;
  }
  .hide-on-mobile-detail {
    display: none !important;
  }
}

.list-top-bar {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.list-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.list-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.search-box-wrap {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.search-box {
  width: 100%;
  height: 36px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 10px 0 32px;
  font-size: 13px;
  color: #fff;
  outline: none;
  position: relative;
}

.search-icon-pos {
  position: absolute;
  left: 24px;
  top: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.email-items-container {
  flex: 1;
  overflow-y: auto;
}

.email-row {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.email-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.email-row.selected {
  background: rgba(99, 102, 241, 0.1);
  border-left: 3px solid var(--primary);
}

.email-row-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1b2838;
  border: 1px solid #66c0f4;
  color: #66c0f4;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.email-row-body {
  flex: 1;
  min-width: 0;
}

.email-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.email-sender-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  truncate: true;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-time {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.email-row-subject {
  font-size: 12px;
  font-weight: 500;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.email-row-snippet {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.steam-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(102, 192, 244, 0.15);
  color: #66c0f4;
  border: 1px solid rgba(102, 192, 244, 0.3);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: 0.5px;
}


/* Right Column: Reading Detail Pane */
.inbox-detail-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #090d16;
  height: 100%;
  overflow-y: auto;
}

@media (max-width: 768px) {
  .inbox-detail-col.mobile-hidden {
    display: none !important;
  }
}

.detail-top-nav {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.4);
}

.mobile-back-btn {
  display: none;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: #a5b4fc;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 768px) {
  .mobile-back-btn {
    display: inline-flex !important;
  }
}

.detail-subject-header {
  padding: 20px 24px 14px 24px;
  border-bottom: 1px solid var(--border);
}

.detail-subject-text {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
  margin-bottom: 12px;
}

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

.detail-sender-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-sender-info h4 {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.detail-sender-info span {
  font-size: 12px;
  color: var(--text-muted);
}

/* Steam Guard Prominent Hero Banner */
.steam-guard-hero {
  margin: 20px 24px;
  padding: 20px;
  background: linear-gradient(135deg, #171a21 0%, #1c2738 100%);
  border: 1px solid #66c0f4;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5), 0 0 15px rgba(102, 192, 244, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.guard-left-info h5 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #8f98a0;
  margin-bottom: 4px;
}

.guard-big-code {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 6px;
  color: #66c0f4;
  font-family: monospace;
}

.btn-steam-copy {
  background: linear-gradient(135deg, #2a475e 0%, #1b2838 100%);
  border: 1px solid #66c0f4;
  color: #fff;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-steam-copy:hover {
  background: #66c0f4;
  color: #171a21;
}

.detail-content-area {
  padding: 24px;
  flex: 1;
}

/* Empty detail state */
.empty-detail-state {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
  color: var(--text-muted);
}

.empty-detail-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: #64748b;
}

/* Toast Notification */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--primary);
  color: #fff;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.3s ease-out;
}

@keyframes toastIn {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.spin-anim {
  animation: spin 1s linear infinite;
}

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