/* ==========================================================================
   1. VARIABLES Y PALETA DE COLORES (Dark Theme / Estilo TikTok)
   ========================================================================== */
:root {
    --bg-base: #010101;
    --bg-card: rgba(255, 255, 255, 0.05);
    --texto-principal: #FFFFFF;
    --texto-secundario: #A6A6A6;
    --acento-cyan: #00F7EF;
    --acento-magenta: #FF0050;
    --borde-card: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   2. RESET Y TIPOGRAFÍA
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    background-color: var(--bg-base);
    color: var(--texto-principal);
    overflow-x: hidden;
    line-height: 1.6;
}

h1 { font-size: 48px; font-weight: 700; letter-spacing: -0.5px; line-height: 1.1; margin-bottom: 16px; }
h2 { font-size: 36px; font-weight: 700; letter-spacing: -0.3px; margin-bottom: 24px; }
h3 { font-size: 24px; font-weight: 600; letter-spacing: 0px; margin-bottom: 12px; }
p { font-size: 16px; font-weight: 400; letter-spacing: 0.5px; color: var(--texto-secundario); margin-bottom: 24px; }
.tag { font-size: 14px; font-weight: 500; letter-spacing: 0.2px; display: inline-block; padding: 6px 16px; border-radius: 20px; color: var(--acento-cyan); background: rgba(0, 247, 239, 0.1); margin-bottom: 16px;}

/* ==========================================================================
   3. ANIMACIONES Y EFECTOS
   ========================================================================== */
@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes tiltRotate {
    0% { transform: perspective(1000px) rotateX(0deg) rotateY(0deg); }
    50% { transform: perspective(1000px) rotateX(2deg) rotateY(-2deg); }
    100% { transform: perspective(1000px) rotateX(0deg) rotateY(0deg); }
}

.tiktok-glow {
    text-shadow: 2px 2px 0px var(--acento-magenta), -2px -2px 0px var(--acento-cyan);
}

/* ==========================================================================
   4. COMPONENTES (Cards y Botones)
   ========================================================================== */
.card {
    background: var(--bg-card);
    border-radius: 24px;
    border: 1px solid var(--borde-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 32px;
    transition: all 300ms ease-in-out;
    will-change: transform;
    position: relative;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 8px 32px rgba(0, 247, 239, 0.15);
    border-color: rgba(0, 247, 239, 0.3);
}

.animated-card {
    animation: fadeInScale 600ms ease-out forwards;
}

.animated-card:hover {
    animation: tiltRotate 6s ease-in-out infinite;
}

/* Botones */
.btn {
    padding: 14px 32px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 300ms ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: none;
}

.btn-primary {
    background: var(--acento-magenta);
    color: var(--texto-principal);
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 0, 80, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--acento-cyan);
    border: 2px solid var(--acento-cyan);
}

.btn-secondary:hover {
    background: var(--acento-cyan);
    color: var(--bg-base);
    box-shadow: 0 0 20px rgba(0, 247, 239, 0.4);
}

.icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--texto-principal);
    font-size: 28px;
    margin-bottom: 24px;
    transition: all 300ms;
}

.card:hover .icon-circle {
    background: rgba(0, 247, 239, 0.1);
    border-color: var(--acento-cyan);
    color: var(--acento-cyan);
    transform: scale(1.1);
}

/* ==========================================================================
   5. LAYOUT
   ========================================================================== */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: all 300ms;
}

.header-scrolled {
    background: rgba(1, 1, 1, 0.8);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--borde-card);
}

.logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 20px 40px;
    position: relative;
}

/* Orbes de luz de fondo (Efecto Neón) */
.neon-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    z-index: 0;
    animation: float 6s ease-in-out infinite alternate;
}

.orb-cyan {
    background: var(--acento-cyan);
    width: 300px;
    height: 300px;
    top: 20%;
    left: 10%;
}

.orb-magenta {
    background: var(--acento-magenta);
    width: 250px;
    height: 250px;
    bottom: 20%;
    right: 10%;
    animation-delay: -3s;
}

.hero-content {
    z-index: 2;
    max-width: 800px;
    animation: fadeInScale 800ms ease-out forwards;
}

/* Grillas */
.section {
    padding: 100px 5%;
    position: relative;
    z-index: 2;
}

.section-title {
    text-align: center;
    margin-bottom: 64px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Footer */
footer {
    text-align: center;
    padding: 60px 20px;
    border-top: 1px solid var(--borde-card);
    background: rgba(255,255,255,0.02);
    position: relative;
    z-index: 2;
}

/* ==========================================================================
   MODAL DE REGISTRO
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 450px;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.modal-overlay.active .modal-box {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 15px; right: 20px;
    background: none; border: none;
    color: #aaa; font-size: 1.5em;
    cursor: pointer;
}

.modal-close:hover { color: #fff; }

.modal-title-reg {
    font-size: 1.6em; margin-top: 0; margin-bottom: 20px;
    color: var(--acento-cyan);
    text-align: center;
    font-weight: 700;
}

.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-group label {
    display: block; margin-bottom: 5px; color: #ccc; font-size: 0.9em;
}

.form-group input {
    width: 100%; padding: 10px;
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px; color: #fff;
    outline: none; box-sizing: border-box;
    font-family: inherit;
}

.form-group input:focus {
    border-color: var(--acento-magenta);
}

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 36px; }
    h2 { font-size: 28px; }
    .card { padding: 24px; }
    .hero { padding-top: 140px; }
}



/* Chat Widget Styles */
.chat-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background: linear-gradient(45deg, var(--acento-cyan), var(--acento-magenta));
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  z-index: 100;
  transition: transform 0.2s ease-out;
}

.chat-bubble:hover {
  transform: scale(1.1);
}

.chat-bubble svg {
  width: 32px;
  height: 32px;
  color: white;
}

.chat-widget-container {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 350px;
  max-width: calc(100% - 32px);
  height: 500px; /* Fixed height for chat */
  max-height: 70vh;
  background: #18181d;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  z-index: 100;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0);
  transform-origin: bottom right;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-widget-container.show {
  transform: scale(1);
}

.chat-header {
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.chat-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.chat-header button {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.7;
}

.chat-header button:hover {
  opacity: 1;
}

.chat-messages {
  flex-grow: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Scrollbar styling for chat messages */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}

.message {
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 80%;
  line-height: 1.5;
  word-wrap: break-word;
}

.message li {
  margin-bottom: 4px;
}

.message b {
  color: #fff;
}

.bot-message {
  background: #2a2a32;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
  color: #e0e0e0;
}

.user-message {
  background: var(--acento-cyan);
  color: #111;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
  font-weight: 500;
}

/* Loading Dots */
.loading-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 12px 16px;
}
.loading-dots::after {
  content: '...';
  animation: typing 1.5s infinite;
  width: 12px;
  display: inline-block;
  text-align: left;
}

@keyframes typing {
  0% { content: '.'; }
  33% { content: '..'; }
  66% { content: '...'; }
}


/* Chat Suggestion Chips */
.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chat-chip {
  background: rgba(0, 240, 255, 0.10);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 20px;
  color: var(--acento-cyan);
  font-size: 12px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: inherit;
  white-space: nowrap;
}

.chat-chip:hover {
  background: rgba(0, 240, 255, 0.25);
  transform: scale(1.03);
}

.chat-input-form {
  display: flex;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px;
  flex-shrink: 0;
  gap: 8px;
}

.chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px;
  color: #fff;
  font-family: inherit;
  outline: none;
}

.chat-input:focus {
  border-color: var(--acento-cyan);
}

.chat-send-btn {
  background: var(--acento-magenta);
  border: none;
  border-radius: 8px;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: background 0.2s;
}

.chat-send-btn:hover {
  background: #cc0040;
}

/* Scroll Animation */
.scroll-section {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
  margin-bottom: 32px;
}

.scroll-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   6. AUTH MODAL TABS & UTILS
   ========================================================================== */
.modal-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 15px;
}

.modal-tab {
    background: none;
    border: none;
    color: #888;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 5px 10px;
    position: relative;
    transition: all 0.3s;
}

.modal-tab.active {
    color: var(--acento-cyan);
}

.modal-tab.active::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--acento-cyan);
    box-shadow: 0 0 10px var(--acento-cyan);
}

.form-group.hidden {
    display: none;
}
