/* Drafts Page & Component Styles */

.drafts-page-container {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.drafts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.drafts-header-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drafts-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

.drafts-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.drafts-status-badge.online {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.drafts-status-badge.online .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.drafts-status-badge.offline {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.drafts-status-badge.offline .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

.drafts-compose-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  background: var(--accent);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px var(--accent-glow);
  transition: all 0.2s ease;
}

.drafts-compose-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.drafts-offline-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 0.875rem;
  line-height: 1.4;
}

.drafts-card {
  width: 100%;
  box-sizing: border-box;
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid var(--card-border);
}

.drafts-list {
  display: flex;
  flex-direction: column;
}

.draft-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
  color: inherit;
  gap: 16px;
}

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

.draft-item:hover {
  background-color: var(--thread-card-hover-bg, rgba(255, 255, 255, 0.04));
}

.draft-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.draft-item-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.draft-item-recipients {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.draft-source-badge {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 500;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.draft-source-badge.gmail {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.draft-source-badge.local {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.draft-item-subject-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
}

.draft-item-subject {
  color: var(--text-primary);
  font-weight: 500;
}

.draft-item-dash {
  color: var(--text-secondary);
  opacity: 0.6;
}

.draft-item-snippet {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.draft-item-attachment-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
}

.draft-item-side {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.draft-item-time {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.draft-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.draft-item-actions form {
  margin: 0;
  padding: 0;
  display: inline-flex;
}

.draft-item-discard-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  opacity: 0.6;
}

.draft-item:hover .draft-item-discard-btn {
  opacity: 1;
}

.draft-item-discard-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.drafts-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.drafts-empty-state svg {
  margin-bottom: 16px;
  opacity: 0.4;
  color: var(--text-secondary);
}

.empty-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 6px 0;
}

.empty-subtitle {
  font-size: 0.875rem;
  margin: 0 0 20px 0;
  max-width: 320px;
  line-height: 1.4;
}

.empty-compose-btn {
  margin-top: 4px;
}

@media (max-width: 640px) {
  .draft-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
  }

  .draft-item-side {
    width: 100%;
    justify-content: space-between;
  }

  .draft-item-recipients {
    max-width: 220px;
  }
}
