@import "tailwindcss";
@import "@nuxt/ui";

@tailwind utilities;

/* ========================================================================== */
/* ESTILOS PERSONALIZADOS PARA RIOCATA */
/* ========================================================================== */

/* -------------------------------------------------------------------------- */
/* MODO CLARO: Estilo papel blanco con outlines azules */
/* -------------------------------------------------------------------------- */
@media (prefers-color-scheme: light) {
  :root {
    --cata-bg: #ffffff;
    --cata-fg: #000000;
    --cata-primary: #4682b4; /* Steel Blue */
    --cata-primary-light: #87ceeb; /* Sky Blue */
    --cata-primary-dark: #00008b; /* Dark Blue */
    --cata-border-width: 1px;
    --cata-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  }
}

:root:not(.dark) {
  --cata-bg: #ffffff;
  --cata-fg: #000000;
  --cata-primary: #4682b4;
  --cata-primary-light: #87ceeb;
  --cata-primary-dark: #00008b;
  --cata-border-width: 1px;
  --cata-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* -------------------------------------------------------------------------- */
/* MODO OSCURO: Estilo terminal verde antiguo */
/* -------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --cata-bg: #000000;
    --cata-fg: #00ff00; /* Terminal Green */
    --cata-primary: #00ff00; /* Terminal Green */
    --cata-primary-light: #00cc00; /* Medium Green */
    --cata-primary-dark: #009900; /* Dark Green */
    --cata-border-width: 0.75px;
    --cata-font-family: 'Courier New', Courier, 'Lucida Console', Monaco, monospace;
  }
}

:root.dark {
  --cata-bg: #000000;
  --cata-fg: #00ff00;
  --cata-primary: #00ff00;
  --cata-primary-light: #00cc00;
  --cata-primary-dark: #009900;
  --cata-border-width: 0.75px;
  --cata-font-family: 'Courier New', Courier, 'Lucida Console', Monaco, monospace;
}

/* -------------------------------------------------------------------------- */
/* UTILIDADES GLOBALES */
/* -------------------------------------------------------------------------- */

/* Outline containers sin fondo relleno */
.cata-outline-box {
  background-color: transparent;
  border: var(--cata-border-width) solid var(--cata-primary);
  border-color: color-mix(in srgb, var(--cata-primary) 50%, transparent);
}

.dark .cata-outline-box {
  border-color: color-mix(in srgb, var(--cata-primary) 70%, transparent);
}

/* Líneas delgadas horizontales */
.cata-divider {
  width: 100%;
  height: 1px;
  background-color: color-mix(in srgb, var(--cata-primary) 30%, transparent);
  border: none;
}

.dark .cata-divider {
  background-color: color-mix(in srgb, var(--cata-primary) 50%, transparent);
}

/* Texto con estilo terminal en modo oscuro */
.cata-text {
  color: var(--cata-fg);
  font-family: var(--cata-font-family);
}

.dark .cata-text {
  text-shadow: 0 0 2px currentColor;
  font-weight: 300;
  letter-spacing: 0.02em;
}

/* -------------------------------------------------------------------------- */
/* COMPONENTES ESPECÍFICOS */
/* -------------------------------------------------------------------------- */

/* Páginas de catación: fondo completo */
.cata-page {
  min-height: 100vh;
  background-color: var(--cata-bg);
  color: var(--cata-fg);
}

/* Headers de accordions */
.cata-accordion-header {
  background-color: transparent;
  border: var(--cata-border-width) solid var(--cata-primary);
  border-color: color-mix(in srgb, var(--cata-primary) 50%, transparent);
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  transition: all 200ms;
}

.cata-accordion-header:hover {
  background-color: color-mix(in srgb, var(--cata-primary) 5%, transparent);
}

.dark .cata-accordion-header:hover {
  background-color: color-mix(in srgb, var(--cata-primary) 10%, transparent);
}

/* Tabs personalizados */
.cata-tab {
  border-bottom: 2px solid transparent;
  padding: 0.5rem 1rem;
  transition: color 200ms, border-color 200ms, text-shadow 200ms;
  color: color-mix(in srgb, var(--cata-fg) 60%, transparent);
}

.cata-tab:hover:not(.cata-tab-active) {
  color: color-mix(in srgb, var(--cata-fg) 80%, transparent);
  border-bottom-color: color-mix(in srgb, var(--cata-primary) 30%, transparent);
}

.dark .cata-tab:hover:not(.cata-tab-active) {
  text-shadow: 0 0 2px currentColor;
}

.cata-tab-active {
  border-bottom: 2px solid var(--cata-primary);
  border-color: var(--cata-primary);
  color: var(--cata-primary);
  font-weight: 600;
}

.dark .cata-tab-active {
  text-shadow: 0 0 4px currentColor;
}

/* Inputs con outline */
.cata-input {
  background-color: transparent;
  border: var(--cata-border-width) solid var(--cata-primary);
  border-color: color-mix(in srgb, var(--cata-primary) 50%, transparent);
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  color: var(--cata-fg);
  font-family: var(--cata-font-family);
}

.cata-input:focus {
  outline: 2px solid var(--cata-primary);
  outline-offset: 2px;
}

.dark .cata-input {
  font-weight: 300;
}

/* Sliders personalizados */
.cata-slider-track {
  background-color: transparent;
  border: var(--cata-border-width) solid;
  border-color: color-mix(in srgb, var(--cata-primary) 50%, transparent);
}

.cata-slider-thumb {
  background-color: white;
  border: 2px solid var(--cata-primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dark .cata-slider-thumb {
  background-color: black;
}

.dark .cata-slider-thumb {
  box-shadow: 0 0 6px var(--cata-primary);
}

/* Checkboxes con outline */
.cata-checkbox {
  background-color: transparent;
  border: var(--cata-border-width) solid var(--cata-primary);
  border-color: color-mix(in srgb, var(--cata-primary) 50%, transparent);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: all 150ms;
}

.cata-checkbox:hover {
  background-color: color-mix(in srgb, var(--cata-primary) 5%, transparent);
}

.cata-checkbox-checked {
  border-color: var(--cata-primary) !important;
  border-width: 2px;
  background-color: color-mix(in srgb, var(--cata-primary) 10%, transparent);
}

.dark .cata-checkbox-checked {
  background-color: color-mix(in srgb, var(--cata-primary) 15%, transparent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--cata-primary) 30%, transparent);
}

/* Botones con outline */
.cata-button {
  background-color: transparent;
  border: var(--cata-border-width) solid var(--cata-primary);
  border-color: color-mix(in srgb, var(--cata-primary) 50%, transparent);
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: background-color 200ms, border-color 200ms, box-shadow 200ms;
  cursor: pointer;
  color: var(--cata-fg);
  font-family: var(--cata-font-family);
}

.cata-button:hover {
  background-color: color-mix(in srgb, var(--cata-primary) 10%, transparent);
  border-color: color-mix(in srgb, var(--cata-primary) 70%, transparent);
}

.dark .cata-button:hover {
  box-shadow: 0 0 12px color-mix(in srgb, var(--cata-primary) 40%, transparent);
}

/* -------------------------------------------------------------------------- */
/* ANIMACIONES Y TRANSICIONES */
/* -------------------------------------------------------------------------- */

/* Fade in suave para contenido */
@keyframes cata-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cata-fade-in {
  animation: cata-fade-in 0.3s ease-out;
}

/* Glow effect para modo oscuro */
@keyframes cata-glow-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.dark .cata-glow {
  animation: cata-glow-pulse 2s ease-in-out infinite;
}

/* -------------------------------------------------------------------------- */
/* RESPONSIVE Y MOBILE-FIRST */
/* -------------------------------------------------------------------------- */

/* Optimizaciones para móvil */
@media (max-width: 640px) {
  .cata-accordion-header {
    padding: 0.5rem 0.75rem;
  }

  .cata-tab {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }

  .cata-button {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }
}

/* Optimizaciones para tablet */
@media (min-width: 641px) and (max-width: 1024px) {
  .cata-accordion-header {
    padding: 0.75rem 1rem;
  }
}

/* Ajustes para orientación landscape en móviles */
@media (max-height: 500px) and (orientation: landscape) {
  .cata-page {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .cata-accordion-header {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
}

/* Touch-friendly: Aumentar áreas de toque */
@media (hover: none) and (pointer: coarse) {
  .cata-button,
  .cata-checkbox,
  .cata-tab {
    min-height: 44px;
    min-width: 44px;
  }
}

/* -------------------------------------------------------------------------- */
/* ACCESIBILIDAD */
/* -------------------------------------------------------------------------- */

/* Focus visible mejorado */
*:focus-visible {
  outline: 2px solid var(--cata-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.dark *:focus-visible {
  outline-width: 3px;
  box-shadow: 0 0 8px var(--cata-primary);
}

/* Modo de alto contraste */
@media (prefers-contrast: high) {
  :root {
    --cata-border-width: 2px;
  }

  .cata-outline-box {
    border-width: 2px;
  }

  .dark .cata-text {
    text-shadow: none;
    font-weight: 400;
  }
}

/* -------------------------------------------------------------------------- */
/* TOASTS / NOTIFICACIONES */
/* -------------------------------------------------------------------------- */

/* Root container del toast */
.cata-toast-root {
  background-color: var(--cata-bg) !important;
  border: var(--cata-border-width) solid var(--cata-primary) !important;
  border-radius: 0.375rem;
  padding: 1rem;
}

.dark .cata-toast-root {
  background-color: rgba(0, 0, 0, 0.95) !important;
  border-color: var(--cata-primary) !important;
}

/* Wrapper del contenido */
.cata-toast-wrapper {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

/* Título del toast */
.cata-toast-title {
  color: var(--cata-fg) !important;
  font-family: var(--cata-font-family);
  font-size: 0.875rem;
  font-weight: 600;
}

.dark .cata-toast-title {
  font-family: 'Courier New', Courier, 'Lucida Console', Monaco, monospace;
  font-weight: 300;
  text-shadow: 0 0 2px currentColor;
}

/* Descripción del toast */
.cata-toast-description {
  color: var(--cata-fg) !important;
  font-family: var(--cata-font-family);
  font-size: 0.75rem;
  opacity: 0.75;
}

.dark .cata-toast-description {
  font-family: 'Courier New', Courier, 'Lucida Console', Monaco, monospace;
  font-weight: 300;
  text-shadow: 0 0 1px currentColor;
}

/* Icono del toast */
.cata-toast-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--cata-fg);
}

.dark .cata-toast-icon {
  filter: drop-shadow(0 0 2px currentColor);
}

/* Botones de acción */
.cata-toast-actions {
  display: flex;
  gap: 0.375rem;
  flex-shrink: 0;
  margin-top: 0.5rem;
}

/* Botón de cerrar */
.cata-toast-close {
  flex-shrink: 0;
  color: var(--cata-fg);
}

.cata-toast-close:hover {
  opacity: 0.8;
}

/* Barra de progreso */
.cata-toast-progress {
  position: absolute;
  inset-inline-start: 0;
  inset-inline-end: 0;
  bottom: 0;
  height: 0.125rem;
  background-color: var(--cata-primary);
  opacity: 0.5;
}

/* Variantes de color */
.cata-toast-primary {
  border-color: color-mix(in srgb, var(--cata-primary) 50%, transparent) !important;
}

.dark .cata-toast-primary {
  border-color: var(--cata-primary) !important;
  box-shadow: 0 0 12px rgba(0, 255, 0, 0.2);
}

.cata-toast-success {
  border-color: rgba(22, 163, 74, 0.5) !important;
}

.dark .cata-toast-success {
  border-color: rgb(34, 197, 94) !important;
  box-shadow: 0 0 12px rgba(0, 255, 0, 0.25);
}

.cata-toast-success .cata-toast-icon {
  color: rgb(22, 163, 74);
}

.dark .cata-toast-success .cata-toast-icon {
  color: rgb(34, 197, 94);
}

.cata-toast-error {
  border-color: rgba(220, 38, 38, 0.5) !important;
}

.dark .cata-toast-error {
  border-color: rgb(239, 68, 68) !important;
  box-shadow: 0 0 12px rgba(255, 0, 0, 0.25);
}

.cata-toast-error .cata-toast-icon {
  color: rgb(220, 38, 38);
}

.dark .cata-toast-error .cata-toast-icon {
  color: rgb(239, 68, 68);
}

.cata-toast-warning {
  border-color: rgba(202, 138, 4, 0.5) !important;
}

.dark .cata-toast-warning {
  border-color: rgb(234, 179, 8) !important;
  box-shadow: 0 0 12px rgba(255, 255, 0, 0.25);
}

.cata-toast-warning .cata-toast-icon {
  color: rgb(202, 138, 4);
}

.dark .cata-toast-warning .cata-toast-icon {
  color: rgb(234, 179, 8);
}

.cata-toast-info {
  border-color: rgba(37, 99, 235, 0.5) !important;
}

.dark .cata-toast-info {
  border-color: rgb(59, 130, 246) !important;
  box-shadow: 0 0 12px rgba(70, 130, 180, 0.25);
}

.cata-toast-info .cata-toast-icon {
  color: rgb(37, 99, 235);
}

.dark .cata-toast-info .cata-toast-icon {
  color: rgb(59, 130, 246);
}

.cata-toast-neutral {
  border-color: rgba(107, 114, 128, 0.5) !important;
}

.dark .cata-toast-neutral {
  border-color: rgb(107, 114, 128) !important;
  box-shadow: 0 0 12px rgba(128, 128, 128, 0.2);
}

.cata-toast-neutral .cata-toast-icon {
  color: rgb(75, 85, 99);
}

.dark .cata-toast-neutral .cata-toast-icon {
  color: rgb(156, 163, 175);
}

/* -------------------------------------------------------------------------- */
/* SCROLLBARS PERSONALIZADAS */
/* -------------------------------------------------------------------------- */

/* Scrollbar compacta para navegadores modernos (Firefox) */
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--cata-primary) 40%, transparent) transparent;
}

.dark * {
  scrollbar-color: color-mix(in srgb, var(--cata-primary) 60%, transparent) transparent;
}

/* Scrollbar compacta para navegadores WebKit (Chrome, Safari, Edge) */
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background-color: transparent;
}

*::-webkit-scrollbar-thumb {
  background-color: color-mix(in srgb, var(--cata-primary) 40%, transparent);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: color-mix(in srgb, var(--cata-primary) 60%, transparent);
}

.dark *::-webkit-scrollbar-thumb {
  background-color: color-mix(in srgb, var(--cata-primary) 60%, transparent);
}

.dark *::-webkit-scrollbar-thumb:hover {
  background-color: color-mix(in srgb, var(--cata-primary) 80%, transparent);
  box-shadow: 0 0 6px color-mix(in srgb, var(--cata-primary) 40%, transparent);
}

/* Scrollbar para esquinas cuando hay scroll horizontal y vertical */
*::-webkit-scrollbar-corner {
  background-color: transparent;
}
