/* =========================================
   VARIABLES DE COLOR Y DISEÑO (DARK AI/DATA THEME)
   ========================================= */
:root {
    --bg-dark: #07090E;
    --surface: rgba(15, 20, 31, 0.6);
    --surface-hover: rgba(26, 35, 50, 0.8);
    --neon-cyan: #00E5FF;
    --neon-blue: #2962FF;
    --neon-purple: #B388FF;
    --text-main: #F3F4F6;
    --text-muted: #9CA3AF;
    --border-glass: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(16px);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Fondo animado estilo tech / glowing ambient light */
body::before {
    content: '';
    position: fixed;
    top: -20%;
    left: -10%;
    width: 60%;
    height: 80%;
    background: radial-gradient(circle, rgba(41, 98, 255, 0.15) 0%, rgba(7, 9, 14, 0) 70%);
    z-index: -1;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    right: -10%;
    width: 60%;
    height: 80%;
    background: radial-gradient(circle, rgba(0, 229, 255, 0.1) 0%, rgba(7, 9, 14, 0) 70%);
    z-index: -1;
    pointer-events: none;
}

h1, h2, h3, h4, .logo {
    font-family: 'Outfit', sans-serif;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* =========================================
   NAVEGACIÓN (NAVBAR)
   ========================================= */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 3rem;
    background: rgba(7, 9, 14, 0.7);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-glass);
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
}

.cursor-blink {
    color: var(--neon-cyan);
    animation: blink 1s step-end infinite;
    margin-left: 2px;
}

@keyframes blink {
    50% { opacity: 0; }
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-main);
}

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

.menu button {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu button:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.menu button.btn-glow {
    color: #07090E;
    background: var(--neon-cyan);
    font-weight: 600;
    margin-left: 0.5rem;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
}

.menu button.btn-glow:hover {
    background: #fff;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.6);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .navbar {
        padding: 1rem 1.5rem;
    }
    .menu-toggle {
        display: block;
    }
    .menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(7, 9, 14, 0.95);
        backdrop-filter: var(--glass-blur);
        padding: 1rem 0;
        border-bottom: 1px solid var(--border-glass);
    }
    .menu.active {
        display: flex;
    }
    .menu button.btn-glow {
        margin-left: 0;
    }
}

/* =========================================
   CONTENEDOR PRINCIPAL
   ========================================= */
main {
    flex: 1;
    padding: 8rem 2rem 4rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    animation: fadeIn 0.8s ease-out;
}

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

/* =========================================
   HERO / INICIO
   ========================================= */
.hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-height: 70vh;
    padding-bottom: 4rem;
}

.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    background: rgba(0, 229, 255, 0.1);
    color: var(--neon-cyan);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 229, 255, 0.2);
}

.hero h1 {
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #FFF 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero h1 span {
    background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 800px;
    margin-bottom: 2.5rem;
    font-weight: 300;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-primary {
    background: var(--text-main);
    color: var(--bg-dark);
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255,255,255,0.2);
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-glass);
    padding: 0.8rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--text-muted);
}

/* =========================================
   GRID LAYOUTS (Servicios, Blog)
   ========================================= */
.section-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    font-weight: 600;
    color: var(--text-main);
}

.section-title span {
    color: var(--neon-cyan);
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    padding: 2rem;
    border-radius: 1rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

.card:hover {
    background: var(--surface-hover);
    transform: translateY(-5px);
    border-color: rgba(0, 229, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 229, 255, 0.1);
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.card p {
    color: var(--text-muted);
    flex: 1;
    font-size: 0.95rem;
}

/* Specific styling for blog post cards */
.post-card {
    cursor: pointer;
}

.post-card .categoria {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--neon-purple);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.post-card small {
    display: block;
    margin-top: 1rem;
    color: #6B7280;
    font-size: 0.85rem;
}

/* =========================================
   POST COMPLETO (MARKDOWN RENDERING)
   ========================================= */
.btn-volver {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s;
}

.btn-volver:hover {
    color: var(--text-main);
}

.post-completo {
    background: var(--surface);
    backdrop-filter: var(--glass-blur);
    padding: 3rem;
    border-radius: 1rem;
    border: 1px solid var(--border-glass);
    animation: fadeIn 0.5s ease-out;
}

@media (max-width: 768px) {
    .post-completo { padding: 1.5rem; }
}

.post-completo h1 { font-size: 2.5rem; margin-bottom: 1.5rem; color: var(--text-main); line-height: 1.2; }
.post-completo h2 { font-size: 1.8rem; margin-top: 2.5rem; margin-bottom: 1rem; color: var(--text-main); }
.post-completo h3 { font-size: 1.4rem; margin-top: 2rem; margin-bottom: 1rem; color: var(--text-main); }
.post-completo p { margin-bottom: 1.5rem; font-size: 1.1rem; color: var(--text-muted); }
.post-completo ul, .post-completo ol { margin-bottom: 1.5rem; padding-left: 1.5rem; color: var(--text-muted); font-size: 1.1rem; }
.post-completo li { margin-bottom: 0.5rem; }
.post-completo blockquote {
    border-left: 3px solid var(--neon-cyan);
    background: rgba(0, 229, 255, 0.05);
    padding: 1rem 1.5rem;
    border-radius: 0 0.5rem 0.5rem 0;
    margin-bottom: 1.5rem;
    font-style: italic;
    color: var(--text-muted);
}
.post-completo code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: monospace;
    font-size: 0.9em;
    color: var(--neon-cyan);
}
.post-completo pre {
    background: #0D1117;
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-glass);
}
.post-completo pre code {
    background: transparent;
    padding: 0;
    color: #E6EDF3;
}
.post-completo img {
    max-width: 100%;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

/* =========================================
   FORMULARIOS Y CHATBOT
   ========================================= */
.form-container {
    max-width: 600px;
    background: var(--surface);
    backdrop-filter: var(--glass-blur);
    padding: 2.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border-glass);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 0.8rem 1rem;
    border-radius: 0.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--neon-blue);
    box-shadow: 0 0 0 2px rgba(41, 98, 255, 0.2);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Chatbot UI Container */
.chat-container {
    max-width: 800px;
    background: var(--surface);
    border: 1px solid var(--border-glass);
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    height: 60vh;
    min-height: 500px;
    overflow: hidden;
    backdrop-filter: var(--glass-blur);
}

.chat-header {
    background: rgba(0,0,0,0.2);
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #000;
}

.chat-title h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-main);
}
.chat-title p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--neon-cyan);
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 80%;
    padding: 1rem;
    border-radius: 1rem;
    line-height: 1.5;
    font-size: 0.95rem;
}

.message.bot {
    align-self: flex-start;
    background: rgba(255,255,255,0.05);
    border-bottom-left-radius: 0;
    color: var(--text-main);
}

.message.user {
    align-self: flex-end;
    background: rgba(41, 98, 255, 0.2);
    border: 1px solid rgba(41, 98, 255, 0.3);
    border-bottom-right-radius: 0;
    color: var(--text-main);
}

.chat-input-area {
    padding: 1rem;
    border-top: 1px solid var(--border-glass);
    background: rgba(0,0,0,0.2);
    display: flex;
    gap: 0.5rem;
}

.chat-input-area input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
    padding: 0.8rem 1rem;
    border-radius: 2rem;
    color: var(--text-main);
    font-family: inherit;
}

.chat-input-area input:focus {
    outline: none;
    border-color: var(--neon-cyan);
}

.chat-input-area button {
    background: var(--neon-cyan);
    color: #000;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.chat-input-area button:hover {
    transform: scale(1.05);
    background: #fff;
}

/* =========================================
   FOOTER
   ========================================= */
footer {
    text-align: center;
    padding: 2rem;
    background: rgba(7, 9, 14, 0.8);
    border-top: 1px solid var(--border-glass);
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: auto;
}