/* Mail App - Main Stylesheet */
/* Design System and Component Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Color System (HSL) */
  --background: 0 0% 7%;
  --foreground: 0 0% 95%;
  --card: 0 0% 12%;
  --card-foreground: 0 0% 95%;
  --primary: 0 84% 60%;
  --primary-foreground: 0 0% 98%;
  --secondary: 0 0% 20%;
  --secondary-foreground: 0 0% 95%;
  --muted: 0 0% 15%;
  --muted-foreground: 0 0% 65%;
  --border: 0 0% 20%;
  --input: 0 0% 20%;
  --destructive: 0 84.2% 60.2%;
  --radius: 0.5rem;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, hsl(0 0% 7%) 0%, hsl(0 15% 10%) 100%);
  color: hsl(var(--foreground));
  min-height: 100vh;
  line-height: 1.6;
}

/* Utility Classes */
.text-gradient {
  background: linear-gradient(135deg, hsl(0 84% 60%) 0%, hsl(0 100% 75%) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.glow {
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

/* Layout */
.min-h-screen {
  min-height: 100vh;
}

.max-w-4xl {
  max-width: 56rem;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.flex {
  display: flex;
}

.flex-1 {
  flex: 1;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

.gap-8 {
  gap: 2rem;
}

.grid {
  display: grid;
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Spacing */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }

.pt-4 { padding-top: 1rem; }
.pt-6 { padding-top: 1.5rem; }
.pb-4 { padding-bottom: 1rem; }

.m-2 { margin: 0.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.ml-2 { margin-left: 0.5rem; }
.mr-2 { margin-right: 0.5rem; }

.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* Typography */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }

.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.whitespace-nowrap {
  white-space: nowrap;
}

.whitespace-pre-wrap {
  white-space: pre-wrap;
}

/* Colors */
.text-foreground { color: hsl(var(--foreground)); }
.text-muted-foreground { color: hsl(var(--muted-foreground)); }

/* Borders */
.border { border-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-r { border-right-width: 1px; }
.border-t { border-top-width: 1px; }

.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

/* Overflow */
.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }

/* Sizing */
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.w-64 { width: 16rem; }
.w-full { width: 100%; }

.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }
.h-screen { height: 100vh; }

.min-h-0 { min-height: 0; }
.min-w-0 { min-width: 0; }

.max-w-md { max-width: 28rem; }
.max-w-none { max-width: none; }

/* Positioning */
.relative { position: relative; }
.absolute { position: absolute; }

.top-0 { top: 0; }
.left-0 { left: 0; }
.left-3 { left: 0.75rem; }
.right-3 { right: 0.75rem; }

.transform {
  transform: translate(var(--tw-translate-x, 0), var(--tw-translate-y, 0)) rotate(var(--tw-rotate, 0)) skewX(var(--tw-skew-x, 0)) skewY(var(--tw-skew-y, 0)) scaleX(var(--tw-scale-x, 1)) scaleY(var(--tw-scale-y, 1));
}

.-translate-y-1\/2 {
  --tw-translate-y: -50%;
  transform: translate(var(--tw-translate-x, 0), var(--tw-translate-y, 0));
}

/* Display */
.hidden { display: none; }
.inline-flex { display: inline-flex; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Transitions */
.transition,
.transition-all {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.transition-colors {
  transition-property: color, background-color, border-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.duration-300 { transition-duration: 300ms; }
.duration-500 { transition-duration: 500ms; }

/* Components */

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  border: none;
  transition: all 150ms;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn-primary:hover:not(:disabled) {
  background: hsl(0 84% 55%);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: rgba(239, 68, 68, 0.8);
}

.btn-outline:hover {
  border-color: rgba(239, 68, 68, 0.5);
}

.btn-ghost {
  background: transparent;
  color: hsl(var(--muted-foreground));
}

.btn-ghost:hover {
  background: rgba(239, 68, 68, 0.1);
  color: rgba(239, 68, 68, 0.8);
}

.btn-icon {
  padding: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

/* Card */
.card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(239, 68, 68, 0.2);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: hsl(var(--foreground));
}

.card-description {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.25rem;
}

.card-content {
  padding: 1.5rem;
}

.card:hover {
  border-color: rgba(239, 68, 68, 0.4);
}

/* Input */
.input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius);
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  outline: none;
}

.input:focus {
  border-color: rgba(239, 68, 68, 0.4);
}

.input::placeholder {
  color: hsl(var(--muted-foreground));
}

.input.pl-10 {
  padding-left: 2.5rem;
}

.input.pr-10 {
  padding-right: 2.5rem;
}

/* Textarea */
.textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  outline: none;
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

.textarea.min-h-300 {
  min-height: 300px;
}

.textarea::placeholder {
  color: hsl(var(--muted-foreground));
}

/* Label */
.label {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  display: block;
  margin-bottom: 0.5rem;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(239, 68, 68, 0.2);
  color: rgba(239, 68, 68, 0.9);
}

/* Avatar */
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: rgba(239, 68, 68, 0.2);
  color: rgba(239, 68, 68, 0.8);
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
}

/* Icon */
.icon {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  background: transparent;
}

.icon.fill {
  fill: currentColor;
}

/* Star Toggle Button */
.star-toggle {
  transition: all 150ms;
  background: transparent;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.star-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  color: hsl(var(--muted-foreground));
  transition: all 150ms;
}

.star-toggle:hover svg {
  color: rgb(234, 179, 8);
  fill: rgb(234, 179, 8);
}

.star-toggle[data-starred="true"] svg {
  color: rgb(234, 179, 8);
  fill: rgb(234, 179, 8);
}

/* Sidebar */
.sidebar {
  width: 16rem;
  border-right: 1px solid rgba(239, 68, 68, 0.2);
  display: flex;
  flex-direction: column;
  background: transparent;
  overflow-y: auto;
}

.sidebar-nav {
  flex: 1;
  padding: 0 1rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: all 150ms;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
}

.sidebar-item:hover {
  background: rgba(239, 68, 68, 0.1);
  color: hsl(var(--foreground));
}

.sidebar-item.active {
  background: rgba(239, 68, 68, 0.2);
  color: rgba(239, 68, 68, 0.8);
  font-weight: 500;
}

.brand {
  display: flex;
  align-items: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  text-decoration: none;
  margin-bottom: 1rem;
}

/* Email List Item */
.email-item {
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid hsl(var(--border));
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: all 300ms;
  text-decoration: none;
  display: block;
  color: inherit;
}

.email-item:hover {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(255, 255, 255, 0.04);
}

.email-item.unread {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Attachment */
.attachment {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  cursor: pointer;
  transition: border-color 150ms;
}

.attachment:hover {
  border-color: rgba(239, 68, 68, 0.4);
}

.attachment-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.25rem;
  background: rgba(239, 68, 68, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Folder Nav */
.folder-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: hsl(var(--muted-foreground));
  transition: all 150ms;
  font-size: 0.875rem;
}

.folder-nav-item:hover {
  background: rgba(239, 68, 68, 0.1);
}

.folder-nav-item.active {
  background: rgba(239, 68, 68, 0.2);
  color: rgba(239, 68, 68, 0.8);
}

.folder-nav-item .folder-icon {
  margin-right: 0.75rem;
}

/* Stat Card */
.stat-card {
  padding: 1.5rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(239, 68, 68, 0.2);
  transition: all 300ms;
}

.stat-card:hover {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

.stat-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.5rem;
  background: rgba(239, 68, 68, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Action Card */
.action-card {
  padding: 1.5rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(239, 68, 68, 0.2);
  transition: all 300ms;
  text-decoration: none;
  display: block;
  color: inherit;
}

.action-card:hover {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
  transform: translateY(-2px);
}

.action-icon-wrapper {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.5rem;
  background: rgba(239, 68, 68, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Separator Vertical */
.separator-vertical {
  width: 1px;
  height: 1.5rem;
  background: rgba(239, 68, 68, 0.2);
}

/* Grid System */
.grid {
  display: grid;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Translate */
.-translate-y-1\/2 {
  transform: translateY(-50%);
}

/* Positioning utilities */
.left-3 {
  left: 0.75rem;
}

.top-1\/2 {
  top: 50%;
}

/* Alert Variants */
.alert {
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid;
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: rgb(134, 239, 172);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: rgb(252, 165, 165);
}

.alert-warning {
  background: rgba(234, 179, 8, 0.1);
  border-color: rgba(234, 179, 8, 0.3);
  color: rgb(253, 224, 71);
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: rgb(147, 197, 253);
}

/* Max width utilities */
.max-w-6xl {
  max-width: 72rem;
}

/* Responsive */
@media (min-width: 768px) {
  .md\:block {
    display: block !important;
  }
  .md\:hidden {
    display: none !important;
  }
  .md\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .md\:text-5xl {
    font-size: 3rem;
  }
}

/* Checkbox */
input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

/* Links */
a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: rgba(239, 68, 68, 0.8);
}

/* Prose for email body */
.prose {
  max-width: 65ch;
}

.prose pre {
  font-family: inherit;
  background: transparent;
  border: none;
  padding: 0;
  color: hsl(var(--foreground));
  white-space: pre-wrap;
}

/* Flex wrap */
.flex-wrap {
  flex-wrap: wrap;
}

/* Custom width */
.w-px {
  width: 1px;
}

.h-5-custom {
  height: 1.25rem;
}

/* Opacity */
.opacity-50 {
  opacity: 0.5;
}

/* Min height */
.min-h-300 {
  min-height: 300px;
}

/* Border none */
.border-none {
  border: none;
}

/* Focus ring */
.focus\\:ring-0:focus {
  outline: none;
  box-shadow: none;
}

/* Background transparent */
.bg-transparent {
  background: transparent;
}

/* Resize none */
.resize-none {
  resize: none;
}
