/* ============================================
   Wadara - Custom Styles
   ============================================ */

/* --- Dark mode glow background --- */
.dark body {
  background:
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(34,211,238,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(59,130,246,0.04) 0%, transparent 70%),
    #060b1a;
  background-attachment: fixed;
}

/* --- Premium cards (gradient border, corner glow) --- */
.card-premium {
  position: relative;
  background: linear-gradient(175deg, #12182d 0%, #0f1324 100%);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow:
    0 1px 2px rgba(0,0,0,0.3),
    0 8px 32px -12px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.03);
  overflow: hidden;
}
.card-premium::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59,130,246,0.35), rgba(34,211,238,0.25), rgba(59,130,246,0.35), transparent);
  z-index: 1;
  pointer-events: none;
}
.card-premium::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at 80% 0%, rgba(59,130,246,0.06) 0%, transparent 50%),
              radial-gradient(ellipse at 20% 100%, rgba(34,211,238,0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}
.card-premium > * { position: relative; z-index: 1; }

/* Tasa del día - premium floating card */
.tasa-premium {
  background: linear-gradient(135deg, rgba(59,130,246,0.1) 0%, rgba(34,211,238,0.05) 40%, rgba(59,130,246,0.08) 100%);
  border: 1px solid rgba(59,130,246,0.15);
  box-shadow:
    0 4px 16px -4px rgba(59,130,246,0.1),
    0 1px 3px rgba(0,0,0,0.25),
    inset 0 1px 0 rgba(255,255,255,0.04);
  position: relative;
  overflow: hidden;
}
.tasa-premium::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, rgba(59,130,246,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.tasa-premium > * { position: relative; z-index: 1; }

/* Input / select focus glow ring */
.input-glow:focus {
  box-shadow: 0 0 0 3px rgba(59,130,246,0.2), 0 0 16px rgba(59,130,246,0.1);
  border-color: rgba(59,130,246,0.5);
}

/* --- Focus Mode grid animation --- */
.focus-grid-expand {
  animation: focusExpand 0.3s ease-out;
}
@keyframes focusExpand {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Banner vertical to compact transition --- */
.banner-vertical {
  overflow: hidden;
  transition: height 0.5s ease, border-radius 0.5s ease, opacity 0.3s ease;
}
/* Responsive banner grid: 3 cols desktop, 2 cols mobile */
@media (max-width: 480px) {
  .banner-section-inner {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .banner-section-inner .banner-vertical:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}
@media (min-width: 481px) {
  .banner-section-inner {
    grid-template-columns: repeat(3, 1fr);
  }
}
/* Vertical compact — height shrinks bottom-to-up, content becomes horizontal row */
.banner-compact-v {
  height: 64px !important;
  border-radius: 1rem !important;
}
.banner-compact-v .banner-vertical-content {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 1rem !important;
}
.banner-compact-v .banner-text-group {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  min-width: 0;
}
.banner-compact-v .banner-title {
  font-size: 0.85rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: visible;
  text-overflow: unset;
  text-align: center;
}
.banner-compact-v .banner-subtitle {
  font-size: 0.65rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: visible;
  text-overflow: unset;
  text-align: center;
}

/* --- Blur overlay on banner images when compacted --- */
.banner-bg-blurred {
  filter: blur(6px) !important;
  transition: filter 0.5s ease;
}

/* --- Lock body scroll behind modal --- */
body.modal-open { overscroll-behavior: contain; }

/* --- Text group wrapper inside banners --- */
.banner-text-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* --- Cart qty badge on package card --- */
.qty-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 2px 8px rgba(59,130,246,0.4);
  z-index: 5;
  line-height: 1;
}

/* --- Qty control row [+]/[-] --- */
.qty-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}
.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  background: rgba(59,130,246,0.15);
  color: #60a5fa;
  line-height: 1;
}
.qty-btn:hover { background: rgba(59,130,246,0.3); }
.qty-btn:active { transform: scale(0.9); }
.qty-btn.minus {
  background: rgba(239,68,68,0.12);
  color: #f87171;
}
.qty-btn.minus:hover { background: rgba(239,68,68,0.25); }
.qty-btn.minus:disabled {
  opacity: 0.2;
  cursor: not-allowed;
  transform: none;
}
.qty-value {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  min-width: 20px;
  text-align: center;
}

/* --- Checkout step inside premium modal --- */
.checkout-section {
  animation: fadeIn 0.3s ease-out;
}
.pago-card-checkout {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: all 0.2s;
}
.pago-card-checkout:hover {
  background: rgba(59,130,246,0.08);
  border-color: rgba(59,130,246,0.2);
}
.pago-card-checkout.selected {
  background: rgba(5,150,105,0.1);
  border-color: rgba(5,150,105,0.35);
}

/* --- Scroll indicator blink --- */
@keyframes blinkArrow {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50%      { opacity: 1;   transform: translateY(4px); }
}
.animate-blink-arrow {
  animation: blinkArrow 1.5s ease-in-out infinite;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #060b1a; }
::-webkit-scrollbar-thumb { background: #3b82f640; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3b82f680; }
.custom-scrollbar::-webkit-scrollbar { width: 4px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #3b82f630; border-radius: 2px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #3b82f660; }

/* --- Selection --- */
::selection { background: #3b82f660; color: #fff; }

/* --- Modals --- */
[id$="Modal"], #welcomePopup { display: none; }
[id$="Modal"].active, #welcomePopup.active { display: flex; }
[id$="Modal"] .animate-fade-in { animation: fadeIn 0.3s ease-out; }
#welcomePopup.active { animation: fadeIn 0.3s ease-out; }

/* --- Country selector --- */
.country-option {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  cursor: pointer; transition: background 0.15s; font-size: 13px;
}
.country-option:hover { background: rgba(59, 130, 246, 0.15); }
.country-option.selected { background: rgba(59, 130, 246, 0.2); }
.country-option .flag { font-size: 18px; line-height: 1; width: 24px; text-align: center; }
.country-option .name { flex: 1; color: rgba(255,255,255,0.85); }
.country-option .prefix { color: rgba(255,255,255,0.35); font-family: monospace; font-size: 12px; }

#countryDropdown { transform-origin: top center; }
#countryDropdown:not(.hidden) { display: block; }

/* --- Custom scrollbar for country list --- */
.custom-scrollbar::-webkit-scrollbar { width: 4px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(59,130,246,0.3); border-radius: 4px; }

/* --- Carousel --- */
.carousel-track { display: flex; will-change: transform; }
.carousel-slide { flex-shrink: 0; }

/* --- Input validation error --- */
.input-error { border-color: rgba(239, 68, 68, 0.6) !important; }
.input-error:focus { border-color: rgba(239, 68, 68, 0.8) !important; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important; }

/* --- Shake animation --- */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 50%, 90% { transform: translateX(-4px); }
  30%, 70% { transform: translateX(4px); }
}
.shake { animation: shake 0.4s ease-in-out; }

/* --- Error text --- */
.error-text { transition: opacity 0.2s ease; }
.error-text:not(.hidden) { opacity: 1; }
.error-text.hidden { opacity: 0; }

/* --- Forgot password feedback --- */
#forgotFeedback:not(.hidden) { display: block; }

/* --- Admin Panel --- */
#adminPanel { display: none; }
#adminPanel.active { display: flex; }

#adminPanel.active {
  background:
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(34,211,238,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 80% 0%, rgba(59,130,246,0.03) 0%, transparent 60%),
    #060b1a;
}

.admin-nav-item {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 10px 14px; border-radius: 10px; font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,0.6); transition: all 0.15s; text-align: left;
  cursor: pointer; border: none; background: none;
}
.admin-nav-item:hover { background: rgba(59,130,246,0.1); color: rgba(255,255,255,0.85); }
.admin-nav-item.active { background: rgba(59,130,246,0.15); color: #60a5fa; }

#adminSidebar.open { transform: translateX(0); }

/* --- Sidebar backdrop (mobile only) --- */
#adminSidebarBackdrop { display: none; }
#adminSidebarBackdrop.show { display: block; }

/* --- Tablet+: Persistent sidebar --- */
@media (min-width: 768px) {
  #adminSidebar {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 1 !important;
    transform: translateX(0) !important;
    flex-shrink: 0;
  }
  #adminSidebarBackdrop { display: none !important; }
  #adminMenuToggle { display: none; }
  #adminContent { padding-left: 0.5rem; }
}

@media (max-width: 767px) {
  #adminSidebar {
    position: absolute !important;
    z-index: 10 !important;
  }
  #adminSidebar:not(.open) { transform: translateX(-100%) !important; }
}

/* Admin sections */
.admin-section { animation: fadeIn 0.25s ease-out; }

/* Admin card — matches card-premium for consistent look */
.admin-card {
  background: linear-gradient(175deg, #12182d 0%, #0f1324 100%);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 32px -12px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.03);
  position: relative;
  overflow: hidden;
}
.admin-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59,130,246,0.3), rgba(34,211,238,0.2), rgba(59,130,246,0.3), transparent);
  z-index: 1;
  pointer-events: none;
}

/* Admin table — clean dark styling */
.admin-table th {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 8px 10px;
}
.admin-table td {
  padding: 10px;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  border-top: 1px solid rgba(255,255,255,0.04);
}
.admin-table tbody tr:hover td {
  background: rgba(59,130,246,0.04);
}

/* Admin section card (inline variant without the ::before border) */
.admin-section-card {
  background: linear-gradient(175deg, #12182d 0%, #0f1324 100%);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.03);
}

/* Quick nav buttons */
.quick-nav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px; border-radius: 12px; background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06); cursor: pointer;
  transition: all 0.2s; font-size: 11px; color: rgba(255,255,255,0.55);
  font-weight: 500;
}
.quick-nav-btn:hover { background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.2); color: rgba(255,255,255,0.85); }
.quick-nav-btn i { font-size: 18px; }
.quick-nav-btn:active { transform: scale(0.96); }

/* Scrollbar for admin content */
#adminContent::-webkit-scrollbar { width: 4px; }
#adminContent::-webkit-scrollbar-track { background: transparent; }
#adminContent::-webkit-scrollbar-thumb { background: rgba(59,130,246,0.3); border-radius: 4px; }

/* --- Custom Select --- */
select option { background: #0f1324; color: #fff; padding: 8px; }
select:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px #3b82f620; }

/* --- Smooth hover for premium cards --- */
.premium-card { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.premium-card:hover { transform: translateY(-2px); }

/* --- WhatsApp FAB pulse --- */
@keyframes whatsappPulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  70% { box-shadow: 0 0 0 14px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
#whatsappBtn { animation: whatsappPulse 2s infinite, slideUp 0.4s ease-out; }

/* --- Body scroll locking --- */
body.modal-open { overflow: hidden; }

/* --- Responsive fine-tune --- */
@media (max-width: 640px) {
  .carousel-slide .text-4xl { font-size: 1.75rem; }
  .carousel-slide .h-48 { height: 200px; }
}

@media (min-width: 768px) {
  #carousel:hover .carousel-prev,
  #carousel:hover .carousel-next { opacity: 1; }
}

/* --- Focus visible --- */
*:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; border-radius: 8px; }

/* --- Orden filter buttons --- */
.orden-filter {
  padding: 8px 16px; border-radius: 10px; font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5); cursor: pointer; transition: all 0.2s;
  white-space: nowrap;
}
.orden-filter:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.8); }
.orden-filter.active { background: rgba(59,130,246,0.15); border-color: rgba(59,130,246,0.3); color: #60a5fa; }

/* --- Orden card --- */
.orden-card {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px; overflow: hidden;
  transition: all 0.2s;
}
.orden-card:hover { border-color: rgba(59,130,246,0.15); }
.orden-card-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; cursor: pointer; user-select: none;
}
.orden-card-body { border-top: 1px solid rgba(255,255,255,0.05); }
.orden-badge {
  font-size: 10px; font-weight: 700; padding: 4px 10px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.orden-badge.pendiente { background: rgba(245,158,11,0.15); color: #f59e0b; }
.orden-badge.completada { background: rgba(16,185,129,0.15); color: #10b981; }
.orden-badge.cancelada { background: rgba(239,68,68,0.15); color: #ef4444; }

/* --- Checklist --- */
.checklist-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  font-size: 13px; color: rgba(255,255,255,0.55); cursor: pointer;
  transition: color 0.2s;
}
.checklist-item.checked { color: rgba(255,255,255,0.85); }
.checklist-item .check-box {
  width: 18px; height: 18px; border-radius: 5px;
  border: 2px solid rgba(255,255,255,0.2); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; font-size: 10px;
}
.checklist-item.checked .check-box { background: #10b981; border-color: #10b981; color: #fff; }

/* --- Tabla info orden --- */
.orden-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.orden-info-item { padding: 8px 12px; border-radius: 8px; background: rgba(255,255,255,0.03); }
.orden-info-item .label { font-size: 10px; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 0.5px; }
.orden-info-item .value { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.85); margin-top: 2px; }

/* --- Comprobante thumbnail --- */
.comprobante-thumb {
  width: 100%; padding: 12px; border-radius: 12px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
  cursor: pointer; transition: all 0.2s; text-align: center;
}
.comprobante-thumb:hover { background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.2); }
.comprobante-thumb img { max-height: 160px; border-radius: 8px; margin: 0 auto; }
.comprobante-thumb p { font-size: 11px; color: rgba(255,255,255,0.35); margin-top: 6px; }

/* --- Drag card --- */
.paquete-drag-card { touch-action: none; }
.paquete-drag-card:active { opacity: 0.7; transform: scale(1.02); }
.opcion-drag-card { touch-action: none; }
.opcion-drag-card:active { opacity: 0.7; transform: scale(1.02); }
.opcion-cliente-card { touch-action: manipulation; }

/* --- WA btn --- */
.wa-btn { padding: 8px 16px; border-radius: 10px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s; border: none; display: inline-flex; align-items: center; gap: 6px; }
.wa-btn.copy { background: rgba(37,211,102,0.15); color: #25d366; }
.wa-btn.copy:hover { background: rgba(37,211,102,0.25); }
.wa-btn.send { background: #25d366; color: #fff; }
.wa-btn.send:hover { background: #20bd5a; }
.wa-btn.send:active { transform: scale(0.96); }

/* --- Stats filter buttons --- */
.stats-filter {
  padding: 4px 10px; border-radius: 8px; font-size: 11px; font-weight: 600;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.4); cursor: pointer; transition: all 0.2s;
  white-space: nowrap; line-height: 1.4;
}
.stats-filter:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); }
.stats-filter.active { background: rgba(59,130,246,0.15); border-color: rgba(59,130,246,0.3); color: #60a5fa; }

/* --- Gentle bounce for pay button --- */
@keyframes gentleBounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}
.animate-gentle-bounce {
  animation: gentleBounce 1.8s ease-in-out infinite;
}

/* --- Package card image --- */
.package-card-img {
  aspect-ratio: 4 / 3;
  position: relative;
}

/* --- Package card --- */
.package-card {
  border: 1px solid transparent;
}
.package-card:hover { border-color: rgba(99,102,241,0.15); }
.package-card .qty-control { margin-top: 0; }

/* --- Package card overlay (selected state) --- */
.package-card-overlay {
  pointer-events: none;
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .carousel-track { transition: none !important; }
}

/* --- Checkout success checkmark animation --- */
@keyframes checkCircleDraw {
  0%   { stroke-dashoffset: 166; }
  100% { stroke-dashoffset: 0; }
}
@keyframes checkDraw {
  0%   { stroke-dashoffset: 48; }
  100% { stroke-dashoffset: 0; }
}
@keyframes checkmarkGlow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(16,185,129,0.2)); }
  50%      { filter: drop-shadow(0 0 14px rgba(16,185,129,0.6)); }
}
@keyframes checkmarkPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.checkmark-wrapper {
  cursor: pointer;
}
.checkmark-wrapper:hover .checkmark-svg {
  animation: checkmarkPop 0.5s ease-in-out;
}
.checkmark-wrapper:hover .checkmark-circle,
.checkmark-wrapper:hover .checkmark-check {
  animation: checkmarkGlow 1.2s ease-in-out infinite;
}
.checkmark-circle {
  animation: checkCircleDraw 0.8s ease-out forwards;
}
.checkmark-check {
  animation: checkDraw 0.4s 0.6s ease-out forwards;
}
.checkmark-svg {
  transition: transform 0.3s ease;
  display: block;
  margin: 0 auto;
}
