:root {
  --primary: #44bcd8;
  --secondary: #c54656;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --glass-bg: rgba(255, 255, 255, 0.8);
}

.dark {
  --bg-body: #020617;
  --bg-card: #0f172a;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border-color: #1e293b;
  --glass-bg: rgba(15, 23, 42, 0.8);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Ocultar flechas de inputs numéricos */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type=number] {
  -moz-appearance: textfield;
}

/* Sidebar Móvil */
#sidebar {
  position: fixed;
  top: 0;
  left: -100%;
  width: 85%;
  max-width: 320px;
  height: 100%;
  background: #0f172a;
  z-index: 1000;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 20px 0 50px rgba(0,0,0,0.3);
}

#sidebar.open {
  left: 0;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: none;
}

/* Logo Container */
.logo-container {
  background-color: #ffffff;
  width: 48px;
  height: 48px;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .logo-container {
    width: 56px;
    height: 56px;
    padding: 8px;
  }
}

.dark .logo-container {
  box-shadow: 0 0 15px rgba(255,255,255,0.1);
}

.logo-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Blobs Decorativos */
.blob {
  position: fixed;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  filter: blur(100px);
  opacity: 0.2;
  z-index: -1;
  border-radius: 50%;
  animation: moveBlob 25s infinite alternate ease-in-out;
}

.blob-secondary {
  background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
  animation-delay: -7s;
  right: -10%;
  top: 20%;
  opacity: 0.15;
}

@keyframes moveBlob {
  0% { transform: translate(-10%, -10%) scale(1); }
  50% { transform: translate(15%, 10%) scale(1.1); }
  100% { transform: translate(5%, 20%) scale(1); }
}

/* Glassmorphism */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
}

/* Tarjetas */
.card-custom {
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Animaciones */
@keyframes float-constant {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(1deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

.animate-float {
  animation: float-constant 5s ease-in-out infinite !important;
}

.animate-float-delayed {
  animation: float-constant 5s ease-in-out infinite !important;
  animation-delay: -2.5s !important;
}

@keyframes plane-fly {
  0% { transform: translate(0, 0) rotate(-5deg); }
  50% { transform: translate(20px, -15px) rotate(2deg); }
  100% { transform: translate(0, 0) rotate(-5deg); }
}

.animate-plane {
  animation: plane-fly 4s ease-in-out infinite;
}

/* Mockup Teléfono */
.phone-mockup {
  width: 240px;
  height: 480px;
  background: #1e293b;
  border-radius: 2.5rem;
  border: 8px solid #0f172a;
  position: relative;
  box-shadow: 0 30px 60px -12px rgba(0,0,0,0.5);
  overflow: hidden;
  transform: perspective(1000px) rotateY(-10deg) rotateX(5deg);
  transition: all 0.5s ease;
}

@media (min-width: 768px) {
  .phone-mockup {
    width: 260px;
    height: 540px;
    border-width: 10px;
  }
}

.phone-mockup:hover {
  transform: perspective(1000px) rotateY(0deg) rotateX(0deg) scale(1.05);
  z-index: 50;
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: #f8fafc;
  overflow: hidden;
}

.phone-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 16px;
  background: #0f172a;
  border-bottom-left-radius: 1rem;
  border-bottom-right-radius: 1rem;
  z-index: 20;
}

/* Calculadora */
.calc-input-group {
  background-color: var(--bg-body);
  border: 2px solid var(--border-color);
  border-radius: 1.5rem;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

.calc-input-group:focus-within {
  transform: translateY(-2px);
}

.calc-input {
  background: transparent !important;
  border: none !important;
  padding: 0.5rem 1rem;
  font-size: 1.5rem;
  font-weight: 900;
  width: 100%;
  outline: none !important;
  color: var(--text-main) !important;
  text-align: center;
}

@media (min-width: 768px) {
  .calc-input {
    font-size: 1.75rem;
  }
}

/* Custom Dropdown */
.custom-dropdown {
  position: relative;
  min-width: 100px;
}

.dropdown-trigger {
  background-color: var(--bg-card) !important;
  color: var(--text-main) !important;
  border: 2px solid var(--border-color) !important;
  border-radius: 1rem;
  padding: 0.6rem 1.2rem;
  font-weight: 900;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  outline: none !important;
}

.dropdown-trigger:hover {
  border-color: var(--primary) !important;
}

.dropdown-options {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 0.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  z-index: 100;
  display: none;
  animation: fadeIn 0.2s ease-out;
}

.dropdown-options.show {
  display: block;
}

.dropdown-option {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.dropdown-option:hover {
  background: var(--border-color);
  color: var(--primary);
}

.dropdown-option.selected {
  background: var(--primary);
  color: white;
}

/* Redes Sociales */
.social-link {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-link:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-5px) rotate(8deg);
  box-shadow: 0 10px 20px rgba(68, 188, 216, 0.3);
}

.social-link img {
  width: 20px;
  height: 20px;
  filter: invert(1);
}

/* Animaciones de Entrada */
.animate-fade {
  animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.active-press:active {
  transform: scale(0.94) !important;
}

.hover-lift:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* Theme Menu */
#theme-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 0.5rem;
  min-width: 140px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

#theme-menu.show {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

.theme-btn {
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
  transition: all 0.2s;
}

.theme-btn:hover {
  background: var(--border-color);
}

/* Invertir Cambio Dinámico con Flujo Secuencial */
#invertir-cambio {
  transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#invertir-cambio.flow-up {
  transform: rotate(180deg);
}

@keyframes arrow-flow {
  0% { opacity: 0.1; transform: translateY(-4px); }
  50% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0.1; transform: translateY(4px); }
}

.arrow-icon {
  animation: arrow-flow 1.2s infinite ease-in-out;
}

.arrow-icon:nth-child(1) { animation-delay: 0s; }
.arrow-icon:nth-child(2) { animation-delay: 0.2s; }
.arrow-icon:nth-child(3) { animation-delay: 0.4s; }

/* Animación de Giro al Presionar */
@keyframes spin-fast {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.is-spinning {
  animation: spin-fast 0.6s linear infinite !important;
}