/* Enhanced Mini-Reddit Custom Styles */

/* Smooth transitions for all interactive elements */
* {
  transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* Enhanced focus states for accessibility */
:focus-visible {
  outline: 2px solid #ea580c;
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* Better text rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Enhanced scrollbar styling */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

.dark ::-webkit-scrollbar-track {
  background: #1f2937;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 5px;
}

.dark ::-webkit-scrollbar-thumb {
  background: #4b5563;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* Enhanced loading states */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.loading {
  animation: shimmer 2s infinite;
  background: linear-gradient(to right, #f3f4f6 4%, #e5e7eb 25%, #f3f4f6 36%);
  background-size: 1000px 100%;
}

.dark .loading {
  background: linear-gradient(to right, #1f2937 4%, #374151 25%, #1f2937 36%);
}

/* Enhanced post cards with better hover effects */
article:hover {
  transform: translateY(-2px);
}

/* Better image loading */
img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Enhanced button styles */
button:active {
  transform: scale(0.98);
}

/* Better form input focus states */
input:focus,
textarea:focus,
select:focus {
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.1);
}

/* Enhanced link hover effects */
a {
  position: relative;
}

a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: currentColor;
  transition: width 0.3s ease;
}

a:hover::after {
  width: 100%;
}

/* Remove underline animation for specific elements */
.no-underline-animation::after,
button a::after,
header a::after {
  display: none;
}

/* Enhanced dark mode transitions */
.dark * {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Better code block styling */
pre {
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.dark pre {
  border-color: #374151;
}

/* Enhanced quote blocks */
blockquote {
  box-shadow: 0 1px 2px rgba(234, 88, 12, 0.1);
}

/* Better table styling */
table {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Enhanced comment threading */
.comment-depth-0,
.comment-depth-1,
.comment-depth-2,
.comment-depth-3,
.comment-depth-4,
.comment-depth-5 {
  transition: all 0.2s ease;
}

.comment-depth-0:hover {
  background: #f3f4f6;
}

.dark .comment-depth-0:hover {
  background: #1f2937;
}

/* Better mobile experience */
@media (max-width: 640px) {
  /* Reduce motion for mobile devices */
  * {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
  
  /* Improve tap targets */
  button,
  a,
  input,
  select {
    min-height: 44px;
  }
}

/* Print styles */
@media print {
  header,
  footer,
  button,
  .no-print {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  article {
    page-break-inside: avoid;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  * {
    border-width: 2px;
  }
}
