@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

:root {
    --primary: #D32F2F;
    --primary-dark: #B71C1C;
    --secondary: #2c3e50;
    --text: #333;
    --text-light: #666;
    --white: #ffffff;
    --bg: #fdfdfd;
}

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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.text-center { text-align: center; }
.mr-2 { margin-right: 0.5rem; }

/* Navigation */
.top-nav {
    padding: 1.5rem 0;
    background: var(--white);
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 100;
}

.gob-logo {
    height: 40px;
    margin-right: 15px;
    /* Filtro para convertir negro a Rojo Institucional (#D32F2F) */
    filter: invert(24%) sepia(91%) saturate(2341%) hue-rotate(346deg) brightness(91%) contrast(92%);
}

.mimp-text {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.2rem;
    border-left: 2px solid #ddd;
    padding-left: 15px;
}

.links a {
    text-decoration: none;
    color: var(--text);
    margin-left: 2rem;
    font-weight: 500;
    font-size: 0.95rem;
}

/* Hero Section */
.hero {
    padding: 6rem 0;
    background: radial-gradient(circle at top right, #fff5f5 0%, #ffffff 100%);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
}

.badge {
    background: #fce8e8;
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--secondary);
    font-weight: 700;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2.5rem;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
    font-size: 1.05rem;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
    box-shadow: 0 10px 20px rgba(211, 47, 47, 0.2);
}

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

.btn-outline {
    border: 2px solid #ddd;
    color: var(--text);
    margin-left: 1rem;
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Floating Bot */
.hero-image {
    position: relative;
    display: flex;
    justify-content: center;
}

.bot-container {
    position: relative;
    width: 100%;
    max-width: 200px;
}

.floating-bot {
    width: 100%;
    position: relative;
    z-index: 2;
    animation: float 4s ease-in-out infinite;
}

.circle-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background: #fce8e8;
    border-radius: 50%;
    filter: blur(40px);
    z-index: 1;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Features */
.features {
    padding: 6rem 0;
}

.features h2 {
    font-size: 2.5rem;
    margin-bottom: 4rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.feature-card {
    padding: 3rem 2rem;
    background: var(--white);
    border-radius: 20px;
    border: 1px solid #eee;
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
    border-color: var(--primary);
}

.feature-card .icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

/* Modal FAQ Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--white);
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    animation: modalFadeIn 0.3s ease;
}

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

.modal-header {
    padding: 2rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.modal-header h2 {
    color: var(--primary);
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 2rem;
}

.faq-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.faq-item h3 {
    font-size: 1.1rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 20px;
}

.faq-item h3::before {
    content: '?';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

.faq-item p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Footer */
.main-footer {
    background: #1a1a1a;
    color: var(--white);
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid #333;
    padding-bottom: 2rem;
}

.footer-info h4 { margin-bottom: 1rem; }
.footer-info p { color: #aaa; font-size: 0.9rem; }

.footer-social a {
    color: var(--white);
    font-size: 1.5rem;
    margin-left: 1.5rem;
    opacity: 0.7;
}

.footer-social a:hover { opacity: 1; }

.footer-bottom {
    padding-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: #666;
}

/* Responsive */
@media (max-width: 992px) {
    .grid-2 { grid-template-columns: 1fr; text-align: center; }
    .hero h1 { font-size: 2.5rem; }
    .btn-outline { margin-left: 0; margin-top: 1rem; }
    .hero-image { order: -1; }
    .grid-3 { grid-template-columns: 1fr; }
}

/* --- CHAT WIDGET STYLES --- */
.chat-trigger {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--white);
    border: none;
    box-shadow: 0 10px 25px rgba(211, 47, 47, 0.3);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.chat-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 35px rgba(211, 47, 47, 0.4);
}

.trigger-img {
    width: 80%;
    height: auto;
}

.trigger-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--primary);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Chat Window */
.chat-widget {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 400px;
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.15);
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    transform-origin: bottom right;
}

.chat-widget.hidden {
    opacity: 0;
    transform: scale(0.5) translateY(40px);
    pointer-events: none;
}

.chat-container { height: 100%; display: flex; flex-direction: column; }

.chat-header {
    background: var(--primary);
    color: white;
    padding: 1.5rem;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.header-logo { width: 45px; height: 45px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.3); }
.header-text h1 { font-size: 1.1rem; margin: 0; }
.header-text p { font-size: 0.8rem; margin: 0; opacity: 0.8; }

.header-actions {
    position: absolute;
    right: 0;
    top: 0;
    display: flex;
    gap: 10px;
}

.header-action-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s;
    padding: 5px;
}

.header-action-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Views Management */
.workspace-view, .chat-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f9f9f9;
}

.workspace-view { padding: 2rem; }
.view-label { font-weight: 600; color: var(--secondary); margin-bottom: 1.5rem; text-align: center; }

.workspace-list { display: flex; flex-direction: column; gap: 1rem; }

.ws-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 1rem 1.5rem;
    background: white;
    border: 1px solid #eee;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.ws-btn:hover {
    border-color: var(--primary);
    background: #fff5f5;
    transform: translateX(5px);
}

.ws-btn i { font-size: 1.2rem; color: var(--primary); }
.ws-btn span { font-weight: 500; color: var(--text); }

.hidden { display: none !important; }

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

/* Chat Bubbles */
.message { display: flex; gap: 10px; max-width: 85%; animation: msgIn 0.3s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.user-message { align-self: flex-end; flex-direction: row-reverse; }
.bot-message { align-self: flex-start; }

.message-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 5px;
}

.message-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-message .message-icon {
    background: var(--primary);
    color: white;
}

.user-message .message-icon i {
    font-size: 14px;
}

.bot-message .message-icon {
    background: white;
    border: 1px solid #eee;
}

.message-text { padding: 10px 15px; border-radius: 15px; font-size: 0.9rem; }
.user-message .message-text { background: var(--primary); color: white; border-bottom-right-radius: 2px; }
.bot-message .message-text { background: white; border: 1px solid #eee; border-bottom-left-radius: 2px; }

.chat-input-container { padding: 1rem; border-top: 1px solid #eee; background: white; }
.input-wrapper { display: flex; gap: 10px; background: #f4f4f4; padding: 10px 15px; border-radius: 30px; }
#user-input { flex: 1; border: none; background: transparent; outline: none; }
#send-button { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 1.1rem; }

.chat-footer-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding: 0 5px;
}

.btn-text {
    background: none;
    border: none;
    font-size: 0.75rem;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-text:hover { color: var(--text); }
.text-danger:hover { color: var(--primary); }

/* Mobile Adapt */
@media (max-width: 480px) {
    .chat-widget { width: 100%; height: 100%; bottom: 0; right: 0; border-radius: 0; }
}
