html {
    background-color: #f8f9fa;
}

body {
    background-color: transparent;
    min-height: 100vh;
}

/* Fuente de marca: Neexan Demo */
@font-face {
    font-family: 'Neexan Demo';
    src: url('/static/fonts/Neexan Demo.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

.navbar-brand,
.section-title,
h1, h2, h3 {
    font-family: 'Neexan Demo', 'Poppins', sans-serif;
}

/* Fondo Vanta (Three.js) fijo a toda la pantalla: cubre el viewport siempre,
   aunque el contenido sea más alto y se haga scroll (nunca queda en blanco). */
#body .vanta-canvas {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    min-height: 100vh !important;
    z-index: -1 !important;
}

.main-header {
    color: rgb(0, 0, 0);
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
}

.main-header h1 {
    font-weight: 200;
}

.main-header .lead {
    color: rgba(255, 255, 255, 0.8);
}

.main-header .lead a {
    color: #fff;
    font-weight: bold;
    text-decoration: underline;
}

.flash-success {
    background-color: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

.flash-danger {
    background-color: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}

.flash-info {
    background-color: #cff4fc;
    border-color: #b6effb;
    color: #055160;
}

.navbar-nav .nav-link i {
    font-size: 1.2rem;
}

.footer .bi {
    font-size: 1.5rem;
    transition: color 0.2s ease-in-out;
}

.footer a:hover .bi {
    color: #fff;
}

.navbar-brand-logo {
    height: 35px;
    vertical-align: middle;
    margin-right: 0.5rem;
}

.converter-card {
    background-color: #ffffffb0;
    padding: 1rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
    margin-bottom: 2rem;
}

#drop-zone {
    border: 3px dashed #d1d5db;
    border-radius: 10px;
    padding: 40px;
    margin-top: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

#drop-zone.hover {
    background-color: #e0f7ff;
    border-color: #0d6efd;
}

#drop-zone.disabled {
    cursor: not-allowed;
    background-color: #f8f9fa;
}

#drop-zone p {
    margin: 0;
    color: #6b7280;
    font-size: 1.1rem;
}

.upload-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 1rem;
    color: #9ca3af;
}

#file-info {
    margin-top: 20px;
    font-weight: bold;
    color: #333;
}

#viewer-section {
    display: none;
    margin-top: 30px;
    height: 500px;
}

#dxf-viewer-container {
    border: 1px solid #ddd;
    position: relative;
    cursor: crosshair;
    width: 100%;
    height: 100%;
}

#sidebar {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    width: 200px;
    display: flex;
    flex-direction: column;
    max-height: calc(100% - 20px);
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    font-size: small;
}

#layer-tree,
#properties-panel {
    padding: 10px;
    overflow-y: auto;
}

#layer-tree {
    flex-basis: 50%;
    border-bottom: 1px solid #eee;
}

#properties-panel {
    flex-basis: 50%;
}

#layer-tree h3,
#properties-panel h3 {
    margin-top: 0;
    font-size: 1.1em;
    padding-bottom: 5px;
}

#properties-content p {
    font-style: italic;
    color: #777;
    margin: 0;
}

#properties-content ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    font-size: 0.9em;
    word-wrap: break-word;
}

#properties-content li {
    margin-bottom: 8px;
}

#result-link button {
    font-size: 1.2rem;
    padding: 10px 25px;
}

/* Nuevos estilos para la sección de características */
.section-title {
    font-weight: 300;
    font-size: 2.5rem;
}

.feature-card {
    border: none;
    background-color: #fff;
    border-radius: 10px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1) !important;
}

.feature-icon {
    font-size: 2.5rem;
    color: #0d6efd;
    margin-bottom: 1rem;
}

.why-us-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.why-us-item .feature-icon {
    margin-right: 1.5rem;
    margin-top: 5px;
}

/* Estilos para las nuevas pestañas */
.main-header .nav-tabs {
    border-bottom: none;
}

.main-header .nav-tabs .nav-link {
    color: rgba(255, 255, 255, 0.8);
    border: none;
    background-color: transparent;
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

.main-header .nav-tabs .nav-link.active,
.main-header .nav-tabs .nav-item.show .nav-link {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.15);
}

/* API Docs styles */
#api-pane pre {
    background-color: #282c34;
    /* Un color oscuro para el fondo del código */
    color: #abb2bf;
    /* Un color de texto claro */
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.9em;
}

#api-pane code {
    font-family: 'Courier New', Courier, monospace;
}

#api-pane h5 .badge {
    font-size: 0.9rem;
    vertical-align: middle;
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #ffffffb0;
    background-clip: border-box;
    border: 1px solid rgba(0, 0, 0, .125);
    border-radius: 10px;
}

.py-5 {
    padding-top: 0rem !important;
    padding-bottom: 2rem !important;
}

.pt-5 {
    padding-top: 2rem !important;
}

.pb-5 {
    padding-bottom: 2rem !important;
}

.mb-5 {
    margin-bottom: 2rem !important;
}

.converters-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    /* Espacio entre botones */
}

.converter-item {
    position: relative;
}

/* Ocultamos el checkbox real */
.converter-item .converter-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Estilizamos el label para que parezca un botón */
.converter-item .converter-label {
    display: block;
    padding: 0.8rem 1.25rem;
    background-color: #f8f9fa;
    /* Un gris claro por defecto */
    border: 1px solid #dee2e6;
    border-radius: .3rem;
    cursor: pointer;
    text-align: center;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
    /* Evita que el texto del botón se parta */
}

/* Efecto hover */
.converter-item .converter-label:hover {
    background-color: #e9ecef;
    border-color: #ced4da;
}

/* Estilo para cuando el checkbox está seleccionado */
.converter-item .converter-checkbox:checked+.converter-label {
    background-color: #198754;
    /* Verde de Bootstrap (éxito) */
    border-color: #146c43;
    color: white;
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.5);
}

.text-muted {
    color: #303234 !important;
}

.why-us-item {
    background-color: #ffffffb0;
    background-clip: border-box;
    border: 1px solid rgba(0, 0, 0, .125);
    border-radius: 10px;
    padding: 2%;
}

.fade:not(.show) {
    opacity: 100;
}

/* ===================== Widget de Chat IA (flotante) ===================== */
.ai-chat-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 10050;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, .28);
    color: #fff;
    font-size: 1.7rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .28);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease;
}

.ai-chat-fab:hover {
    background: #0b5ed7;
    transform: scale(1.06);
}

.ai-chat-panel {
    position: fixed;
    right: 20px;
    bottom: 90px;
    z-index: 10050;
    width: 360px;
    max-width: calc(100vw - 40px);
    height: 480px;
    max-height: calc(100vh - 120px);
    display: none;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .28);
    overflow: hidden;
}

.ai-chat-panel.open {
    display: flex;
}

.ai-chat-header {
    background: rgba(0, 0, 0, .28);
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.ai-chat-title {
    font-family: 'Neexan Demo', 'Poppins', sans-serif;
    font-size: 1.2rem;
    letter-spacing: .3px;
}

.ai-chat-title small {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: .7rem;
    opacity: .9;
    letter-spacing: 0;
}

.ai-chat-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-chat-icon-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chat-icon-btn:hover {
    background: rgba(255, 255, 255, .18);
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f5f6f8;
}

.ai-chat-msg {
    max-width: 82%;
    padding: 9px 12px;
    border-radius: 14px;
    font-size: .9rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.ai-chat-msg-bot {
    background: #fff;
    color: #212529;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}

.ai-chat-msg-user {
    background: #0d6efd;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.ai-chat-msg-typing {
    font-style: italic;
    color: #6c757d;
}

/* Estilos del contenido Markdown renderizado en los mensajes del asistente */
.ai-chat-msg-bot p {
    margin: 0 0 6px;
}

.ai-chat-msg-bot p:last-child {
    margin-bottom: 0;
}

.ai-chat-msg-bot h1,
.ai-chat-msg-bot h2,
.ai-chat-msg-bot h3,
.ai-chat-msg-bot h4 {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    margin: 8px 0 4px;
}

.ai-chat-msg-bot ul,
.ai-chat-msg-bot ol {
    margin: 4px 0;
    padding-left: 18px;
}

.ai-chat-msg-bot li {
    margin-bottom: 2px;
}

.ai-chat-msg-bot code {
    background: #eef1f4;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: .85em;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.ai-chat-msg-bot pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 8px 10px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: .82rem;
    margin: 6px 0;
}

.ai-chat-msg-bot pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.ai-chat-msg-bot blockquote {
    border-left: 3px solid #0d6efd;
    margin: 6px 0;
    padding-left: 10px;
    color: #495057;
}

.ai-chat-msg-bot a {
    color: #0d6efd;
    text-decoration: underline;
}

.ai-chat-form {
    display: flex;
    padding: 10px;
    gap: 8px;
    border-top: 1px solid #e9ecef;
    background: #fff;
    flex-shrink: 0;
}

.ai-chat-form input {
    flex: 1;
    border: 1px solid #ced4da;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: .9rem;
    outline: none;
    min-width: 0;
}

.ai-chat-form input:focus {
    border-color: #0d6efd;
}

.ai-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, .28);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-chat-send:hover {
    background: #0b5ed7;
}

@media (max-width: 480px) {
    .ai-chat-panel {
        right: 10px;
        bottom: 80px;
        width: calc(100vw - 20px);
        height: 70vh;
    }

    .ai-chat-fab {
        right: 14px;
        bottom: 14px;
    }
}
/* ===== Aviso de cookies (ePrivacy / RGPD) ===== */
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20000;
    background: rgba(33, 37, 41, .97);
    color: #fff;
    padding: 1rem 1.25rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, .35);
    align-items: center;
    justify-content: center;
}
.cookie-banner-content {
    max-width: 720px;
    width: 100%;
    text-align: center;
}
.cookie-banner-content h6 {
    margin-bottom: .35rem;
    font-weight: 600;
}
.cookie-banner-content a { color: #9ec5fe; }
.cookie-banner-content .gap-2 { gap: .5rem !important; justify-content: center; }

/* ===== Páginas legales ===== */
.legal-page h1.legal-h1 {
    font-size: 1.9rem;
    font-weight: 700;
    margin-bottom: .25rem;
}
.legal-page h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.75rem;
    margin-bottom: .5rem;
    color: #0d6efd;
}
.legal-page ul, .legal-page ol { padding-left: 1.25rem; }
.legal-page li { margin-bottom: .4rem; }
.legal-page table { margin-top: .5rem; }
.legal-page .breadcrumb { margin-bottom: .75rem; }
.legal-page .lead { margin-top: 1rem; }

.legal-links a { text-decoration: none; }
.legal-links a:hover { color: #fff !important; text-decoration: underline; }
@media (max-width: 576px) {
    .legal-links a { display: inline-block; margin: .15rem .35rem; }
}
