@import "tailwindcss";
@custom-variant dark (&:where([data-theme=dark], [data-theme=dark] *));
@plugin "@tailwindcss/typography";

@theme {
  /* Font families */
  --font-sans: "Geist Sans", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
}

::selection {
  background-color: #47a3f3;
  color: #fefefe;
}

/* Dark theme colors */
[data-theme="dark"] {
  background-color: #121212;
}

html {
  min-width: 360px;
}

.prose {
  @apply text-[#333333] dark:text-[#D4D4D4];
}

.prose .anchor {
  @apply absolute invisible no-underline;
  margin-left: -1em;
  padding-right: 0.5em;
  cursor: pointer;
}

.anchor:hover {
  @apply visible;
}

.prose a {
  @apply transition-all decoration-neutral-400 dark:decoration-neutral-600 underline-offset-2 decoration-[0.1em] font-normal text-[#333333] dark:text-[#D4D4D4];
}

.prose a:hover {
  @apply dark:decoration-neutral-400 decoration-neutral-600;
}

.prose .anchor:after {
  @apply text-neutral-300 dark:text-neutral-700;
  content: "#";
}

.prose *:hover > .anchor {
  @apply visible;
}

.prose pre {
  @apply !bg-[#F7F7F7] dark:bg-[#181818] rounded-lg overflow-x-auto;
}

.prose code {
  @apply px-1 py-0.5 rounded-lg;
}

.prose pre code {
  @apply p-0;
  border: initial;
  line-height: 1.5;
}

.prose code span {
  @apply font-medium;
}

.prose img {
  /* Don't apply styles to next/image */
  @apply m-0;
}

.prose h2,
h3,
h4,
h5,
h6 {
  @apply font-medium! tracking-tight!;
}

.prose strong {
  @apply font-medium;
}

.prose > :first-child {
  /* Override removing top margin, causing layout shift */
  margin-top: 1.25em !important;
  margin-bottom: 1.25em !important;
}

pre::-webkit-scrollbar {
  display: none;
}

pre {
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0px 1000px #121212 inset !important; /* match your dark bg */
  box-shadow: 0 0 0px 1000px #121212 inset !important;
  -webkit-text-fill-color: white !important; /* match your text color */
  transition: background-color 5000s ease-in-out 0s;
}

input:focus,
input:invalid {
  outline: none; /* or a custom outline */
  box-shadow: none;
}

/* Standard placeholder */
input:focus::placeholder {
  color: transparent;
  opacity: 0; /* optional, for smoother fade in some browsers */
}

/* WebKit (Safari, Chrome, iOS) */
input:focus::-webkit-input-placeholder {
  color: transparent;
  opacity: 0;
}

/* Firefox */
input:focus::-moz-placeholder {
  color: transparent;
  opacity: 0;
}

/* Microsoft Edge / IE */
input:focus:-ms-input-placeholder {
  color: transparent;
  opacity: 0;
}

/* Remove Safari input shadow on mobile */
input[type="text"],
input[type="email"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.prose .tweet a {
  text-decoration: inherit;
  font-weight: 500;
}

table {
  display: block;
  max-width: fit-content;
  overflow-x: auto;
  white-space: nowrap;
}

.prose .callout > p {
  margin: 0 !important;
}

blockquote p:first-of-type::before {
  content: none;
}

blockquote p:first-of-type::after {
  content: none;
}

.title {
  text-wrap: balance;
}

.hidden {
  display: none;
}

[data-theme="dark"] .astro-code,
[data-theme="dark"] .astro-code span {
  color: var(--shiki-dark) !important;
  background-color: var(--shiki-dark-bg) !important;
  /* Optional, if you also want font styles */
  font-style: var(--shiki-dark-font-style) !important;
  font-weight: var(--shiki-dark-font-weight) !important;
  text-decoration: var(--shiki-dark-text-decoration) !important;
}

/**
Custom
*/

.footer {
  display: grid;
  align-items: end;
}

.header-text, .footer-text {
  font-family: "bebas_neueregular";
}

.footer-text {
  margin-top: 25px;
  bottom: 0%;
}

.btn {
  margin-top: 1.5% !important;
}

.hr {
  transform: rotate(90deg);
}

.alert {
  margin-top: 10%;
  margin-bottom: 1%;
}

#spinner { 
  margin-top: 5%;
  margin-left: 50%;
}

#exclude-checkboxes {
  margin-left: 5.5%;
}

#lyric-search-input {
  margin-right: 1.5%;
  padding-bottom: 1rem;
}

#lyrics-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: bold;
  word-wrap: break-word !important;
  overflow: auto !important;
  margin-bottom: 5px;
}

.lyrics-card {
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  padding: 1.5rem;
  transition: background 0.3s;
}

.lyrics-content {
  line-height: 2.0;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  white-space: pre-wrap;
}

.lyrics-card-dark {
  background-color: oklch(from rgba(18, 18, 18, 2.0) calc(l + 0.05) c h);
}

.lyrics-card-light {
  background-color: oklch(from rgba(255, 255, 255, 2.0) calc(l - 0.02) c h);
}

.random-msg {
  padding-top: 10px;
  max-width: 100%;
  word-wrap: break-word;
  white-space: pre-wrap;
  color: 'inherit';
}

.lyrics-card-copyButton {
  float: right;
  padding-bottom: 3%;
}

.p-autocomplete-items {
  max-height: 200px !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

.p-autocomplete-input {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #ccc;
  transition: border 0.2s;
}
.p-autocomplete-input:focus {
  border-color: #4f46e5;
  outline: none;
}

.d-dark > * {
  background-color: rgba(35, 35, 35, 0.9);
  color: #ffffff;
}
.d-light > * {
  background-color: rgba(255, 255, 255, 0.9);
}

/*
Toastify customizations
*/
.Toastify__toast--error {
  background-color: rgba(255, 0, 0, 0.5) !important;
  color: inherit !important;
}
.Toastify__toast--info {
  background-color: rgba(217, 242, 255, 0.8) !important;
  color: #000 !important;
}

.Toastify__toast--success {
  background-color: rgba(46, 186, 106, 0.8) !important;
  color: inherit !important;
}

.Toastify__toast--success > .Toastify__toast-icon svg {
  display: none;
}

.Toastify__toast--success > .Toastify__toast-icon::after {
  content: "🦄" !important;
}
