/* Email content styling */
.email-content {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  color: #333;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.email-content blockquote {
  border-left: 3px solid #e2e8f0;
  padding-left: 1rem;
  margin-left: 0;
  color: #4a5568;
  font-style: italic;
}

.email-content img {
  max-width: 100%;
  height: auto;
}

.email-content a {
  color: #2563eb;
  text-decoration: underline;
}

.email-content a:hover {
  text-decoration: none;
}

/* Responsive table styling */
.email-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.email-content th, 
.email-content td {
  border: 1px solid #e2e8f0;
  padding: 0.5rem;
}

.email-content th {
  background-color: #f8fafc;
  font-weight: 600;
  text-align: left;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  .email-content {
    color: #e2e8f0;
  }
  
  .email-content blockquote {
    border-left-color: #4a5568;
    color: #a0aec0;
  }
  
  .email-content a {
    color: #3b82f6;
  }
  
  .email-content th {
    background-color: #1e293b;
  }
  
  .email-content th,
  .email-content td {
    border-color: #4a5568;
  }
}

/* Forwarded email styling */
.email-content div:has(> blockquote) {
  margin: 1rem 0;
}

/* Email headers (From, To, etc.) */
.email-content div:has(+ blockquote):not(:first-child) {
  color: #64748b;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

@media (prefers-color-scheme: dark) {
  .email-content div:has(+ blockquote):not(:first-child) {
    color: #94a3b8;
  }
}