/* Variables de color y tipografía */
:root {
    --primary-color: #2563EB; /* Azul profesional */
    --secondary-color: #1E293B; /* Azul oscuro/Gris */
    --accent-color: #3B82F6;
    --text-color: #334155;
    --bg-light: #F8FAFC;
    --white: #ffffff;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.logo .accent {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary-color);
}

.btn-nav {
    background: var(--primary-color);
    color: white !important;
    padding: 8px 20px;
    border-radius: 5px;
}

.btn-nav:hover {
    background: var(--secondary-color);
}

.menu-toggle {
    display: none;
    cursor: pointer;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    text-align: center;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding-top: 70px;
}

.hero-content h1 {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 40px;
    color: #475569;
}

.hero-btns {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn {
    padding: 12px 30px;
    border-radius: 6px;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

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

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background: #eff6ff;
}

/* Secciones Generales */
.section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.2rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

/* Servicios Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.card h3 {
    margin-bottom: 15px;
    color: var(--secondary-color);
}

/* Beneficios */
.bg-light {
    background-color: var(--bg-light);
}

.split-layout {
    display: flex;
    align-items: center;
    gap: 50px;
}

.split-content, .split-image {
    flex: 1;
}

.split-content h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--secondary-color);
}

.benefits-list li {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.placeholder-img {
    width: 100%;
    height: 300px;
    background: #cbd5e1;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #64748b;
}

/* Contacto */
.contact-container {
    display: flex;
    gap: 50px;
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.contact-text {
    flex: 1;
}

.contact-form {
    flex: 1;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: inherit;
}

.full-width {
    width: 100%;
}

/* Footer */
footer {
    background: var(--secondary-color);
    color: white;
    padding: 40px 0;
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.socials a {
    margin-left: 20px;
    color: #94a3b8;
}

.socials a:hover {
    color: white;
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: white;
        padding: 20px 0;
        box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    }

    .nav-links.active {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    .bar {
        display: block;
        width: 25px;
        height: 3px;
        margin: 5px auto;
        background-color: var(--secondary-color);
    }

    .hero-content h1 {
        font-size: 2rem;
    }

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

    .split-layout, .contact-container, .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .contact-text {
        margin-bottom: 30px;
    }
}

/* ===========================
   CHATBOT WIDGET STYLES
   =========================== */

/* Contenedor principal del widget */
#chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

/* Botón flotante del chat */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0b76ff 0%, #0056cc 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(11, 118, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(11, 118, 255, 0.5);
}

.chatbot-toggle svg {
    color: white;
    transition: all 0.3s ease;
}

.chatbot-toggle .close-icon {
    display: none;
    position: absolute;
}

.chatbot-toggle.active .chat-icon {
    display: none;
}

.chatbot-toggle.active .close-icon {
    display: block;
}

/* Indicador de notificación */
.chatbot-toggle::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border: 2px solid white;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

/* Ventana del chat */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 550px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chatbot-window.active {
    display: flex;
}

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

/* Header del chat */
.chatbot-header {
    background: linear-gradient(135deg, #0b76ff 0%, #0056cc 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.chatbot-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.chatbot-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chatbot-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
}

/* Área de mensajes */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* Mensajes individuales */
.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    animation: messageSlide 0.3s ease;
}

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

.bot-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
}

.message-content {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 16px;
    line-height: 1.6;
}

.bot-message .message-content {
    background: white;
    color: #1e293b;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.user-message .message-content {
    background: #0b76ff;
    color: white;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
    padding: 0 4px;
}

/* Respuestas rápidas */
.chatbot-quick-replies {
    padding: 12px 20px;
    display: flex;
    gap: 8px;
    background: white;
    border-top: 1px solid #e2e8f0;
    overflow-x: auto;
}

.chatbot-quick-replies::-webkit-scrollbar {
    height: 4px;
}

.chatbot-quick-replies::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.quick-reply {
    padding: 8px 14px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.quick-reply:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

/* Input del chat */
.chatbot-input-container {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.chatbot-input:focus {
    border-color: #0b76ff;
    box-shadow: 0 0 0 3px rgba(11, 118, 255, 0.1);
}

.chatbot-send {
    width: 44px;
    height: 44px;
    background: #0b76ff;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chatbot-send:hover {
    background: #0056cc;
    transform: scale(1.05);
}

.chatbot-send:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}

/* Indicador de escritura */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

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

/* Responsive para móviles */
@media (max-width: 768px) {
    #chatbot-widget {
        bottom: 15px;
        right: 15px;
    }

    .chatbot-toggle {
        width: 56px;
        height: 56px;
    }

    .chatbot-window {
        width: calc(100vw - 30px);
        height: calc(100vh - 100px);
        bottom: 75px;
    }

    .quick-reply {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* ====== BLOG STYLES ====== */

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

/* Blog Card */
.blog-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.blog-card.featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.blog-card.featured .blog-card-image {
    height: 100%;
    min-height: 300px;
}

.blog-card-image {
    position: relative;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-card-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 4rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
}

.blog-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #f59e0b;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.blog-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.blog-card-date,
.blog-card-read-time {
    display: flex;
    align-items: center;
    gap: 4px;
}

.blog-card-tags {
    color: var(--primary-color);
    font-weight: 500;
}

.blog-card-category {
    display: inline-block;
    background: var(--bg-light);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.blog-card-content h3 {
    font-size: 1.25rem;
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.blog-card-content p {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.6;
    flex: 1;
    margin-bottom: 1rem;
}

.blog-card .read-more {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.blog-card .read-more:hover {
    color: var(--accent-color);
}

/* Blog Post Individual */
.back-to-blog {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 2rem;
    transition: color 0.2s ease;
}

.back-to-blog:hover {
    color: var(--accent-color);
}

.blog-post-article {
    max-width: 800px;
    margin: 0 auto;
}

.blog-post-hero {
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.blog-post-hero img {
    width: 100%;
    height: auto;
    max-height: 450px;
    object-fit: cover;
}

.blog-post-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.blog-post-category {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.blog-post-title {
    font-size: 2.5rem;
    color: var(--secondary-color);
    line-height: 1.3;
    margin-bottom: 1rem;
}

.blog-post-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    color: #64748b;
    font-size: 0.9rem;
}

.blog-post-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.blog-post-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
}

.blog-tag {
    background: var(--bg-light);
    color: var(--primary-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.blog-tag:hover {
    background: var(--primary-color);
    color: white;
}

/* Blog Post Content - Markdown Styles */
.blog-post-content.markdown-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
}

.blog-post-content h1,
.blog-post-content h2,
.blog-post-content h3 {
    color: var(--secondary-color);
    margin: 2rem 0 1rem;
}

.blog-post-content h2 {
    font-size: 1.75rem;
    border-bottom: 2px solid var(--bg-light);
    padding-bottom: 0.5rem;
}

.blog-post-content h3 {
    font-size: 1.35rem;
}

.blog-post-content p {
    margin-bottom: 1.5rem;
}

.blog-post-content ul,
.blog-post-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
    list-style: disc;
}

.blog-post-content li {
    margin-bottom: 0.5rem;
}

.blog-post-content blockquote {
    border-left: 4px solid var(--primary-color);
    background: var(--bg-light);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #475569;
}

.blog-post-content code {
    background: #1e293b;
    color: #e2e8f0;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
}

.blog-post-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.blog-post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.blog-post-content th,
.blog-post-content td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.blog-post-content th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.blog-post-content tr:nth-child(even) {
    background: var(--bg-light);
}

.blog-post-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    margin: 3rem 0;
}

.blog-post-content a {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: rgba(37, 99, 235, 0.3);
    transition: all 0.2s ease;
}

.blog-post-content a:hover {
    text-decoration-color: var(--primary-color);
}

.blog-post-content strong {
    color: var(--secondary-color);
    font-weight: 600;
}

/* Blog Navigation */
.blog-post-navigation {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: center;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.blog-nav-post {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.blog-nav-post.prev {
    text-align: left;
}

.blog-nav-post.next {
    text-align: right;
}

.blog-nav-post.center {
    text-align: center;
}

.blog-nav-label {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 500;
}

.blog-nav-post a {
    color: var(--secondary-color);
    font-weight: 600;
    transition: color 0.2s ease;
}

.blog-nav-post a:hover {
    color: var(--primary-color);
}

/* Blog Responsive */
@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
        padding: 1rem 0;
    }

    .blog-card.featured {
        grid-template-columns: 1fr;
    }

    .blog-card.featured .blog-card-image {
        min-height: 200px;
    }

    .blog-post-title {
        font-size: 1.75rem;
    }

    .blog-post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .blog-post-navigation {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .blog-nav-post.prev,
    .blog-nav-post.next {
        text-align: center;
    }
}
