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

html,
body {
  height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background-color: #050505; /* Real Brutalist Background Color */
  font-family: 'Space Mono', 'JetBrains Mono', monospace, sans-serif;
  font-weight: 400;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition:
    filter 0.5s ease,
    transform 0.5s ease; /* Smooth transition for filters and transforms */
}

code {
  font-family:
    source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
}

.prose {
  font-size: 1.05rem !important; /* text-lg */
}

.prose img {
  max-width: 75%; /* Full width on mobile */
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
  /*border: 5px solid #4b5563; !* subtle gray border *!*/
  border-radius: 0.25rem; /* rounded corners */
}

.prose iframe {
  width: 100%; /* Make iframe responsive */
  max-width: 75%; /* Same as images */
  height: auto; /* Adjust height automatically */
  aspect-ratio: 16 / 9; /* Maintain 16:9 aspect ratio */
  display: block;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid #4b5563; /* subtle gray border, same as images */
  border-radius: 0.25rem; /* rounded corners, same as images */
}

@media (min-width: 768px) {
  /* md breakpoint */
  .prose img {
    /*max-width: 55%;*/
    max-height: 600px;
    /*max-width: 100%; !* 25% width on larger screens *!*/
  }
  .prose iframe {
    /*max-width: 55%;*/ /* If we want it smaller on desktop, consistent with images*/
  }
}

/* Styling for inline code blocks */
.prose code.undefined:not(pre > code) {
  background-color: #242424;
}

.prose code:not(pre > code) {
  color: #f87171; /* primary-400 - Reverted color */
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 400; /* Lighter font weight */
}

.prose h1 code,
.prose h2 code,
.prose h3 code,
.prose h4 code,
.prose h5 code,
.prose h6 code {
  padding: 0.1em 0.2em !important;
  font-size: 0.9em !important;
}

:root {
  /*dev card*/
  --color-dev-badge: #0b3e8f;
  --bg-dev-card: rgba(0, 41, 107, 0.3);
  --bg-dev-card-hover: rgba(0, 41, 107, 0.55);
  --title-hover-dev: #81aff4;

  /*rant card*/
  --color-rant-badge: #065f46; /* emerald-800 */
  --bg-rant-card: rgba(6, 95, 70, 0.175);
  --bg-rant-card-hover: rgba(16, 185, 129, 0.275);
  --title-hover-rant: #3cb371;

  /*series card*/
  --color-series-badge: #b5163a; /* rose-600 */
  --bg-series-card: rgba(225, 29, 72, 0.1);
  --bg-series-card-hover: rgba(225, 29, 72, 0.2);
  --title-hover-series: #ff4747;

  /*dnd card*/
  --color-dnd-badge: #aa4465;
  --bg-dnd-card: rgba(170, 68, 101, 0.1);
  --bg-dnd-card-hover: rgba(170, 68, 101, 0.2);
  --title-hover-dnd: #d48090;

  /*gist card*/
  --color-gist-badge: #d97706; /* amber-600 */
  --bg-gist-card: rgba(217, 119, 6, 0.1);
  --bg-gist-card-hover: rgba(217, 119, 6, 0.2);
  --title-hover-gist: #fbbf24; /* amber-400 */

  /*feat card*/
  --color-feat-badge: #6b21a8; /* purple-800 */
  --bg-feat-card: rgba(107, 33, 168, 0.175);
  --bg-feat-card-hover: rgba(126, 34, 206, 0.275);
  --title-hover-feat: #a855f7; /* purple-500 */

  /*ai card*/
  --color-ai-badge: #84cc16; /* lime-500 */
  --bg-ai-card: rgba(132, 204, 22, 0.175);
  --bg-ai-card-hover: rgba(132, 204, 22, 0.275);
  --title-hover-ai: #a3e635; /* lime-400 */

  /*essay card*/
  --color-essay-badge: #4338ca; /* indigo-700 */
  --bg-essay-card: rgba(67, 56, 202, 0.175);
  --bg-essay-card-hover: rgba(99, 102, 241, 0.275);
  --title-hover-essay: #818cf8; /* indigo-400 */

  /*fezccode colors*/
  --fzcdx-background: #ffffff;
  --fzcdx-text-primary: #2d2d2d;
  --fzcdx-text-secondary: #4b5563;
  --fzcdx-primary: #f87171;
  --fzcdx-secondary: #fb923c;
  --fzcdx-accent: #34d399;
  --fzcdx-spanner: #e89b5d;
}

.codex-color {
  color: #ff8fab !important; /* Placeholder color for 'codex' */
}

.separator-color {
  color: #f4acb7 !important; /* Placeholder color for '::' */
}

.logs-color {
  color: #bc4749 !important; /* Placeholder color for 'logs' */
}

.apps-color {
  color: #bc4749 !important; /* Placeholder color for 'logs' */
  /*color: #f5dd90 !important; !* Placeholder color for 'apps' *!*/
}

.single-app-color {
  color: #1167e8 !important; /* Placeholder color for 'single-app' */
  /*color: #A07B90 !important; !* Placeholder color for 'single-app' *!*/
}

/* Hide arrows from number inputs */
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type='number'] {
  -moz-appearance: textfield;
}

@keyframes moveAndFade {
  0% {
    transform: translateY(0);
    opacity: 0.7;
  }
  100% {
    transform: translateY(calc(100% + 50px)); /* Move beyond the bottom edge */
    opacity: 0;
  }
}

@keyframes grid-animation {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 100% 100%;
  }
}

@keyframes bounce-slow {
  0%,
  100% {
    transform: translateY(-25%);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }
  50% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

.animate-bounce-slow {
  animation: bounce-slow 2s infinite;
}

.animated-grid-bg {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
  animation: grid-animation 30s linear infinite;
}

@keyframes progress {
  0% { transform: scaleX(0); }
  50% { transform: scaleX(1); }
  100% { transform: scaleX(0); }
}
.animate-progress {
  animation: progress 1.5s ease-in-out infinite;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.scrollbar-hide {
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

@keyframes barrel-roll {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.do-a-barrel-roll {
  animation: barrel-roll 1s linear;
}

body.invert-mode::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  backdrop-filter: invert(1) hue-rotate(180deg);
  pointer-events: none;
}

@keyframes disco-backdrop {
  0% {
    backdrop-filter: hue-rotate(0deg);
  }
  100% {
    backdrop-filter: hue-rotate(360deg);
  }
}

body.party-mode::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9998;
  backdrop-filter: hue-rotate(0deg);
  pointer-events: none;
  animation: disco-backdrop 2s linear infinite;
}

/* Retro Mode */
html.retro-mode::before {
  content: ' ';
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background:
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
    linear-gradient(
      90deg,
      rgba(255, 0, 0, 0.06),
      rgba(0, 255, 0, 0.02),
      rgba(0, 0, 255, 0.06)
    );
  z-index: 10000;
  background-size:
    100% 2px,
    3px 100%;
  pointer-events: none;
}

html.retro-mode body {
  text-shadow:
    1px 0 2px rgba(255, 0, 0, 0.7),
    -1px 0 2px rgba(0, 255, 255, 0.7);
}

/* Mirror Mode */
html.mirror-mode {
  transform: scaleX(-1);
  height: 100%;
  overflow: hidden;
}

html.mirror-mode body {
  height: 100%;
  overflow: hidden;
}

html.mirror-mode #root {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Noir Mode */
body.noir-mode::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  backdrop-filter: grayscale(100%) contrast(1.2);
  pointer-events: none;
}

/* Terminal Mode (Green Monochrome) */
body.terminal-mode::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  backdrop-filter: sepia(100%) hue-rotate(70deg) saturate(500%) contrast(1.2);
  pointer-events: none;
}

/* Blueprint Mode (Blue Monochrome) */
body.blueprint-mode::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  backdrop-filter: invert(1) sepia(100%) hue-rotate(180deg) saturate(300%)
    brightness(0.9);
  pointer-events: none;
}

/* Sepia Mode */
body.sepia-mode::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  backdrop-filter: sepia(100%);
  pointer-events: none;
}

/* Vaporwave Mode */
body.vaporwave-mode {
  background-color: #2b0f54 !important; /* Deep Purple */
  background-image:
    linear-gradient(rgba(255, 113, 206, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 113, 206, 0.2) 1px, transparent 1px);
  background-size: 40px 40px;
  color: #01cdfe !important; /* Neon Cyan Text */
  text-shadow: 2px 2px 0px rgba(255, 113, 206, 0.4); /* Pink shadow */
  font-family:
    'Brush Script MT', 'Comic Sans MS', monospace !important; /* A E S T H E T I C font choice, or fallback */
}

body.vaporwave-mode * {
  border-color: #ff71ce !important; /* Pink borders */
}

body.vaporwave-mode a {
  color: #ff9dce !important;
  text-shadow: 0 0 8px #ff71ce;
}

body.vaporwave-mode img {
  filter: contrast(1.2) brightness(1.1) hue-rotate(-20deg)
    drop-shadow(4px 4px 0px rgba(255, 113, 206, 0.5));
}

body.vaporwave-mode::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  /* Scanlines */
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* Cyberpunk Mode */
body.cyberpunk-mode {
  background-color: #050505 !important;
  color: #fcee0a !important; /* Cyber Yellow */
  font-family: 'Courier New', Courier, monospace !important;
}

body.cyberpunk-mode * {
  border-color: #00ff9f !important; /* Cyber Green */
  box-shadow: 0 0 2px rgba(0, 255, 159, 0.5);
}

body.cyberpunk-mode a {
  color: #00ff9f !important;
  text-decoration: none;
  border-bottom: 2px solid #00ff9f;
}

body.cyberpunk-mode a:hover {
  background-color: #00ff9f;
  color: #000 !important;
}

body.cyberpunk-mode img {
  filter: grayscale(100%) contrast(1.5) brightness(0.8);
  border: 2px solid #fcee0a !important;
}

/* Game Boy Mode */
body.gameboy-mode {
  background-color: #8bac0f !important; /* Lightest Green */
  color: #0f380f !important; /* Darkest Green */
  font-family: 'Courier New', Courier, monospace !important;
}

body.gameboy-mode * {
  border-color: #306230 !important; /* Dark Green */
  box-shadow: none !important;
}

body.gameboy-mode a {
  color: #306230 !important;
  text-decoration: underline;
}

body.gameboy-mode img {
  filter: grayscale(100%) contrast(1.5) brightness(0.9) sepia(1)
    hue-rotate(50deg) saturate(5);
  mix-blend-mode: multiply;
  image-rendering: pixelated;
}

body.gameboy-mode::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: #8bac0f;
  mix-blend-mode: overlay;
  pointer-events: none;
  opacity: 0.2;
}

/* Comic Book Mode */
body.comic-mode {
  background-color: #ffffff !important;
  background-image: radial-gradient(#e5e5f7 2px, transparent 2px);
  background-size: 10px 10px; /* Halftone dots */
  color: #000000 !important;
  font-family: 'Comic Sans MS', 'Chalkboard SE', monospace !important;
}

body.comic-mode * {
  border: 2px solid #000000 !important;
  box-shadow: 4px 4px 0px #000000 !important;
}

body.comic-mode a {
  color: #ff0000 !important;
  font-weight: bold;
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

body.comic-mode img {
  filter: contrast(1.5) saturate(1.5);
}

/* Sketchbook Mode */
body.sketchbook-mode {
  background-color: #f9f8f2 !important;
  background-image: repeating-linear-gradient(
    #e5e5e5 0 1px,
    transparent 1px 100%
  );
  background-size: 100% 30px;
  color: #333333 !important;
  font-family: 'Segoe Print', 'Bradley Hand', monospace !important;
}

body.sketchbook-mode * {
  border-color: #555555 !important;
  border-style: solid !important;
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px !important; /* Wobbly lines */
}

body.sketchbook-mode a {
  color: #669dd8 !important;
  text-decoration: underline;
  text-decoration-style: wavy;
}

body.sketchbook-mode img {
  filter: grayscale(100%) sepia(30%) contrast(1.2);
  border: 2px solid #333;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
}

/* Hellenic Mode */
body.hellenic-mode {
  background-color: #fdfbf7 !important;
  color: #2c3e50 !important;
  font-family: 'Cinzel', 'Trajan Pro', 'Times New Roman', monospace !important;
  background-image:
    radial-gradient(
      circle at 100% 150%,
      #fdfbf7 24%,
      #f5f3ef 25%,
      #f5f3ef 28%,
      #fdfbf7 29%,
      #fdfbf7 36%,
      #f5f3ef 36%,
      #f5f3ef 40%,
      transparent 40%,
      transparent
    ),
    radial-gradient(
      circle at 0 150%,
      #fdfbf7 24%,
      #f5f3ef 25%,
      #f5f3ef 28%,
      #fdfbf7 29%,
      #fdfbf7 36%,
      #f5f3ef 36%,
      #f5f3ef 40%,
      transparent 40%,
      transparent
    ),
    radial-gradient(
      circle at 50% 100%,
      #f5f3ef 10%,
      #fdfbf7 11%,
      #fdfbf7 23%,
      #f5f3ef 24%,
      #f5f3ef 30%,
      #fdfbf7 31%,
      #fdfbf7 43%,
      #f5f3ef 44%,
      #f5f3ef 50%,
      #fdfbf7 51%,
      #fdfbf7 63%,
      #f5f3ef 64%,
      #f5f3ef 71%,
      transparent 71%,
      transparent
    ),
    radial-gradient(
      circle at 100% 50%,
      #f5f3ef 5%,
      #fdfbf7 6%,
      #fdfbf7 15%,
      #f5f3ef 16%,
      #f5f3ef 20%,
      #fdfbf7 21%,
      #fdfbf7 30%,
      #f5f3ef 31%,
      #f5f3ef 35%,
      #fdfbf7 36%,
      #fdfbf7 45%,
      #f5f3ef 46%,
      #f5f3ef 49%,
      transparent 50%,
      transparent
    ),
    radial-gradient(
      circle at 0 50%,
      #f5f3ef 5%,
      #fdfbf7 6%,
      #fdfbf7 15%,
      #f5f3ef 16%,
      #f5f3ef 20%,
      #fdfbf7 21%,
      #fdfbf7 30%,
      #f5f3ef 31%,
      #f5f3ef 35%,
      #fdfbf7 36%,
      #fdfbf7 45%,
      #f5f3ef 46%,
      #f5f3ef 49%,
      transparent 50%,
      transparent
    );
  background-size: 50px 25px;
}

body.hellenic-mode * {
  border-color: #d4af37 !important;
  box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.1);
}

body.hellenic-mode a {
  color: #005b96 !important;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: bold;
}

body.hellenic-mode img {
  filter: contrast(1.1) sepia(0.2);
  border: 4px double #d4af37 !important;
}

body.hellenic-mode h1,
body.hellenic-mode h2,
body.hellenic-mode h3 {
  color: #005b96 !important;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 1px 1px 0 #d4af37;
}

/* Dystopian Glitch Mode */
body.glitch-mode {
  background-color: #0a0a0a !important;
  color: #dcdcdc !important;
  font-family: 'VT323', 'Courier New', monospace !important;
}

body.glitch-mode::before {
  content: ' ';
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: repeating-linear-gradient(
    transparent 0px,
    transparent 2px,
    #222 3px
  );
  pointer-events: none;
  z-index: 1000;
  opacity: 0.3;
}

body.glitch-mode * {
  border-color: #333 !important;
  box-shadow:
    -2px 0 0 rgba(255, 0, 0, 0.5),
    2px 0 0 rgba(0, 255, 255, 0.5);
}

body.glitch-mode a {
  color: #ff003c !important;
  text-shadow:
    2px 0 #00fff9,
    -2px 0 #ff00c1;
  text-decoration: line-through;
}

body.glitch-mode a:hover {
  text-decoration: none;
  background: #ff003c;
  color: #fff !important;
}

body.glitch-mode img {
  filter: grayscale(100%) contrast(2);
  mix-blend-mode: hard-light;
  clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
}

@keyframes glitch-anim {
  0% {
    transform: translate(0);
  }
  20% {
    transform: translate(-2px, 2px);
  }
  40% {
    transform: translate(-2px, -2px);
  }
  60% {
    transform: translate(2px, 2px);
  }
  80% {
    transform: translate(2px, -2px);
  }
  100% {
    transform: translate(0);
  }
}

body.glitch-mode h1,
body.glitch-mode h2,
body.glitch-mode h3 {
  animation: glitch-anim 2s infinite;
}
