/* ======================= Estilos Globales y Variables ======================= */
:root {
    --primary-color: #3498db;
    /* Azul moderno */
    --secondary-color: #2c3e50;
    /* Azul oscuro/gris */
    --accent-color: #e74c3c;
    /* Rojo/coral para acentos */
    --light-bg: #ecf0f1;
    /* Gris claro para fondos */
    --text-color: #34495e;
    /* Color de texto principal */
    --light-text-color: #ffffff;
    --border-radius: 8px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    line-height: 1.7;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    color: var(--secondary-color);
}

.section-title {
    font-weight: 700;
    font-size: 2.5rem;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

/* ======================= Barra de Navegación ======================= */
.navbar {
    background-color: rgba(44, 62, 80, 0.9);
    backdrop-filter: blur(10px);
    transition: background-color 0.3s ease-in-out;
}

.navbar .navbar-brand {
    font-weight: 700;
}

.navbar .nav-link {
    font-weight: 600;
    transition: color 0.3s;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--primary-color) !important;
}

/* ======================= Sección de Inicio (Hero) ======================= */
.hero-section {
    background: linear-gradient(rgba(44, 62, 80, 0.7), rgba(44, 62, 80, 0.7)), url('https://via.placeholder.com/1920x1080/2c3e50/ffffff?text=Fondo+Abstracto') no-repeat center center/cover;
    min-height: 100vh;
    color: var(--light-text-color);
}

.hero-section h1 {
    color: var(--light-text-color);
}

.profile-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid var(--primary-color);
    object-fit: cover;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.info-card {
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--border-radius);
    color: var(--light-text-color);
}

.info-card a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}

/* ======================= Tarjetas de Proyecto ======================= */
.project-card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.project-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

.btn-primary-custom {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--light-text-color);
    transition: background-color 0.3s, transform 0.2s;
}

.btn-primary-custom:hover {
    background-color: #2980b9;
    /* Un azul un poco más oscuro */
    border-color: #2980b9;
    transform: scale(1.05);
}

/* ======================= Secciones Interactivas ======================= */
#database .results-container {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    padding: 15px;
    min-height: 150px;
    max-height: 300px;
    overflow-y: auto;
}

#rubricOutput table {
    margin-top: 20px;
}

/* ======================= Chatbots ======================= */
/* Chatbot Embebido (MCP) */
.chatbot-container-inline {
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px;
    height: 400px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}

.message {
    padding: 8px 12px;
    border-radius: 18px;
    margin-bottom: 10px;
    max-width: 80%;
}

.user-message {
    background-color: var(--primary-color);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.bot-message {
    background-color: #ecf0f1;
    color: var(--text-color);
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

/* Chatbot Flotante */
#chatbot-toggler {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: transform 0.3s;
}

#chatbot-toggler:hover {
    transform: scale(1.1);
}

#chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 450px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 999;
    transition: opacity 0.3s, transform 0.3s;
    transform-origin: bottom right;
}

#chatbot-window.hidden {
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
}

.chatbot-header {
    background-color: var(--secondary-color);
    color: white;
    padding: 10px 15px;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header #close-chatbot {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.chatbot-body {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.chatbot-footer {
    display: flex;
    padding: 10px;
    border-top: 1px solid #eee;
}

#chatbot-input {
    flex-grow: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 15px;
    margin-right: 10px;
}

#chatbot-send {
    background-color: var(--primary-color);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
}

/* ======================= Pie de Página ======================= */
footer {
    background-color: var(--secondary-color);
    color: var(--light-bg);
}

/* ======================= Clases de Utilidad y Responsividad ======================= */
.bg-light {
    background-color: var(--light-bg) !important;
}

@media (max-width: 992px) {
    .hero-section {
        padding-top: 100px;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }

    #chatbot-window {
        width: 90%;
        height: 70%;
        right: 5%;
        bottom: 90px;
    }
}