/* 
   ✨ KARPUS PREMIUM MOBILE CSS
   Optimización para dispositivos móviles y experiencia PWA nativa.
*/

:root {
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
  --nav-height: 72px;
}

/* 📱 Safe Areas & General Mobile Tweaks */
body {
  padding-top: var(--safe-area-top);
  padding-bottom: calc(var(--safe-area-bottom) + var(--nav-height));
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain; /* Evita el bounce de recarga en iOS si no se desea */
}

@media (min-width: 1024px) {
  body {
    padding-bottom: var(--safe-area-bottom);
  }
}

/* 🌊 Liquid Transitions */
.section-transition-enter {
  opacity: 0;
  transform: translateY(10px);
}
.section-transition-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 🧭 Bottom Navigation Bar (Premium) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: var(--safe-area-bottom);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  z-index: 999;
  box-shadow: 0 -5px 20px rgba(0,0,0,0.03);
}

@media (min-width: 1024px) {
  .bottom-nav {
    display: none;
  }
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  text-decoration: none;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
  flex: 1;
  height: 100%;
}

.nav-item i {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
}

.nav-item.active {
  color: #6366f1;
}

.nav-item.active i {
  transform: translateY(-2px);
  filter: drop-shadow(0 4px 6px rgba(99, 102, 241, 0.2));
}

/* 🦴 Skeleton Screens */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 8px;
}

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

/* 🔄 Pull to Refresh Indicator */
.ptr-indicator {
  height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  transition: height 0.2s ease;
}

.ptr-active .ptr-indicator {
  height: 60px;
}

/* 💳 Swipe Actions (Directora) */
.swipe-row {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
}

.swipe-content {
  position: relative;
  z-index: 2;
  background: white;
  transition: transform 0.2s ease;
}

.swipe-actions {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  display: flex;
  z-index: 1;
}

.action-left, .action-right {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  width: 80px;
}

.action-left { background: #22c55e; margin-right: auto; }
.action-right { background: #3b82f6; margin-left: auto; }

/* 📱 Mobile Card List (Conversion de tablas) */
@media (max-width: 640px) {
  .mobile-card-list .table-row {
    display: block;
    background: white;
    margin-bottom: 12px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
  }
  
  .mobile-card-list thead {
    display: none;
  }
}
