/* Custom styles for Groove Browser */

/* Utility classes */
.h-screen-minus-header {
  height: calc(100vh - 76px);
}

/* Smooth transitions */
* {
  transition-property: color, background-color, border-color, box-shadow;
  transition-duration: 150ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Logo styling */
.logo {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Message body pre-wrap styling */
.prose pre {
  background: none;
  padding: 0;
  margin: 0;
  border: none;
  font-family: inherit;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Message content styling for HTML emails */
.message-content {
  font-family: inherit;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.message-content p {
  margin: 0 0 1em 0;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content div {
  margin: 0.5em 0;
}

.message-content div:first-child {
  margin-top: 0;
}

.message-content div:last-child {
  margin-bottom: 0;
}

.message-content br {
  line-height: 1.6;
}

.message-content blockquote {
  border-left: 4px solid #e5e7eb;
  padding-left: 1rem;
  margin: 1rem 0;
  font-style: italic;
  color: #6b7280;
}

.message-content ul,
.message-content ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

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

.message-content a {
  color: #059669;
  text-decoration: underline;
}

.message-content a:hover {
  color: #047857;
}

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

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

.message-content img {
  max-width: 100%;
  height: auto;
  margin: 0.5rem 0;
}

.message-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
}

.message-content th,
.message-content td {
  border: 1px solid #e5e7eb;
  padding: 0.5rem;
  text-align: left;
}

.message-content th {
  background-color: #f9fafb;
  font-weight: 600;
}

/* Focus states */
input:focus,
select:focus,
button:focus,
[role='button']:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

/* Loading animation */
.animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Custom badge styles */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
}

.badge-red {
  background-color: #fef2f2;
  color: #b91c1c;
}

.badge-yellow {
  background-color: #fffbeb;
  color: #d97706;
}

.badge-green {
  background-color: #f0fdf4;
  color: #16a34a;
}

.badge-blue {
  background-color: #eff6ff;
  color: #2563eb;
}

.badge-gray {
  background-color: #f9fafb;
  color: #374151;
}

/* Card hover effects */
.card-hover {
  transition: all 0.2s ease-in-out;
}

.card-hover:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Message expand/collapse animation */
.message-body {
  transition: max-height 0.3s ease-in-out, opacity 0.2s ease-in-out;
  overflow: hidden;
}

.message-expanded {
  max-height: 1000px;
  opacity: 1;
}

.message-collapsed {
  max-height: 0;
  opacity: 0;
}

/* Line clamping for message previews */
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .h-screen-minus-header {
    height: calc(100vh - 68px);
  }

  aside {
    width: 100%;
    position: fixed;
    top: 68px;
    left: 0;
    z-index: 10;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
  }

  aside.mobile-open {
    transform: translateX(0);
  }

  main {
    width: 100%;
    margin-left: 0;
  }
}

/* Print styles */
@media print {
  header,
  aside,
  .no-print {
    display: none !important;
  }

  main {
    width: 100% !important;
    margin: 0 !important;
    padding: 1rem !important;
  }

  .bg-gray-50,
  .bg-blue-50 {
    background: white !important;
  }

  .border {
    border-color: #ccc !important;
  }
}

/* Accessibility improvements */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .bg-gray-50 {
    background-color: white;
  }

  .border-gray-200 {
    border-color: #000;
  }

  .text-gray-600 {
    color: #000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
