@tailwind base;
@tailwind components;
@tailwind utilities;

.article-width {
  width: 800px;
}

@media (max-width: 800px) {
  .article-width {
    width: 100% !important;
  }
}

/* Tooltip start */

.tooltip-handle {
  position: relative;
}
.tooltip-handle:after {
  content: attr(data-title);
  --tw-bg-opacity: 1;
  background-color: rgba(31, 41, 55, var(--tw-bg-opacity));
  border-radius: 0.25rem;
  font-size: 0.75rem;
  line-height: 1rem;
  margin-top: 0.5rem;
  opacity: 0;
  padding: 0.5rem;
  position: absolute;
  right: 0;
  top: 100%;
  --tw-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
  text-align: right;
  --tw-text-opacity: 1;
  color: rgba(255, 255, 255, var(--tw-text-opacity));
  visibility: hidden;
  white-space: nowrap;
  z-index: 20;
  transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform, filter,
    -webkit-backdrop-filter;
  transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform, filter,
    backdrop-filter;
  transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform, filter,
    backdrop-filter, -webkit-backdrop-filter;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.tooltip-handle.gold-tooltip:after {
  background: linear-gradient(135.06deg, #fcc201 0.05%, #b78628 99.96%);
}
.tooltip-handle:hover::after {
  opacity: 1;
  visibility: visible;
  transition-delay: 1000ms;
}
.tooltip-handle.tooltip-right::after {
  margin-top: 0.5rem;
  margin-left: 0.5rem;
  position: absolute;
  top: 0;
  left: 100%;
  right: auto;
}
.tooltip-handle.tooltip-left-aligned::after {
  left: 0;
  top: 100%;
  right: auto;
}
.tooltip-handle.tooltip-right-aligned::after {
  right: 0;
  top: 100%;
}
.tooltip-handle.tooltip-left::after {
  top: 0;
  right: 100%;
  left: auto;
}
@media (max-width: 1023px) {
  .tooltip-handle:after {
    display: none;
  }
}

/* Tooltip end */

.hn-table {
  display: block;
  width: 100%;
  overflow-x: auto;
  margin-top: 2em;
  margin-bottom: 2em;
}

.prose .hn-table table {
  border: 1px solid #e0e0e0;
  margin-top: 0;
  margin-bottom: 0;
}

.prose .hn-table table tbody td:first-child,
.prose table tbody td:first-child {
  padding-left: 0.5rem;
}

.prose table td > p {
  margin: 0;
  padding: 0;
}

.prose .hn-table table td {
  min-width: 200px;
  padding: 0.5rem;
}

.prose .hn-table table td,
.prose .hn-table table th {
  padding: 0.5rem !important;
}

.container {
  width: 100%;
}

@media (min-width: 640px) {
  .container {
    max-width: 640px;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
}

@media (min-width: 1536px) {
  .container {
    max-width: 1536px;
  }
}

@media (min-width: 1440px) {
  .feed-width {
    min-width: 850px;
    max-width: 1000px;
  }

  .container-wrapper {
    max-width: 1232px;
  }
}

.prose code {
  border-radius: 0.25rem;
  font-weight: 400 !important;
  padding: 0.25rem;
  --tw-text-opacity: 1;
  color: rgba(0, 0, 0, var(--tw-text-opacity));
  font-size: 80%;
  background: #f0efed;
}

.dark .prose code {
  --tw-bg-opacity: 1;
  background-color: rgba(36, 41, 46, var(--tw-bg-opacity));
  --tw-text-opacity: 1;
  color: rgba(238, 238, 238, var(--tw-text-opacity));
}

.prose pre {
  padding-top: 2rem !important;
  padding-bottom: 2rem !important;
}

.prose pre code {
  background-color: transparent;
  border-radius: 0px;
  font-weight: 500 !important;
  padding: 0px;
  font-size: 100%;
  color: #fafafa;
}

.prose blockquote p:first-of-type::before,
.prose blockquote p:last-of-type::after {
  content: none;
}

.dark .prose pre code {
  background-color: transparent;
  color: #ddd;
}

.prose .embed-wrapper {
  max-width: 100%;
  margin-top: 1.25em;
  margin-bottom: 1.25em;
}

.prose .embed-wrapper iframe {
  max-width: 100% !important;
}

li p {
  margin: 0px !important;
}

img.image--center {
  margin-left: auto;
  margin-right: auto;
}

img.image--right {
  margin-left: auto;
  margin-right: 0;
}

/* Permalink styles start */

@layer components {
  .focus-ring-base {
    @apply focus:outline-none focus:ring ring-offset-2;
  }
  /* .focus-ring-colors-dark-header {
    @apply ring-white/80 ring-offset-custom-header;
  } */
  /* .focus-ring-colors-light-header {
    @apply ring-slate-950/80 ring-offset-custom-header;
  } */
  .focus-ring-colors-base {
    @apply ring-blue-600 ring-offset-white dark:ring-offset-slate-800;
  }
}

/* src/styles/globals.css */

/* Add these animations to your global CSS file */

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fade-in 0.6s ease-out;
}

/* Gradient text effect */
.gradient-text {
  background: linear-gradient(to right, #3b82f6, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

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

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Dark mode scrollbar */
.dark ::-webkit-scrollbar-track {
  background: #1f2937;
}

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

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

/* Code block styling */
pre code {
  font-family: 'Fira Code', 'Consolas', 'Monaco', 'Andale Mono', 'Ubuntu Mono', monospace;
  font-variant-ligatures: contextual;
}

/* Hover effects for cards */
.card-hover-effect {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover-effect:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Glass morphism effect */
.glass-effect {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .glass-effect {
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Pulse animation for status indicators */
@keyframes pulse-dot {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  }
  
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(52, 211, 153, 0);
  }
  
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
  }
}

.animate-pulse-dot {
  animation: pulse-dot 2s infinite;
}