/* F-Mail CSS - Modern Webmail Interface v4.0 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --c1: #0b1220;
  --c2: #111a2e;
  --c3: #1a2942;
  --c4: #8ea1c3;
  --c5: #c3d0e6;
  --c6: #eaf1ff;

  --primary: #5b8cff;
  --primary-dark: #3f6fe2;
  --primary-light: #8eb2ff;
  --primary-glow: rgba(91, 140, 255, 0.22);
  --on-primary: #f8fbff;

  --bg-dark: var(--c1);
  --bg-card: var(--c2);
  --bg-surface: #15253f;
  --bg-hover: #1d2f4d;
  --bg-active: #253a5c;

  --text-primary: var(--c6);
  --text-secondary: var(--c5);
  --text-muted: var(--c4);

  --border: #273c5d;
  --border-hover: #3b5680;

  --success: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;
  --star: #facc15;
  --radius: 10px;
  --radius-lg: 16px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 2px 8px rgba(3, 8, 18, 0.45);
  --shadow-md: 0 10px 30px rgba(3, 8, 18, 0.55);
  --shadow-lg: 0 24px 60px rgba(3, 8, 18, 0.7);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow: hidden;
}

/* ═══════════════ SCREENS ═══════════════ */
.screen {
  display: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.screen.active {
  display: flex;
  opacity: 1;
}

/* ═══════════════ LOGIN ═══════════════ */
#login-screen {
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 25% 20%, rgba(91, 140, 255, 0.2) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 85%, rgba(26, 41, 66, 0.5) 0%, transparent 60%),
    linear-gradient(180deg, #0d1629 0%, var(--bg-dark) 100%);
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
  animation: fadeSlideUp 0.6s ease;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.login-card {
  background: rgba(17, 26, 46, 0.84);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  border: 1px solid rgba(142, 178, 255, 0.2);
  box-shadow:
    0 0 0 1px rgba(142, 178, 255, 0.08),
    var(--shadow-lg),
    0 0 72px -28px rgba(91, 140, 255, 0.45);
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-header .logo {
  width: 220px;
  max-width: 80%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {

  0%,
  100% {
    filter: drop-shadow(0 4px 16px rgba(91, 140, 255, 0.35));
  }

  50% {
    filter: drop-shadow(0 6px 24px rgba(91, 140, 255, 0.55));
  }
}

.login-header .logo img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.login-header h1 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #f8fbff 20%, var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 4px;
}

.input-group {
  margin-bottom: 18px;
}

.input-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.input-group input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow), 0 0 24px rgba(91, 140, 255, 0.28);
  background: var(--bg-hover);
}

.input-group input::placeholder {
  color: var(--text-muted);
}

/* Chrome autofill background fix */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px var(--bg-surface) inset !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  transition: background-color 5000s ease-in-out 0s;
}

.input-with-suffix {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  overflow: hidden;
}

.input-with-suffix:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow), 0 0 24px rgba(91, 140, 255, 0.28);
  background: var(--bg-hover);
}

.input-with-suffix input {
  flex: 1;
  border: none !important;
  background: transparent !important;
  min-width: 0;
}

.input-with-suffix input:focus {
  border: none !important;
  outline: none;
}

.input-suffix {
  padding: 0 12px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
  user-select: none;
  flex-shrink: 0;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--on-primary);
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 65%);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(91, 140, 255, 0.42);
}

.btn-primary:hover::after {
  opacity: 1;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  padding: 10px 20px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.error-message {
  color: var(--danger);
  font-size: 13px;
  margin-top: 14px;
  text-align: center;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(195, 208, 230, 0.3);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ═══════════════ MAIL LAYOUT ═══════════════ */
#mail-screen {
  height: 100vh;
  width: 100vw;
}

/* ═══════════════ SIDEBAR ═══════════════ */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  z-index: 10;
}

/* Sidebar Overlay (hidden by default, used on mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  z-index: 35;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.sidebar-overlay.active {
  display: block;
}

.sidebar-header {
  padding: 18px 18px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header .logo-small {
  width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-header .logo-small img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(91, 140, 255, 0.3));
}

.sidebar-header span {
  font-weight: 700;
  font-size: 17px;
  background: linear-gradient(135deg, #f8fbff, var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn-compose {
  margin: 16px 14px 8px;
  padding: 11px 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--on-primary);
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
  font-family: inherit;
  box-shadow: 0 8px 20px rgba(91, 140, 255, 0.3);
}

.btn-compose:hover {
  box-shadow: 0 10px 28px rgba(91, 140, 255, 0.4);
  transform: translateY(-1px);
}

.btn-compose svg {
  width: 16px;
  height: 16px;
}

.mailbox-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
}

.mailbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  position: relative;
  margin-bottom: 2px;
}

.mailbox-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: translateX(2px);
}

.mailbox-item.active {
  background: var(--primary-glow);
  color: var(--primary-light);
  font-weight: 600;
}

.mailbox-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
  animation: slideInLeft 0.2s ease;
}

@keyframes slideInLeft {
  from {
    transform: scaleY(0);
  }

  to {
    transform: scaleY(1);
  }
}

.mailbox-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.mailbox-item .name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mailbox-item .count {
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.mailbox-item .count.scheduled-count {
  background: var(--warning);
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 14px;
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-email {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  font-size: 12px;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.06);
  color: var(--danger);
}

.btn-logout svg {
  width: 15px;
  height: 15px;
}

/* ═══════════════ EMPTY TRASH ═══════════════ */
.btn-empty-trash {
  margin: 4px 14px 8px;
  padding: 8px 14px;
  background: rgba(239, 68, 68, 0.06);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.12);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  display: none;
  text-align: center;
}

.btn-empty-trash:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.2);
}

.btn-empty-trash.visible {
  display: block;
}

/* ═══════════════ EMAIL LIST ═══════════════ */
.email-list-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  min-width: 340px;
  max-width: 440px;
  background: var(--bg-dark);
}

.email-list-header {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  min-height: 52px;
}

.email-list-header h2 {
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ═══════════════ SELECTION TOOLBAR ═══════════════ */
.selection-toolbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: var(--primary-glow);
  border-bottom: 1px solid rgba(142, 178, 255, 0.25);
  animation: slideDown 0.2s ease;
}

.selection-toolbar.visible {
  display: flex;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.selection-toolbar span {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-light);
}

.selection-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.btn-selection {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn-selection:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-selection.restore {
  color: var(--success);
  border-color: rgba(142, 178, 255, 0.3);
}

.btn-selection.restore:hover {
  background: rgba(91, 140, 255, 0.18);
}

.btn-selection svg {
  width: 14px;
  height: 14px;
}

/* ═══════════════ SEARCH ═══════════════ */
.search-box {
  flex: 1;
  position: relative;
  min-width: 0;
  max-width: 240px;
}

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-hover);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

/* ═══════════════ ICON / ACTION BUTTONS ═══════════════ */
.btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-icon:active {
  transform: scale(0.92);
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}

.btn-action {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-action:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-action:active {
  transform: scale(0.92);
}

.btn-action.danger:hover {
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.15);
}

.btn-action.restore-action:hover {
  background: rgba(91, 140, 255, 0.12);
  color: var(--success);
  border-color: rgba(142, 178, 255, 0.28);
}

.btn-action svg {
  width: 16px;
  height: 16px;
}

/* ═══════════════ BACK BUTTON ═══════════════ */
.btn-back {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  font-size: 13px;
}

.btn-back:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-back svg {
  width: 16px;
  height: 16px;
}

/* ═══════════════ EMAIL LIST ITEMS ═══════════════ */
.email-list {
  flex: 1;
  overflow-y: auto;
}

.email-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 12px 10px 12px 6px;
  border-bottom: 1px solid rgba(142, 178, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.email-item:hover {
  background: var(--bg-hover);
}

.email-item.active {
  background: var(--bg-active);
}

.email-item.selected {
  background: rgba(91, 140, 255, 0.14);
  border-left: 3px solid var(--primary-light);
}

.email-item.unread {
  border-left: 3px solid var(--primary);
  background: rgba(91, 140, 255, 0.08);
}

.email-item.unread .email-sender {
  font-weight: 700;
  color: var(--text-primary);
}

.email-item.unread .email-subject {
  font-weight: 600;
  color: var(--text-primary);
}

.email-item-content {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

/* ═══════════════ EMAIL CHECKBOX ═══════════════ */
.email-checkbox-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  cursor: pointer;
  flex-shrink: 0;
}

.email-checkbox {
  display: none;
}

.email-checkbox-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-hover);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  position: relative;
}

.email-checkbox-custom::after {
  content: '';
  width: 10px;
  height: 6px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) scale(0);
  transition: transform 0.15s ease;
  margin-top: -2px;
}

.email-checkbox:checked+.email-checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
}

.email-checkbox:checked+.email-checkbox-custom::after {
  transform: rotate(-45deg) scale(1);
}

.email-checkbox-wrapper:hover .email-checkbox-custom {
  border-color: var(--primary-light);
}

/* ═══════════════ EMAIL ITEM CONTENT ═══════════════ */
.email-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--on-primary);
  box-shadow: 0 4px 12px rgba(91, 140, 255, 0.32);
}

.email-content {
  flex: 1;
  min-width: 0;
}

.email-sender {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0;
}

.email-sender-addr {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 1px;
}

.email-subject {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.email-preview {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.email-date {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.email-star {
  width: 20px;
  height: 20px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.email-star:hover {
  color: var(--star);
  transform: scale(1.3);
}

.email-star.starred {
  color: var(--star);
  animation: starPop 0.3s ease;
}

@keyframes starPop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.4);
  }

  100% {
    transform: scale(1);
  }
}

.email-star svg {
  width: 16px;
  height: 16px;
}

.email-loading,
.email-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.email-loading svg,
.email-empty svg {
  width: 48px;
  height: 48px;
  opacity: 0.3;
}

/* ═══════════════ EMAIL DETAIL ═══════════════ */
.email-detail {
  flex: 1;
  display: none;
  flex-direction: column;
  background: var(--bg-dark);
  overflow-y: auto;
  animation: fadeSlideIn 0.3s ease;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.email-detail.active {
  display: flex;
}

.email-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  gap: 8px;
  min-height: 52px;
}

.email-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.email-detail-content {
  padding: 28px;
  flex: 1;
}

.email-detail-subject {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.3;
}

.email-detail-meta {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.email-detail-meta .email-avatar {
  width: 42px;
  height: 42px;
  font-size: 16px;
}

.email-meta-info {
  flex: 1;
}

.email-meta-from {
  font-weight: 600;
  font-size: 14px;
}

.email-meta-from-email {
  font-size: 12px;
  color: var(--primary-light);
  margin-top: 1px;
}

.email-meta-to {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.email-meta-date {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.email-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.email-body a {
  color: var(--primary-light);
  text-decoration: underline;
}

.email-body pre {
  white-space: pre-wrap;
  word-break: break-word;
}

.email-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* ═══════════════ COMPOSE MODAL ═══════════════ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-content {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(142, 178, 255, 0.08);
  width: 90%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.25s ease;
  overflow-y: auto;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.btn-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-close svg {
  width: 18px;
  height: 18px;
}

/* ═══════════════ COMPOSE SCREEN (FULL PAGE) ═══════════════ */
.compose-screen {
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background: var(--bg-dark);
  position: fixed;
  inset: 0;
  z-index: 50;
}

.compose-screen.active {
  display: flex;
  opacity: 1;
}

/* Drag-and-drop overlay */
.compose-screen.drag-over::after {
  content: '📎 Dosyaları buraya bırakın';
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(91, 140, 255, 0.12);
  border: 3px dashed rgba(142, 178, 255, 0.55);
  border-radius: 16px;
  margin: 16px;
  font-size: 20px;
  font-weight: 600;
  color: var(--primary-light);
  pointer-events: none;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.compose-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.compose-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.compose-header-left h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.compose-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.compose-send-btn {
  width: auto !important;
  padding: 10px 24px !important;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.compose-send-btn svg {
  width: 16px;
  height: 16px;
}

.compose-fields {
  flex-shrink: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.compose-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(142, 178, 255, 0.1);
}

.compose-field label {
  font-size: 13px;
  color: var(--text-muted);
  min-width: 50px;
  font-weight: 500;
}

.compose-field input {
  flex: 1;
  padding: 6px 0;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
}

.compose-field input:focus {
  outline: none;
}

.compose-field input::placeholder {
  color: var(--text-muted);
}

/* ═══════════════ RECIPIENT TAGS ═══════════════ */
.recipient-tags-wrapper {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 32px;
}

.recipient-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.recipient-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(91, 140, 255, 0.16);
  border: 1px solid rgba(142, 178, 255, 0.35);
  border-radius: 16px;
  font-size: 12px;
  color: var(--primary-light);
  animation: tagIn 0.2s ease;
}

@keyframes tagIn {
  from {
    opacity: 0;
    transform: scale(0.85);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.recipient-tag button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  border-radius: 50%;
  transition: var(--transition);
}

.recipient-tag button:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.15);
}

.recipient-tags-wrapper input {
  flex: 1;
  min-width: 120px;
  padding: 6px 0;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
}

.recipient-tags-wrapper input:focus {
  outline: none;
}

.recipient-tags-wrapper input::placeholder {
  color: var(--text-muted);
}

/* ═══════════════ COMPOSE ATTACHMENT BAR ═══════════════ */
.compose-attachment-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.btn-attach {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: var(--transition);
}

.btn-attach:hover {
  background: var(--bg-hover);
  color: var(--primary-light);
  border-color: rgba(142, 178, 255, 0.35);
}

.btn-attach svg {
  width: 16px;
  height: 16px;
}

.attachment-count {
  font-size: 12px;
  color: var(--text-muted);
}

/* ═══════════════ ATTACHMENT LIST (Compose) ═══════════════ */
.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px;
  flex-shrink: 0;
}

.attachment-list:empty {
  display: none;
}

.attachment-list:not(:empty) {
  padding: 10px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  animation: tagIn 0.2s ease;
}

.attachment-item.uploading {
  opacity: 0.6;
}

.attachment-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.attachment-name {
  color: var(--text-primary);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-size {
  color: var(--text-muted);
  white-space: nowrap;
}

.attachment-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  border-radius: 4px;
  transition: var(--transition);
}

.attachment-remove:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.15);
}

/* ═══════════════ EMAIL DETAIL ATTACHMENTS ═══════════════ */
.email-attachments {
  margin: 16px 0;
  padding: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.email-attachments-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.email-attachments-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.email-attachment-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 13px;
  transition: var(--transition);
  cursor: pointer;
}

.email-attachment-item:hover {
  background: var(--bg-hover);
  border-color: rgba(142, 178, 255, 0.35);
}

.email-attachment-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.email-attachment-name {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-attachment-size {
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}

.email-attachment-dl {
  width: 14px;
  height: 14px;
  color: var(--primary-light);
  flex-shrink: 0;
  opacity: 0.6;
  transition: var(--transition);
}

.email-attachment-item:hover .email-attachment-dl {
  opacity: 1;
}

.compose-editor-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* TinyMCE Dark Theme Overrides */
.compose-editor-wrapper .tox.tox-tinymce {
  border: none !important;
  border-radius: 0 !important;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.compose-editor-wrapper .tox .tox-editor-header {
  background: var(--bg-card) !important;
  border-bottom: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.compose-editor-wrapper .tox .tox-toolbar,
.compose-editor-wrapper .tox .tox-toolbar__overflow,
.compose-editor-wrapper .tox .tox-toolbar__primary {
  background: var(--bg-card) !important;
  border-bottom: none !important;
}

.compose-editor-wrapper .tox .tox-tbtn {
  color: var(--text-secondary) !important;
  border-radius: 6px !important;
}

.compose-editor-wrapper .tox .tox-tbtn:hover {
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
}

.compose-editor-wrapper .tox .tox-tbtn--enabled,
.compose-editor-wrapper .tox .tox-tbtn--enabled:hover {
  background: rgba(91, 140, 255, 0.22) !important;
  color: var(--primary-light) !important;
}

.compose-editor-wrapper .tox .tox-tbtn svg {
  fill: currentColor !important;
}

.compose-editor-wrapper .tox .tox-edit-area {
  flex: 1;
}

.compose-editor-wrapper .tox .tox-edit-area__iframe {
  background: var(--bg-dark) !important;
}

.compose-editor-wrapper .tox .tox-statusbar {
  background: var(--bg-card) !important;
  border-top: 1px solid var(--border) !important;
  color: var(--text-muted) !important;
}

.compose-editor-wrapper .tox .tox-statusbar__text-container {
  color: var(--text-muted) !important;
}

.compose-editor-wrapper .tox .tox-menubar {
  background: var(--bg-card) !important;
}

.compose-editor-wrapper .tox .tox-split-button:hover {
  box-shadow: none !important;
}

/* Schedule picker inside compose screen */
.compose-screen .schedule-picker {
  margin: 0 20px;
  border-radius: 8px;
}

/* Schedule */
.btn-schedule {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-schedule:hover {
  background: var(--bg-hover);
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.3);
}

.btn-schedule svg {
  width: 16px;
  height: 16px;
}

.schedule-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  animation: slideDown 0.2s ease;
}

.schedule-picker input[type="datetime-local"] {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
  padding: 4px;
}

.schedule-picker input[type="datetime-local"]:focus {
  outline: none;
}

/* ═══════════════ SCHEDULED ITEMS ═══════════════ */
.scheduled-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}

/* ═══════════════ TOAST ═══════════════ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 400px;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.35s ease;
  border: 1px solid var(--border);
  pointer-events: auto;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.toast-message {
  flex: 1;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(142, 178, 255, 0.16);
}

.toast-progress-bar {
  height: 100%;
  animation: toastProgress 3.5s linear forwards;
}

.toast.success .toast-progress-bar {
  background: var(--success);
}

.toast.error .toast-progress-bar {
  background: var(--danger);
}

.toast.info .toast-progress-bar {
  background: var(--primary);
}

@keyframes toastProgress {
  from {
    width: 100%;
  }

  to {
    width: 0%;
  }
}

.toast.success {
  background: rgba(52, 211, 153, 0.14);
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.32);
}

.toast.error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.15);
}

.toast.info {
  background: rgba(91, 140, 255, 0.14);
  color: var(--primary-light);
  border-color: rgba(142, 178, 255, 0.3);
}

.toast.fadeOut {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* ═══════════════ CONFIRM DIALOG ═══════════════ */
.confirm-dialog {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  align-items: center;
  justify-content: center;
}

.confirm-dialog.active {
  display: flex;
}

.confirm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.confirm-box {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(142, 178, 255, 0.08);
  animation: modalIn 0.25s ease;
}

.confirm-icon {
  font-size: 40px;
  margin-bottom: 16px;
  line-height: 1;
}

.confirm-message {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
  text-align: left;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.confirm-actions .btn-secondary {
  flex: 1;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
}

.confirm-actions .btn-primary {
  flex: 1;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
}

.confirm-btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc3b3b) !important;
}

.confirm-btn-danger:hover {
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4) !important;
  transform: translateY(-1px);
}

/* ═══════════════ SETTINGS ═══════════════ */
.settings-section {
  padding: 20px;
}

.settings-section h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 14px;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(142, 178, 255, 0.1);
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-item label {
  font-size: 14px;
  color: var(--text-primary);
}

.settings-item .desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Toggle switch */
.toggle {
  position: relative;
  width: 42px;
  height: 24px;
  cursor: pointer;
  flex-shrink: 0;
}

.toggle input {
  display: none;
}

.toggle .slider {
  position: absolute;
  inset: 0;
  background: var(--bg-active);
  border-radius: 12px;
  transition: var(--transition);
}

.toggle .slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle input:checked+.slider {
  background: var(--primary);
}

.toggle input:checked+.slider::before {
  transform: translateX(18px);
}

/* ═══════════════ CONFETTI ANIMATION ═══════════════ */
.confetti-particle {
  position: fixed;
  width: 5px;
  height: 5px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 9999;
  animation: confettiPop 0.8s ease-out forwards;
}

@keyframes confettiPop {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.5);
  }
}

/* ═══════════════ SEND SUCCESS ANIMATION ═══════════════ */
.send-success-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: successFadeIn 0.3s ease;
}

.send-success-overlay.fade-out {
  animation: successFadeOut 0.4s ease forwards;
}

@keyframes successFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes successFadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

.send-success-check {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--success), #10b981);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 60px rgba(52, 211, 153, 0.4);
  animation: checkBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes checkBounce {
  0% {
    transform: scale(0);
  }

  60% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

.send-success-check svg {
  width: 40px;
  height: 40px;
  color: white;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: checkDraw 0.4s ease 0.2s forwards;
}

@keyframes checkDraw {
  to {
    stroke-dashoffset: 0;
  }
}

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    width: 280px;
    min-width: 280px;
    height: auto;
    z-index: 40;
    transition: left 0.3s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-card);
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar-header {
    flex-shrink: 0;
  }

  .btn-compose {
    flex-shrink: 0;
  }

  .sidebar .mailbox-list {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .btn-empty-trash {
    flex-shrink: 0;
  }

  .sidebar-divider {
    flex-shrink: 0;
  }

  .sidebar-footer {
    flex-shrink: 0;
    margin-top: auto;
    padding: 10px 14px;
    border-top: 1px solid var(--border);
  }

  .email-list-container {
    min-width: 100%;
    max-width: 100%;
  }

  .email-detail {
    position: fixed;
    inset: 0;
    z-index: 30;
    width: 100vw;
    height: 100vh;
    background: var(--bg-dark);
  }

  .email-detail-content {
    padding: 16px;
  }

  .modal-content {
    width: 95%;
    max-width: none;
    margin: 10px;
  }

  .btn-icon.mobile-only {
    display: flex !important;
  }

  .selection-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .selection-actions {
    width: 100%;
  }

  .compose-actions {
    flex-wrap: wrap;
  }
}

@media (min-width: 769px) {
  .btn-icon.mobile-only {
    display: none !important;
  }
}

/* ═══════════════ SCROLLBAR ═══════════════ */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-active);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* ═══════════════ LOGIN LINKS ═══════════════ */
.login-links {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
}

.login-links a {
  color: var(--primary-light);
  font-size: 12px;
  text-decoration: none;
  transition: var(--transition);
}

.login-links a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ═══════════════ REGISTER / RESET MODALS ═══════════════ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal .modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal .modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: fadeSlideUp 0.3s ease;
}

.modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal .modal-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal .btn-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.modal .btn-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal .btn-close svg {
  width: 18px;
  height: 18px;
}

/* ═══════════════ RESET CODE DISPLAY ═══════════════ */
.reset-code-display {
  text-align: center;
  padding: 12px 0;
}

.reset-code-warning {
  color: var(--warning);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: var(--radius);
}

.reset-code-box {
  font-family: 'Courier New', monospace;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--primary-light);
  background: var(--bg-surface);
  border: 2px dashed var(--primary);
  border-radius: var(--radius);
  padding: 18px;
  margin: 12px 0;
  user-select: all;
}

.info-message {
  margin-top: 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

/* ═══════════════ TOAST ═══════════════ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
  max-width: 90%;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-success {
  background: rgba(52, 211, 153, 0.16);
  color: var(--success);
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.toast-error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.toast-info {
  background: rgba(91, 140, 255, 0.18);
  color: var(--primary-light);
  border: 1px solid rgba(142, 178, 255, 0.35);
}

/* ═══════════════ BUG FIXES ═══════════════ */

/* Hide scrollbar in settings modal while retaining scroll functionality */
#settings-modal .modal-content::-webkit-scrollbar {
  display: none;
}

#settings-modal .modal-content {
  -ms-overflow-style: none;
  /* IE and Edge */
  scrollbar-width: none;
  /* Firefox */
}