/* ==================== VARIABLES CSS ==================== */
:root {
  --primary: #f59e0b;
  --primary-dark: #d97706;
  --secondary: #f97316;
  --accent: #fbbf24;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;

  --dark-900: #0a0a0a;
  --dark-800: #121212;
  --dark-700: #1a1a1a;
  --dark-600: #262626;

  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-400: #a3a3a3;
  --gray-600: #525252;

  --font-display: "DM Sans", sans-serif;
  --font-mono: "Space Mono", monospace;
}

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

body {
  font-family: var(--font-display);
  background: var(--dark-900);
  color: var(--gray-100);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(0.98);
  }
}

@keyframes glow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(245, 158, 11, 0.6);
  }
}

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

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

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

/* ==================== NAVBAR ==================== */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  height: 72px;
  z-index: 1000;

  /* Apple Glass */
  background: rgba(15, 15, 15, 0.55);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);

  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Noise layer */
.navbar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.04;
}

/* Light edge */
.navbar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(245, 158, 11, 0.12),
    rgba(255, 255, 255, 0.08),
    rgba(245, 158, 11, 0.12)
  );
  opacity: 0.35;
}

/* ==================== CONTAINER ==================== */
.navbar-container {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);

  display: flex;
  align-items: center;
  justify-content: space-between;

  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.015)
  );
}

/* ==================== LOGO (IMAGE) ==================== */
.logo {
  display: flex;
  align-items: center;
  height: 100%;
  text-decoration: none;
  position: relative;
  z-index: 2;
}

.logo img {
  height: clamp(42px, 4vw, 56px);
  width: auto;
  transition:
    transform 0.35s ease,
    filter 0.35s ease;
}

.logo:hover img {
  transform: scale(1.06);
  filter: drop-shadow(0 4px 12px rgba(245, 158, 11, 0.35));
}

/* ==================== CLOSE BUTTON ==================== */
.close-demo {
  color: var(--gray-100);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;

  padding: 0.5rem 1rem;
  border-radius: 8px;

  transition: all 0.25s ease;
  position: relative;
  z-index: 2;
}

.close-demo:hover {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
}

/* ==================== HERO DEMO ==================== */
.demo-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}

.demo-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(
      circle at 30% 20%,
      rgba(245, 158, 11, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 70% 80%,
      rgba(249, 115, 22, 0.1) 0%,
      transparent 50%
    );
  animation: pulse 8s ease-in-out infinite;
}

.demo-container {
  max-width: 1600px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.demo-header {
  text-align: center;
  margin-bottom: 4rem;
  animation: fadeIn 0.8s ease;
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.5rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 50px;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.demo-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.demo-subtitle {
  font-size: 1.35rem;
  color: var(--gray-400);
  max-width: 800px;
  margin: 0 auto 2rem;
}

/* ==================== DASHBOARD PRINCIPAL ==================== */
.dashboard {
  background: linear-gradient(135deg, var(--dark-800), var(--dark-700));
  border: 2px solid rgba(245, 158, 11, 0.2);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow:
    0 0 0 1px rgba(245, 158, 11, 0.1),
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 100px rgba(245, 158, 11, 0.1);
  animation: fadeIn 1s ease;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(245, 158, 11, 0.1);
}

.dashboard-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dashboard-title h2 {
  font-size: 2rem;
  font-weight: 900;
}

.time-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
}

.dashboard-actions {
  display: flex;
  gap: 1rem;
}

.action-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.3s;
  font-size: 0.95rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5);
}

.btn-secondary {
  background: transparent;
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--primary);
}

.btn-secondary:hover {
  background: rgba(245, 158, 11, 0.1);
}

/* ==================== MÉTRICAS PRINCIPALES ==================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.metric-card {
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.05),
    rgba(249, 115, 22, 0.02)
  );
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 16px;
  padding: 1.75rem;
  transition: 0.3s;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(
    circle,
    rgba(245, 158, 11, 0.1) 0%,
    transparent 70%
  );
  border-radius: 50%;
}

.metric-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.2);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.metric-label {
  font-size: 0.85rem;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}

.metric-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.metric-value {
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  animation: countUp 0.8s ease;
}

.metric-change {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.metric-change.positive {
  color: var(--success);
}

.metric-change.negative {
  color: var(--danger);
}

/* ==================== SECCIÓN DE VENTAS EN VIVO ==================== */
.live-sales {
  background: var(--dark-800);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2.5rem;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.section-title h3 {
  font-size: 1.35rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--success);
  font-weight: 600;
}

.sales-list {
  list-style: none;
  max-height: 400px;
  overflow-y: auto;
}

.sales-list::-webkit-scrollbar {
  width: 6px;
}

.sales-list::-webkit-scrollbar-track {
  background: var(--dark-700);
  border-radius: 10px;
}

.sales-list::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

.sale-item {
  display: grid;
  grid-template-columns: 60px 1fr auto auto;
  gap: 1.25rem;
  align-items: center;
  padding: 1.25rem;
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.03),
    rgba(249, 115, 22, 0.01)
  );
  border: 1px solid rgba(245, 158, 11, 0.1);
  border-radius: 12px;
  margin-bottom: 1rem;
  transition: 0.3s;
  animation: slideInRight 0.5s ease;
}

.sale-item:hover {
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.08),
    rgba(249, 115, 22, 0.03)
  );
  border-color: var(--primary);
  transform: translateX(5px);
}

.sale-item.new {
  animation:
    slideInRight 0.5s ease,
    glow 2s ease-in-out infinite;
  border-color: var(--success);
}

.sale-time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 700;
  text-align: center;
}

.sale-info h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.sale-details {
  font-size: 0.85rem;
  color: var(--gray-400);
}

.sale-weight {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-200);
}

.sale-amount {
  font-size: 1.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--success), #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ==================== GRÁFICA DE VENTAS ==================== */
.chart-container {
  background: var(--dark-800);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2.5rem;
}

.chart {
  height: 300px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 1rem;
  padding: 2rem 0;
  border-bottom: 2px solid rgba(245, 158, 11, 0.2);
}

.chart-bar {
  flex: 1;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 8px 8px 0 0;
  position: relative;
  transition: 0.5s;
  cursor: pointer;
  min-height: 30px;
}

.chart-bar:hover {
  filter: brightness(1.2);
  transform: scaleX(1.1);
}

.chart-bar::before {
  content: attr(data-value);
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
}

.chart-label {
  font-size: 0.85rem;
  color: var(--gray-400);
  text-align: center;
  margin-top: 0.75rem;
  font-weight: 600;
}

/* ==================== ALERTAS EN VIVO ==================== */
.alerts-container {
  position: fixed;
  top: 100px;
  right: 2rem;
  width: 380px;
  z-index: 999;
}

.alert {
  background: var(--dark-800);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: slideInRight 0.5s ease;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.alert.success {
  border-left-color: var(--success);
}

.alert.warning {
  border-left-color: var(--warning);
}

.alert.danger {
  border-left-color: var(--danger);
}

.alert-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.alert.success .alert-icon {
  background: rgba(16, 185, 129, 0.2);
}

.alert.warning .alert-icon {
  background: rgba(245, 158, 11, 0.2);
}

.alert.danger .alert-icon {
  background: rgba(239, 68, 68, 0.2);
}

.alert-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.alert-content p {
  font-size: 0.85rem;
  color: var(--gray-400);
}

.alert-time {
  font-size: 0.75rem;
  color: var(--gray-600);
  font-family: var(--font-mono);
  margin-top: 0.5rem;
}

/* ==================== INVENTORY SIDEBAR ==================== */
.inventory-sidebar {
  background: var(--dark-800);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: 16px;
  padding: 2rem;
}

.inventory-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: rgba(245, 158, 11, 0.03);
  border: 1px solid rgba(245, 158, 11, 0.1);
  border-radius: 10px;
  margin-bottom: 1rem;
  transition: 0.3s;
}

.inventory-item:hover {
  background: rgba(245, 158, 11, 0.08);
  border-color: var(--primary);
}

.inventory-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.inventory-stock {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stock-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
}

.stock-status {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

.stock-status.ok {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.stock-status.low {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.stock-status.critical {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
  animation: pulse 2s ease-in-out infinite;
}

/* ==================== FOOTER CTA ==================== */
.demo-footer {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, var(--dark-800), var(--dark-900));
  margin-top: 4rem;
  border-top: 1px solid rgba(245, 158, 11, 0.2);
}

.footer-title {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 1rem;
}

.footer-subtitle {
  font-size: 1.25rem;
  color: var(--gray-400);
  margin-bottom: 2.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.footer-cta {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 3rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.3s;
  box-shadow: 0 10px 40px rgba(245, 158, 11, 0.3);
  text-decoration: none;
}

.footer-cta:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 60px rgba(245, 158, 11, 0.5);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .alerts-container {
    display: none;
  }
}

@media (max-width: 768px) {
  .dashboard {
    padding: 1.5rem;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .sale-item {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .chart {
    height: 200px;
  }
}

/* ==================== RESPONSIVE FIXES PRO ==================== */

/* Tablets */
@media (max-width: 1024px) {
  .dashboard {
    padding: 2rem;
  }

  .dashboard-header {
    gap: 1.5rem;
  }

  .chart {
    height: 240px;
  }

  .alerts-container {
    display: none;
  }
}

/* Mobile */
@media (max-width: 768px) {
  body {
    font-size: 15px;
  }

  .navbar {
    height: 64px;
  }

  .logo img {
    height: 40px;
  }

  .demo-hero {
    padding: 6rem 1.25rem 3rem;
  }

  .demo-title {
    font-size: clamp(2rem, 7vw, 2.8rem);
  }

  .demo-subtitle {
    font-size: 1.1rem;
  }

  .dashboard {
    padding: 1.25rem;
    border-radius: 18px;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .action-btn {
    width: 100%;
    text-align: center;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .metric-value {
    font-size: 2rem;
  }

  .sale-item {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .sale-time {
    text-align: left;
  }

  .sale-amount {
    font-size: 1.25rem;
  }

  .chart {
    height: 180px;
    gap: 0.5rem;
  }

  .chart-bar::before {
    font-size: 0.75rem;
  }

  .inventory-sidebar {
    padding: 1.25rem;
  }

  .footer-title {
    font-size: 2rem;
  }

  .footer-subtitle {
    font-size: 1.05rem;
  }

  .footer-cta {
    width: 100%;
    justify-content: center;
    padding: 1rem 2rem;
  }
}

/* Mobile pequeño */
@media (max-width: 480px) {
  .demo-title {
    font-size: 1.9rem;
  }

  .metric-card {
    padding: 1.25rem;
  }

  .metric-value {
    font-size: 1.8rem;
  }

  .chart {
    height: 150px;
  }

  .chart-label {
    font-size: 0.7rem;
  }
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

@media (max-width: 1200px) {
  .alerts-container {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .chart-bar:hover,
  .sale-item:hover {
    transform: none;
  }
}

.chart {
  overflow-x: hidden;
}

.dashboard,
.demo-container,
.demo-hero,
.navbar-container {
  max-width: 100%;
  overflow-x: hidden;
}
