/* Variables de Color */
:root {
  --color-primary-red: #e6332a;
  --color-primary-orange: #e94e1b;
  --color-primary-purple: #812584;
  --color-primary-dark-purple: #29235c;
  --color-secondary-red: #be1622;
  --color-secondary-purple: #662483;
  
  --bg-dark: #0a0a14;
  --bg-darker: #050509;
  --surface: #1a1a2e;
  --text-light: #f5f5f5;
  --text-muted: #b0b0b0;
  --border-color: rgba(230, 51, 42, 0.2);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 50%, #1a0f28 100%);
  color: var(--text-light);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(10, 10, 20, 0.95);
  backdrop-filter: blur(15px);
  border-bottom: 2px solid var(--border-color);
  z-index: 1000;
  padding: 1rem 0;
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.logo {
  height: 50px;
  width: auto;
  filter: drop-shadow(0 0 8px rgba(230, 51, 42, 0.3));
}

.brand-text {
  font-weight: bold;
  font-size: 1.1rem;
  background: linear-gradient(90deg, var(--color-primary-orange), var(--color-primary-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover {
  color: var(--color-primary-orange);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary-orange), var(--color-primary-purple));
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.cta-nav {
  padding: 0.8rem 1.5rem;
  border: 2px solid var(--color-primary-orange);
  border-radius: 50px;
  color: var(--color-primary-orange);
}

.cta-nav:hover {
  background: var(--color-primary-orange);
  color: white;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(233, 78, 27, 0.15) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  animation: float 20s ease-in-out infinite;
}

.hero::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(129, 37, 132, 0.15) 0%, transparent 70%);
  bottom: -250px;
  left: -250px;
  animation: float 25s ease-in-out infinite reverse;
}

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

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 800px;
  text-align: center;
  padding: 2rem;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  animation: fadeInUp 1s ease-out;
}

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

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

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

.hero-subtitle {
  font-size: 1.3rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-buttons {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 1s ease-out 0.4s both;
}

.btn {
  padding: 1rem 2.5rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  display: inline-block;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary-orange), var(--color-primary-red));
  color: white;
  box-shadow: 0 10px 30px rgba(233, 78, 27, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(233, 78, 27, 0.5);
}

.btn-secondary {
  border: 2px solid var(--color-primary-purple);
  color: var(--color-primary-purple);
  background: transparent;
}

.btn-secondary:hover {
  background: var(--color-primary-purple);
  color: white;
  transform: translateY(-3px);
}

.btn-large {
  padding: 1.2rem 3rem;
  font-size: 1.1rem;
}

.hero-decoration {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.floating-element {
  position: absolute;
  font-size: 8rem;
  font-weight: bold;
  opacity: 0.05;
  animation: drift 15s ease-in-out infinite;
}

.floating-element:nth-child(1) {
  top: 10%;
  left: 5%;
  animation-delay: 0s;
}

.floating-element:nth-child(2) {
  top: 50%;
  right: 10%;
  animation-delay: 5s;
}

.floating-element:nth-child(3) {
  bottom: 10%;
  left: 15%;
  animation-delay: 10s;
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(20px, -20px) rotate(90deg); }
  50% { transform: translate(0, 30px) rotate(180deg); }
  75% { transform: translate(-20px, -10px) rotate(270deg); }
}

/* Section Header */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header h2 {
  font-size: 3rem;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, var(--color-primary-orange), var(--color-primary-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Servicios Section */
.servicios {
  max-width: 1200px;
  margin: 6rem auto;
  padding: 0 2rem;
}

.servicios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.service-card {
  background: rgba(26, 26, 46, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  padding: 2rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(233, 78, 27, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.service-card:hover {
  transform: translateY(-10px);
  border-color: var(--color-primary-orange);
  box-shadow: 0 20px 40px rgba(233, 78, 27, 0.2);
}

.service-card:hover::before {
  top: -30%;
  right: -30%;
}

.service-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: inline-block;
  width: 70px;
  height: 70px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-icon.purple {
  background: rgba(129, 37, 132, 0.2);
  border: 2px solid var(--color-primary-purple);
}

.service-icon.orange {
  background: rgba(233, 78, 27, 0.2);
  border: 2px solid var(--color-primary-orange);
}

.service-icon.red {
  background: rgba(230, 51, 42, 0.2);
  border: 2px solid var(--color-primary-red);
}

.service-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-light);
}

.service-card p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.service-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.service-list li {
  color: var(--text-muted);
  padding-left: 1.5rem;
  position: relative;
}

.service-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-primary-orange);
  font-weight: bold;
}

/* Portfolio Section */
.portafolio {
  max-width: 1200px;
  margin: 6rem auto;
  padding: 0 2rem;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.portfolio-item {
  border-radius: 15px;
  overflow: hidden;
  cursor: pointer;
  group: group;
  transition: all 0.3s ease;
}

.portfolio-image {
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: 15px 15px 0 0;
  transition: all 0.3s ease;
  position: relative;
}

.gradient-1 {
  background: linear-gradient(135deg, var(--color-primary-orange), var(--color-primary-red));
}

.gradient-2 {
  background: linear-gradient(135deg, var(--color-primary-purple), var(--color-secondary-purple));
}

.gradient-3 {
  background: linear-gradient(135deg, var(--color-secondary-red), var(--color-primary-orange));
}

.portfolio-info {
  background: rgba(26, 26, 46, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 0 0 15px 15px;
  padding: 1.5rem;
  backdrop-filter: blur(10px);
}

.portfolio-info h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--text-light);
}

.portfolio-info p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.portfolio-tag {
  display: inline-block;
  background: linear-gradient(90deg, rgba(233, 78, 27, 0.2), rgba(129, 37, 132, 0.2));
  color: var(--color-primary-orange);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
}

.portfolio-item:hover .portfolio-image {
  transform: scale(1.05);
}

/* CTA Section */
.cta-section {
  max-width: 1000px;
  margin: 6rem auto;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, rgba(233, 78, 27, 0.1), rgba(129, 37, 132, 0.1));
  border: 2px solid var(--border-color);
  border-radius: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-primary-orange), transparent);
}

.cta-content h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-light);
}

.cta-content p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

/* Footer */
.footer {
  background: rgba(10, 10, 20, 0.9);
  border-top: 2px solid var(--border-color);
  margin-top: 6rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.footer-section h4 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, var(--color-primary-orange), var(--color-primary-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-section p {
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.8rem;
}

.footer-section ul li a {
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.3s ease;
}

.footer-section ul li a:hover {
  color: var(--color-primary-orange);
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-link {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary-orange);
  text-decoration: none;
  font-size: 0.8rem;
  transition: all 0.3s ease;
}

.social-link:hover {
  background: var(--color-primary-orange);
  color: white;
  border-color: var(--color-primary-orange);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .navbar-container {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-menu {
    gap: 1rem;
  }

  .hero-buttons {
    flex-direction: column;
  }

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

  .section-header h2 {
    font-size: 2rem;
  }

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

  .cta-content h2 {
    font-size: 1.8rem;
  }
}

/* ============================================
   CHATBOT IA - Grupo Empresarial 180°
   ============================================ */

.chatbot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.chatbot-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary-orange), var(--color-primary-red));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 8px 32px rgba(233, 78, 27, 0.4);
  transition: all 0.3s ease;
  position: relative;
}

.chatbot-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 40px rgba(233, 78, 27, 0.5);
}

.chatbot-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--color-primary-purple);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 10px;
  animation: pulse 2s infinite;
}

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

.chatbot-window {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 520px;
  max-height: calc(100vh - 100px);
  background: var(--bg-dark);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  visibility: hidden;
}

.chatbot-window.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
}

.chatbot-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--color-primary-orange), var(--color-primary-red));
  color: white;
}

.chatbot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-title {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chatbot-title strong {
  font-size: 15px;
}

.chatbot-title span {
  font-size: 12px;
  opacity: 0.8;
}

.chatbot-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: white;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.chatbot-close:hover {
  opacity: 1;
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.chatbot-message {
  display: flex;
  gap: 10px;
}

.chatbot-message.user {
  flex-direction: row-reverse;
}

.message-content {
  max-width: 85%;
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
}

.chatbot-message.bot .message-content {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
  color: var(--text-light);
}

.chatbot-message.user .message-content {
  background: linear-gradient(135deg, var(--color-primary-orange), var(--color-primary-red));
  color: white;
  border-bottom-right-radius: 4px;
}

.message-content p {
  margin: 0 0 10px;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 20px 4px;
  margin-top: 0;
}

.quick-action {
  background: rgba(233, 78, 27, 0.15);
  border: 1px solid var(--border-color);
  color: var(--color-primary-orange);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-action:hover {
  background: rgba(233, 78, 27, 0.25);
  border-color: var(--color-primary-orange);
}

.chatbot-input-area {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  background: var(--bg-darker);
  border-top: 1px solid var(--border-color);
}

#chatbot-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 25px;
  padding: 12px 18px;
  color: var(--text-light);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

#chatbot-input:focus {
  border-color: var(--color-primary-orange);
}

#chatbot-input::placeholder {
  color: #666;
}

.chatbot-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary-orange), var(--color-primary-red));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.2s ease;
}

.chatbot-send:hover {
  transform: scale(1.05);
}

.chatbot-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 14px 18px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--color-primary-orange);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* Responsive */
@media (max-width: 480px) {
  .chatbot-widget {
    bottom: 16px;
    right: 16px;
  }
  
  .chatbot-window {
    width: calc(100vw - 32px);
    height: calc(100vh - 80px);
    bottom: 68px;
  }
}
