/* =========================
   MEJORAS VISUALES PREMIUM - UI/UX Enhancements
   Microinteracciones, Animaciones y Pulido Visual
   ========================= */

/* =========================
   MEJORAS GENERALES - Polishing
   ========================= */

/* Scroll suave mejorado */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

/* Mejoras en tarjetas con efectos premium */
.tour-card,
.reservation-card,
.admin-card {
  position: relative;
  overflow: hidden;
}

/* Efecto shine en hover para tarjetas */
.tour-card::after,
.reservation-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 70%
  );
  transform: rotate(45deg);
  transition: all 0.6s ease;
  opacity: 0;
  pointer-events: none;
}

.tour-card:hover::after,
.reservation-card:hover::after {
  opacity: 1;
  animation: shine 1.5s ease-in-out;
}

@keyframes shine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

/* =========================
   MEJORAS EN TABLAS ADMIN
   ========================= */

table {
  transition: all var(--transition-base);
}

table tbody tr {
  transition: all var(--transition-fast);
  position: relative;
}

table tbody tr::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
  transform: scaleY(0);
  transition: transform var(--transition-base);
}

table tbody tr:hover {
  background: rgba(14, 165, 233, 0.04);
  transform: translateX(4px);
}

table tbody tr:hover::before {
  transform: scaleY(1);
}

/* Badges de estado mejorados */
.status-badge,
.reservation-status {
  position: relative;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.status-badge::before,
.reservation-status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(0.9);
  }
}

.status-pending,
.status-badge.pending {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.08));
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-confirmed,
.status-badge.confirmed {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.08));
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-cancelled,
.status-badge.cancelled {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.08));
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-expired,
.status-badge.expired {
  background: linear-gradient(135deg, rgba(113, 128, 150, 0.15), rgba(113, 128, 150, 0.08));
  color: #64748b;
  border: 1px solid rgba(113, 128, 150, 0.3);
}

.status-completed,
.status-badge.completed {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.08));
  color: #4f46e5;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

/* =========================
   BOTONES MEJORADOS
   ========================= */

.btn,
.btn-primary,
.btn-secondary,
.btn-danger {
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  transform: translateY(0);
}

.btn::before,
.btn-primary::before,
.btn-secondary::before,
.btn-danger::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::before,
.btn-primary:active::before,
.btn-secondary:active::before,
.btn-danger:active::before {
  width: 300px;
  height: 300px;
}

.btn:hover,
.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn:active,
.btn-primary:active,
.btn-secondary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

/* =========================
   INPUTS Y FORMULARIOS
   ========================= */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
  transition: all var(--transition-base);
  position: relative;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -4px rgba(14, 165, 233, 0.2), var(--shadow-md);
}

/* Input con icono animado */
.input-group {
  position: relative;
}

.input-group::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

.input-group:focus-within::after {
  transform: scaleX(1);
}

/* =========================
   LOADING STATES MEJORADOS
   ========================= */

.spinner {
  position: relative;
}

.spinner::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border: 3px solid rgba(14, 165, 233, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-secondary) 0%,
    rgba(255, 255, 255, 0.5) 50%,
    var(--bg-secondary) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius);
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* =========================
   EMPTY STATES MEJORADOS
   ========================= */

.empty-state-container,
.auth-required-container {
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.empty-state-icon,
.auth-required-icon {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* =========================
   TABS MEJORADOS
   ========================= */

.admin-tabs {
  position: relative;
}

.admin-tab {
  position: relative;
  overflow: hidden;
}

.admin-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

.admin-tab.active::after,
.admin-tab:hover::after {
  transform: scaleX(1);
}

.admin-tab.active {
  transform: translateY(-2px);
}

/* =========================
   CARDS CON GRADIENTES
   ========================= */

.tour-card-image {
  position: relative;
  overflow: hidden;
}

.tour-card-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 60%,
    rgba(0, 0, 0, 0.3) 100%
  );
  opacity: 0;
  transition: opacity var(--transition-base);
}

.tour-card:hover .tour-card-image::after {
  opacity: 1;
}

/* =========================
   NAVEGACIÓN MEJORADA
   ========================= */

.nav-link {
  position: relative;
}

.nav-link::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transform: translateX(-50%);
  transition: width var(--transition-base);
}

.nav-link:hover::before,
.nav-link.active::before {
  width: 80%;
}

/* =========================
   TOOLTIPS Y HINTS
   ========================= */

[data-tooltip] {
  position: relative;
}

[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: var(--text);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  white-space: nowrap;
  margin-bottom: 8px;
  animation: tooltipFadeIn 0.2s ease-out;
  z-index: 1000;
}

[data-tooltip]:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--text);
  margin-bottom: 2px;
  z-index: 1000;
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* =========================
   SCROLLBAR PERSONALIZADA
   ========================= */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-full);
  transition: background var(--transition-base);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--secondary-dark));
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--bg-secondary);
}

/* =========================
   RESPONSIVE IMPROVEMENTS
   ========================= */

@media (max-width: 768px) {
  .tour-card:hover {
    transform: translateY(-2px);
  }
  
  table tbody tr:hover {
    transform: none;
  }
  
  .admin-tab:hover {
    transform: none;
  }
}

/* =========================
   ACCESSIBILITY IMPROVEMENTS
   ========================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

/* =========================
   PRINT STYLES
   ========================= */

@media print {
  .nav,
  .btn,
  button {
    display: none;
  }
  
  .tour-card,
  .reservation-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
