@import "tailwindcss";

@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 0 0% 0%;
    --card: 0 0% 100%;
    --card-foreground: 0 0% 0%;
    --popover: 0 0% 100%;
    --popover-foreground: 0 0% 0%;
    --primary: 0 0% 0%;
    --primary-foreground: 0 0% 100%;
    --secondary: 0 0% 97%;
    --secondary-foreground: 0 0% 0%;
    --muted: 0 0% 96%;
    --muted-foreground: 0 0% 45%;
    --accent: 0 0% 94%;
    --accent-foreground: 0 0% 0%;
    --destructive: 0 0% 0%;
    --destructive-foreground: 0 0% 100%;
    --border: 0 0% 89%;
    --input: 0 0% 89%;
    --ring: 0 0% 60%;
    --radius: 0.125rem;
  }

  .dark {
    --background: 0 0% 3%;
    --foreground: 0 0% 98%;
    --card: 0 0% 3%;
    --card-foreground: 0 0% 98%;
    --popover: 0 0% 3%;
    --popover-foreground: 0 0% 98%;
    --primary: 0 0% 98%;
    --primary-foreground: 0 0% 3%;
    --secondary: 0 0% 8%;
    --secondary-foreground: 0 0% 98%;
    --muted: 0 0% 8%;
    --muted-foreground: 0 0% 63%;
    --accent: 0 0% 15%;
    --accent-foreground: 0 0% 98%;
    --destructive: 0 0% 98%;
    --destructive-foreground: 0 0% 3%;
    --border: 0 0% 15%;
    --input: 0 0% 15%;
    --ring: 0 0% 40%;
  }
}

@layer base {
  * {
    border-color: hsl(var(--border));
  }
  body {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    font-size: 14px;
    line-height: 1.5;
  }
}

@layer utilities {
  .border-thin {
    border-width: 1px;
  }
  .text-xs-tight {
    font-size: 11px;
    line-height: 1.2;
  }
  .mono-button {
    background: hsl(var(--foreground));
    color: hsl(var(--background));
    border: 1px solid hsl(var(--foreground));
    transition: all 0.2s;
  }
  .mono-button:hover {
    background: hsl(var(--background));
    color: hsl(var(--foreground));
  }
  .mono-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
  }
  .mono-input {
    border: 1px solid hsl(var(--border));
    background: hsl(var(--background));
    color: hsl(var(--foreground));
  }
  .mono-input:focus {
    border-color: hsl(var(--foreground));
    outline: none;
  }
}

/* Custom styles for email HTML content */
@layer components {
  .email-content {
    width: 100%;
    min-height: 200px;
    overflow: auto;
  }

  .email-content iframe {
    border: none;
    width: 100%;
    min-height: 400px;
  }

  /* For non-iframe HTML rendering */
  .email-content-direct {
    color: rgb(55 65 81);
    font-size: 0.875rem;
    line-height: 1.7142857;
  }

  .email-content-direct > :first-child {
    margin-top: 0;
  }

  .email-content-direct > :last-child {
    margin-bottom: 0;
  }

  /* Ensure email HTML renders properly */
  .email-content-direct img {
    max-width: 100% !important;
    height: auto !important;
  }

  .email-content-direct table {
    border-collapse: collapse;
  }

  .email-content-direct table td,
  .email-content-direct table th {
    padding: 0.5rem;
  }

  .email-content a {
    color: rgb(37 99 235);
    text-decoration: underline;
  }

  .email-content a:hover {
    color: rgb(29 78 216);
  }

  .email-content p {
    margin: 0.5rem 0;
  }

  .email-content h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0.75rem 0;
    line-height: 1.3;
  }

  .email-content h2 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0.5rem 0;
    line-height: 1.4;
  }

  .email-content h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0.5rem 0;
    line-height: 1.5;
  }

  .email-content h4,
  .email-content h5,
  .email-content h6 {
    font-weight: 600;
    margin: 0.5rem 0;
  }

  .email-content ul,
  .email-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
  }

  .email-content ul {
    list-style-type: disc;
  }

  .email-content ol {
    list-style-type: decimal;
  }

  .email-content li {
    margin: 0.25rem 0;
  }

  .email-content blockquote {
    border-left: 4px solid rgb(209 213 219);
    padding-left: 1rem;
    margin: 0.5rem 0;
    font-style: italic;
    color: rgb(107 114 128);
  }

  .email-content code {
    background-color: rgb(243 244 246);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  }

  .email-content pre {
    background-color: rgb(243 244 246);
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin: 0.5rem 0;
    overflow-x: auto;
  }

  .email-content pre code {
    background-color: transparent;
    padding: 0;
    font-size: 0.875rem;
  }

  .email-content strong,
  .email-content b {
    font-weight: 600;
  }

  .email-content em,
  .email-content i {
    font-style: italic;
  }

  .email-content hr {
    border: 0;
    border-top: 1px solid rgb(229 231 235);
    margin: 1rem 0;
  }
}