:root {
  --primary-dark: #2d5a5a;
  --primary-medium: #4a7c7c;
  --primary-light: #a8b5a5;
  --accent-dark: #2c2c2c;
  --white: #ffffff;
  --light-gray: #f8f9fa;
  --medium-gray: #e9ecef;
  --dark-gray: #343a40;
  --text-dark: #212529;
  --text-light: #6c757d;
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --shadow: rgba(45, 90, 90, 0.1);
  --shadow-strong: rgba(45, 90, 90, 0.3);
  --gradient-primary: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-medium) 100%);
  --gradient-accent: linear-gradient(135deg, var(--accent-dark) 0%, var(--primary-dark) 100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--accent-dark);
  color: var(--white);
  overflow-x: hidden;
  min-height: 100vh;
}

/* Fondo Animado */
.animated-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: radial-gradient(ellipse at center, var(--primary-dark) 0%, var(--accent-dark) 70%);
}

.floating-shapes {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(168, 181, 165, 0.1);
  animation: float 20s infinite linear;
}

.shape-1 {
  width: 80px;
  height: 80px;
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.shape-2 {
  width: 120px;
  height: 120px;
  top: 60%;
  right: 15%;
  animation-delay: -5s;
}

.shape-3 {
  width: 60px;
  height: 60px;
  top: 80%;
  left: 20%;
  animation-delay: -10s;
}

.shape-4 {
  width: 100px;
  height: 100px;
  top: 30%;
  right: 30%;
  animation-delay: -15s;
}

.shape-5 {
  width: 140px;
  height: 140px;
  top: 10%;
  right: 50%;
  animation-delay: -7s;
}

@keyframes float {
  0% {
    transform: translateY(0px) rotate(0deg);
    opacity: 0.3;
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
    opacity: 0.6;
  }
  100% {
    transform: translateY(0px) rotate(360deg);
    opacity: 0.3;
  }
}

.grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(rgba(168, 181, 165, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 181, 165, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridMove 30s linear infinite;
}

@keyframes gridMove {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(50px, 50px);
  }
}

/* Header */
.main-header {
  padding: 20px 40px;
  background: rgba(44, 44, 44, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(168, 181, 165, 0.2);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--white);
  padding: 6px;
  box-shadow: 0 8px 24px var(--shadow-strong);
}

.logo-text h1 {
  font-size: 28px;
  font-weight: 800;
  background: white;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.tagline {
  font-size: 14px;
  color: var(--primary-light);
  font-weight: 500;
}

.status-section {
  display: flex;
  align-items: center;
  gap: 20px;
}

.ai-status {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(40, 167, 69, 0.2);
  border-radius: 20px;
  border: 1px solid var(--success);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
  }
}

.neural-animation {
  display: flex;
  gap: 4px;
}

.neural-node {
  width: 6px;
  height: 6px;
  background: var(--primary-light);
  border-radius: 50%;
  animation: neuralPulse 1.5s infinite;
}

.neural-node:nth-child(2) {
  animation-delay: 0.3s;
}

.neural-node:nth-child(3) {
  animation-delay: 0.6s;
}

@keyframes neuralPulse {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* Contenido Principal */
.main-content {
  padding: 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.chat-container {
  display: grid;
  grid-template-columns: 300px 1fr 300px;
  gap: 30px;
  height: calc(100vh - 200px);
}

/* Panel de Información */
.info-panel {
  background: rgba(44, 44, 44, 0.8);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid rgba(168, 181, 165, 0.2);
  box-shadow: 0 20px 40px var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(168, 181, 165, 0.2);
}

.panel-header i {
  font-size: 24px;
  color: var(--primary-light);
}

.panel-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.capabilities {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.capability-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(168, 181, 165, 0.1);
  border-radius: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.capability-item:hover {
  background: rgba(168, 181, 165, 0.2);
  transform: translateX(8px);
}

.capability-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 16px;
}

.capability-text h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.capability-text p {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.4;
}

/* Chat Frame */
.chat-frame {
  background: rgba(44, 44, 44, 0.9);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid rgba(168, 181, 165, 0.3);
  box-shadow: 0 20px 60px var(--shadow-strong);
  overflow: hidden;
  position: relative;
}

.frame-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--gradient-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.frame-controls {
  display: flex;
  gap: 8px;
}

.control-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.control-dot.red {
  background: #ff5f57;
}

.control-dot.yellow {
  background: #ffbd2e;
}

.control-dot.green {
  background: #28ca42;
}

.frame-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--white);
}

.frame-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

.stat-item i {
  color: var(--warning);
}

.iframe-container {
  position: relative;
  height: calc(100% - 60px);
}

#botpressChat {
  width: 100%;
  height: 100%;
  border: none;
  background: var(--white);
}

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  position: relative;
  width: 60px;
  height: 60px;
}

.spinner-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px solid transparent;
  border-top: 2px solid var(--primary-light);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner-ring:nth-child(2) {
  width: 80%;
  height: 80%;
  top: 10%;
  left: 10%;
  animation-delay: -0.3s;
  border-top-color: var(--primary-medium);
}

.spinner-ring:nth-child(3) {
  width: 60%;
  height: 60%;
  top: 20%;
  left: 20%;
  animation-delay: -0.6s;
  border-top-color: var(--primary-dark);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Panel de Estadísticas */
.stats-panel {
  background: rgba(44, 44, 44, 0.8);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid rgba(168, 181, 165, 0.2);
  box-shadow: 0 20px 40px var(--shadow);
}

.stats-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(168, 181, 165, 0.1);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.stat-card:hover {
  background: rgba(168, 181, 165, 0.2);
  transform: scale(1.02);
}

.stat-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 16px;
}

.stat-content {
  flex: 1;
}

.stat-number {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-light);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-light);
}

/* Footer */
.main-footer {
  padding: 20px 40px;
  background: rgba(44, 44, 44, 0.9);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(168, 181, 165, 0.2);
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.footer-left p {
  color: var(--text-light);
  font-size: 14px;
}

.tech-badges {
  display: flex;
  gap: 12px;
}

.tech-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(168, 181, 165, 0.2);
  border-radius: 16px;
  font-size: 12px;
  color: var(--primary-light);
  border: 1px solid rgba(168, 181, 165, 0.3);
}

.tech-badge i {
  font-size: 10px;
}

/* Responsive */
@media (max-width: 1200px) {
  .chat-container {
    grid-template-columns: 250px 1fr 250px;
    gap: 20px;
  }
}

@media (max-width: 992px) {
  .chat-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 20px;
  }

  .info-panel,
  .stats-panel {
    order: 2;
  }

  .chat-frame {
    order: 1;
    height: 600px;
  }

  .capabilities,
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 20px;
  }

  .header-content {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .capabilities,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}
