:root {
  --bg-primary: #0a0a0b;
  --bg-secondary: #121214;
  --bg-tertiary: #1a1a1d;
  --text-primary: #f4f4f5;
  --text-secondary: #d1d5db;
  --text-muted: #cbd5e1;
  --accent: #10b981;
  --accent-light: #34d399;
  --border: rgba(255,255,255,0.08);
  --glass: rgba(26,26,29,0.8);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

@keyframes gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animate-fadeIn { animation: fadeIn 0.5s ease-out forwards; }
.animate-slideUp { animation: slideUp 0.5s ease-out forwards; }
.animate-slideDown { animation: slideDown 0.5s ease-out forwards; }
.animate-scaleIn { animation: scaleIn 0.3s ease-out forwards; }
.animate-float { animation: float 3s ease-in-out infinite; }

/* Stagger children */
.stagger-children > * {
  opacity: 0;
  animation: slideUp 0.5s ease-out forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.4s; }

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

/* Glass effect */
.glass {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, var(--accent-light), var(--accent), #10b981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-border {
  position: relative;
  background: var(--bg-secondary);
  border-radius: 16px;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(135deg, var(--accent), transparent, var(--accent-light));
  border-radius: 17px;
  z-index: -1;
  opacity: 0.3;
}

/* Button styles */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #000;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 12px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -10px var(--accent);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Card styles */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: all 0.3s ease;
}

.card:hover {
  border-color: rgba(16, 185, 129, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -20px rgba(0,0,0,0.5);
}

/* Input styles */
.input-field {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text-primary);
  font-size: 15px;
  transition: all 0.3s ease;
}

.input-field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.input-field::placeholder {
  color: var(--text-muted);
}

/* Background patterns */
.bg-grid {
  background-image: 
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
}

.bg-dots {
  background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* View transitions */
.view {
  display: none;
  opacity: 0;
}

.view.active {
  display: block;
  animation: fadeIn 0.4s ease-out forwards;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: scaleIn 0.3s ease-out;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideDown 0.3s ease-out;
  min-width: 300px;
}

.toast.success { border-left: 3px solid var(--accent); }
.toast.error { border-left: 3px solid #ef4444; }
.toast.warning { border-left: 3px solid #f97316; }

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  transition: transform 0.3s ease;
}

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
}

/* Menu card item */
.menu-item-card {
  background: var(--bg-tertiary);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.menu-item-card:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
}

/* Public menu styles */
.public-menu-item {
  background: var(--bg-secondary);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid var(--border);
}

.public-menu-item:hover {
  border-color: rgba(16, 185, 129, 0.3);
}

/* Category Tabs Styling */
.category-tab {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.category-tab.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.category-tab:hover:not(.active) {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

#categoryTabs {
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  padding: 10px 4px;
}

#categoryTabs::-webkit-scrollbar {
  display: none;
}

/* QR Code container */
.qr-container {
  background: white;
  padding: 20px;
  border-radius: 16px;
  display: inline-block;
}

/* Loading spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Glow effects */
.glow-accent {
  box-shadow: 0 0 60px rgba(16, 185, 129, 0.3);
}

/* Image upload */
.image-upload-zone {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.image-upload-zone:hover {
  border-color: var(--accent);
  background: rgba(16, 185, 129, 0.05);
}

.image-upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(16, 185, 129, 0.1);
}

/* Stats card */
.stat-card {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.1), transparent);
  border-radius: 50%;
  transform: translate(30%, -30%);
}

/* Animación de flotación suave */
    @keyframes float {
      0% { transform: translateY(0px); }
      50% { transform: translateY(-15px); }
      100% { transform: translateY(0px); }
    }
    .animate-float {
      animation: float 4s ease-in-out infinite;
    }
/* Mobile Optimizations */
@media (max-width: 768px) {
  .p-6 { padding: 1.25rem !important; }
  .dashboard-section { padding-bottom: 6rem; }
  .stat-card { padding: 1.25rem; }
  .btn-primary, .btn-secondary { padding: 12px 16px; font-size: 15px; width: 100%; display: flex; align-items: center; justify-content: center; }
  .card { border-radius: 16px; }
  .input-field { padding: 14px; font-size: 16px; } /* Improved for iOS zoom prevention */
  .sidebar { width: 100%; max-width: 280px; }
  
  /* Navigation sticky improvement */
  #categoryNav {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
  }
}

#sidebarToggle {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.sidebar.open {
  box-shadow: 0 0 40px rgba(0,0,0,0.8);
}

#categoryNav::-webkit-scrollbar { display: none; }
#categoryNav { -ms-overflow-style: none; scrollbar-width: none; }

/* Landing Specific Styles */
.section-padding { padding: 100px 0; }
@media (max-width: 768px) { .section-padding { padding: 60px 0; } }
.benefit-card { padding: 2rem; border-radius: 1.5rem; background: var(--bg-secondary); border: 1px solid var(--border); transition: all 0.3s ease; }
.benefit-card:hover { border-color: rgba(16, 185, 129, 0.3); transform: translateY(-8px); background: var(--bg-tertiary); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); }
.step-card { position: relative; padding: 2rem; }
.step-number { width: 3rem; height: 3rem; border-radius: 50%; background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2); display: flex; align-items: center; justify-content: center; color: var(--accent); font-weight: 700; font-size: 1.25rem; margin-bottom: 1.5rem; }
.testimonial-card { padding: 2rem; border-radius: 1.5rem; background: var(--bg-secondary); border: 1px solid var(--border); font-style: italic; color: var(--text-secondary); }
.social-icon { width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--bg-tertiary); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; }
.social-icon:hover { background: var(--accent); color: #000; transform: translateY(-3px); }
.glow-blob { position: absolute; width: 400px; height: 400px; background: radial-gradient(circle, var(--accent) 0%, transparent 70%); opacity: 0.1; filter: blur(80px); pointer-events: none; z-index: 0; }

/* WhatsApp Floating Button */
.whatsapp-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background-color: #25d366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  z-index: 9999;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: pulse-whatsapp 2s infinite;
  text-decoration: none;
}

.whatsapp-btn:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}

.whatsapp-btn .tooltip {
  position: absolute;
  right: 75px;
  background: #fff;
  color: #000;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  transform: translateX(10px);
}

.whatsapp-btn .tooltip::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 8px 0 8px 8px;
  border-style: solid;
  border-color: transparent transparent transparent #fff;
}

.whatsapp-btn:hover .tooltip {
  opacity: 1;
  transform: translateX(0);
}

@keyframes pulse-whatsapp {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6); }
  70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

@media (max-width: 768px) {
  .whatsapp-btn {
    width: 55px;
    height: 55px;
    bottom: 15px;
    right: 15px;
  }
  .whatsapp-btn .tooltip { display: none; }
}
.text-balance { text-wrap: balance; }
