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

:root {
  --gold-primary: #D4AF37;
  --gold-light: #F3E5AB;
  --gold-dark: #AA7C11;
  --gold-glow: rgba(212, 175, 55, 0.35);
  --gold-subtle: rgba(212, 175, 55, 0.12);
  --bg-black: #060606;
  --card-bg: #101010;
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-gold: rgba(212, 175, 55, 0.35);
  --sidebar-width: 250px;
}

body {
  background-color: #060606;
  color: #e5e5e5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

/* Custom Scrollbar Luxuosa - Ouro Metálico Refinado */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: #080808;
}
::-webkit-scrollbar-thumb {
  background: #222222;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
::-webkit-scrollbar-thumb:hover {
  background: #D4AF37;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

/* Utilitário para ocultar scrollbars preservando rolagem suave */
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Painéis e cards escuros de alta costura */
.esoteric-card {
  background-color: #101010;
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, border-color, box-shadow;
}

.esoteric-card-hover {
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.esoteric-card-hover:hover {
  transform: translateY(-2px);
  border-color: rgba(212, 175, 55, 0.45);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.8),
              0 0 25px rgba(212, 175, 55, 0.16);
}

/* Animações e Transições 60FPS */
.animate-fade-in {
  animation: cupulaFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes cupulaFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-up {
  animation: cupulaSlideUp 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes cupulaSlideUp {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Efeito Gradiente Dourado Nobre */
.gold-gradient-text {
  background: linear-gradient(135deg, #F3E5AB 0%, #D4AF37 50%, #AA7C11 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gold-gradient-bg {
  background: linear-gradient(135deg, #F3E5AB 0%, #D4AF37 50%, #AA7C11 100%);
}

.gold-border-glow {
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.25), inset 0 0 12px rgba(212, 175, 55, 0.08);
}

/* Ondas sonoras do player de áudio (60fps pura) */
.wave-bar {
  display: inline-block;
  width: 3px;
  height: 14px;
  background-color: #D4AF37;
  margin: 0 1.5px;
  border-radius: 2px;
  animation: soundWave 1.2s infinite ease-in-out;
  transform-origin: bottom center;
}
.wave-bar:nth-child(1) { animation-delay: 0.08s; }
.wave-bar:nth-child(2) { animation-delay: 0.28s; }
.wave-bar:nth-child(3) { animation-delay: 0.18s; }
.wave-bar:nth-child(4) { animation-delay: 0.42s; }
.wave-bar:nth-child(5) { animation-delay: 0.12s; }

@keyframes soundWave {
  0%, 100% {
    height: 6px;
    opacity: 0.35;
    background-color: rgba(212, 175, 55, 0.5);
  }
  50% {
    height: 22px;
    opacity: 1;
    background-color: #F3E5AB;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.7);
  }
}

/* Estado inativo do player */
.wave-paused .wave-bar {
  animation: none !important;
  height: 6px !important;
  opacity: 0.3 !important;
  background-color: #666666 !important;
  box-shadow: none !important;
}

/* Toasts e Modais */
.hidden {
  display: none !important;
}

#readerModal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10000 !important;
  background-color: #060606 !important;
}

#bookModal {
  z-index: 9990 !important;
}

#vipLoginGate {
  z-index: 20000 !important;
}

/* Leitor PDF Nativo Estilo Livro Real */
#readerNativeContainer {
  display: block !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

.pdf-page-wrapper {
  display: block !important;
  position: relative !important;
  width: 100% !important;
  max-width: 850px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: 1.5rem !important;
  margin-bottom: 1.5rem !important;
  background-color: #ffffff !important;
  color: #111111 !important;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.85) !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.pdf-page-wrapper canvas {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  background-color: #ffffff !important;
}

/* Touch feedback mobile nativo */
@media (hover: none) and (pointer: coarse) {
  button:active, a:active, .cursor-pointer:active {
    opacity: 0.75;
    transform: scale(0.975);
    transition: transform 0.1s ease, opacity 0.1s ease;
  }
}
