/* --- Variables Globales (Estética Impecable) --- */
:root {
    --primary-color: #6a11cb;
    --secondary-color: #2575fc;
    --text-color: #333;
    --text-light: #f4f4f4;
    --bg-color: #ffffff;
    --bg-light: #f9f9f9;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --font-main: 'Poppins', sans-serif;
    --base-font-size: 16px;
    --h1-size: 2.5rem;
    --h2-size: 2rem;
    --h3-size: 1.25rem;
}

/* --- Reseteo Básico --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    font-size: var(--base-font-size);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Hero Section --- */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
    padding: 100px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.9;
}

.hero h1 {
    font-size: var(--h1-size);
    font-weight: 700;
    margin-bottom: 15px;
}

.hero .subtitle {
    font-size: 1.15rem;
    font-weight: 300;
    max-width: 700px;
    margin: 0 auto 30px auto;
    opacity: 0.9;
}

.cta-button {
    display: inline-block;
    background-color: var(--bg-color);
    color: var(--primary-color);
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-3px);
    background-color: #f0f0f0;
}

/* --- Features Section --- */
.features {
    padding: 80px 0;
    background-color: var(--bg-light);
    text-align: center;
}

.features h2 {
    font-size: var(--h2-size);
    font-weight: 600;
    margin-bottom: 50px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.feature-card {
    background-color: var(--bg-color);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: var(--h3-size);
    font-weight: 600;
    margin-bottom: 10px;
}

/* --- Portfolio Promo Section (ELIMINADA) --- */
/* .portfolio-promo { ... } */
/* .demo-link { ... } */


/* --- Chatbot IA --- */
.chat-icon {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transition: transform 0.3s ease;
}

.chat-icon:hover {
    transform: scale(1.1);
}

.chat-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    max-width: 90%;
    height: 450px;
    background-color: var(--bg-color);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Oculto por defecto */
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-container.visible {
    transform: scale(1) translateY(0);
    opacity: 1;
    visibility: visible;
}

.chat-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.chat-close:hover {
    opacity: 1;
}

.chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
}

.message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.message p {
    padding: 10px 15px;
    border-radius: 18px;
    line-height: 1.4;
    font-size: 0.95rem;
    max-width: 85%;
}

.user-message p {
    background-color: var(--secondary-color);
    color: white;
    border-bottom-right-radius: 5px;
    align-self: flex-end;
}

.ai-message p {
    background-color: #e9e9eb;
    color: var(--text-color);
    border-bottom-left-radius: 5px;
    align-self: flex-start;
}

.ai-message.loading p {
    font-style: italic;
    color: #888;
}

.chat-input-area {
    display: flex;
    border-top: 1px solid #ddd;
    padding: 10px;
}

#messageInput {
    flex-grow: 1;
    border: none;
    padding: 10px;
    border-radius: 20px;
    background-color: #f0f0f0;
    font-size: 0.9rem;
    font-family: var(--font-main);
}

#messageInput:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-color_trans);
}

#sendBtn {
    background-color: var(--primary-color);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1rem;
    margin-left: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#sendBtn:hover {
    background-color: var(--secondary-color);
}

/* --- Responsive (UX/UI) --- */
@media (max-width: 768px) {
    :root {
        --h1-size: 2.2rem;
        --h2-size: 1.8rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 80px 0;
    }
}

@media (max-width: 480px) {
    .chat-container {
        width: 100%;
        height: 100%;
        max-width: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
}