/* Variables para el tema */
:root {
    /* Paleta de colores moderna */
    --bg-color: #f9fafb;
    --bg-color-rgb: 249, 250, 251;
    --text-color: #1e293b;
    --text-color-rgb: 30, 41, 59;
    --panel-bg-color: #ffffff;
    --panel-bg-color-rgb: 255, 255, 255;
    --border-color: #e2e8f0;
    --hover-bg-color: #f1f5f9;
    --highlight-color: #0ea5e9;
    --highlight-hover: #0284c7;
    --button-bg-color: #334155;
    --button-hover-bg: #475569;
    --button-text-color: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --shadow-hover: rgba(0, 0, 0, 0.15);
    --logo-container-bg: #ffffff;
    --accent-color: #8b5cf6;
    --accent-color-rgb: 139, 92, 246;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --card-radius: 12px;
    --button-radius: 8px;
    --input-radius: 8px;
    --transition-speed: 0.3s;
}

/* Modo oscuro */
body.dark-mode {
    --bg-color: #0f172a;
    --bg-color-rgb: 15, 23, 42;
    --text-color: #e2e8f0;
    --text-color-rgb: 226, 232, 240;
    --panel-bg-color: #1e293b;
    --panel-bg-color-rgb: 30, 41, 59;
    --border-color: #334155;
    --hover-bg-color: #1e293b;
    --highlight-color: #38bdf8;
    --highlight-hover: #0ea5e9;
    --button-bg-color: #475569;
    --button-hover-bg: #64748b;
    --button-text-color: #f8fafc;
    --shadow-color: rgba(0, 0, 0, 0.25);
    --shadow-hover: rgba(0, 0, 0, 0.4);
    --logo-container-bg: #1e293b;
    --accent-color: #a78bfa;
    --accent-color-rgb: 167, 139, 250;
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --error-color: #f87171;
}

/* Estilos para el botón de modo oscuro/claro */
#modoBtn {
    cursor: pointer;
    background: none;
    border: none;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.3s;
}

#modoBtn:hover {
    background-color: var(--hover-bg-color);
}

/* Estilos para los iconos de sol y luna */
#modoIcono.fa-moon {
    color: #555;
}

#modoIcono.fa-sun {
    color: #f39c12;
}

/* Estilos para el icono de cargar archivo */
.file-upload-label {
    cursor: pointer;
    transition: color 0.3s;
}

.file-upload-label:hover {
    color: var(--highlight-color);
}

.file-upload-active {
    color: #4CAF50 !important; /* Verde claro */
    transition: color var(--transition-speed) ease;
}

/* Estilos para el logo y la cabecera */
#headerSection {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--panel-bg-color);
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
    transition: all var(--transition-speed) ease;
}

#logoContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.logo-version-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.version-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background-color: var(--highlight-color);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all var(--transition-speed) ease;
}

#logo, #logoDark {
    max-width: 100px;
    height: auto;
    transition: all var(--transition-speed) ease;
}

/* Asegurarse de que solo se muestre el logo correcto según el modo */
body:not(.dark-mode) #logoDark {
    display: none;
}

body.dark-mode #logo {
    display: none;
}

/* Estilos generales */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--bg-color);
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

/* Contenedor principal */
#mainContainer {
    display: grid;
    grid-template-columns: 1fr 2fr;
    grid-template-rows: 5fr 1fr;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    transition: all 0.3s ease;
}

#leftPanel {
    display: flex;
    flex-direction: column;
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    background-color: var(--panel-bg-color);
    overflow-y: auto;
    transition: all var(--transition-speed) ease;
    border-radius: var(--card-radius);
    box-shadow: 0 4px 12px var(--shadow-color);
    margin: 10px;
}

#rightPanel {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    position: relative;
    background-color: var(--panel-bg-color);
    overflow: hidden;
    transition: all var(--transition-speed) ease;
    border-radius: var(--card-radius);
    box-shadow: 0 4px 12px var(--shadow-color);
    margin: 10px 10px 10px 0;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

#bottomSection {
    grid-column: 1 / 3;
    grid-row: 2 / 3;
    background-color: var(--panel-bg-color);
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border-color);
    transition: all var(--transition-speed) ease;
    border-radius: var(--card-radius);
    box-shadow: 0 4px 12px var(--shadow-color);
    margin: 0 10px 10px 10px;
    font-size: 0.9em;
}

/* Estilos para el logo */
#logoContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
    background-color: var(--logo-container-bg);
    width: 100%;
    overflow: hidden;
}

#logo,
#logoDark {
    max-width: 400px;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.logo-light {
    display: block;
}

.logo-dark {
    display: none;
}

body.dark-mode .logo-light {
    display: none;
}

body.dark-mode .logo-dark {
    display: block;
}

/* Controles superiores */
#topControls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 10px;
    background-color: var(--panel-bg-color);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

#languageDropdown {
    padding: 5px 10px;
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-color);
    color: var(--text-color);
    cursor: pointer;
}

#languageDropdown:hover {
    border-color: var(--highlight-color);
}

#languageDropdown:focus {
    outline: none;
    border-color: var(--highlight-color);
    box-shadow: 0 0 5px var(--shadow-color);
}

.icon-button {
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-color);
    padding: 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
    width: 42px;
    height: 42px;
    box-shadow: 0 2px 5px transparent;
}

.icon-button:hover {
    background-color: var(--hover-bg-color);
    color: var(--highlight-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.icon-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px var(--shadow-color);
}

.icon-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: var(--highlight-color);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

.icon-button:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

#darkModeToggle {
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    background-color: var(--button-bg-color);
    color: var(--button-text-color);
    border: none;
    font-size: 16px;
    transition: background-color 0.3s;
}

#darkModeToggle:hover {
    opacity: 0.9;
}

body.dark-mode .fa-sun:before {
    content: "\f186";
    /* Código Unicode para el ícono de luna */
}

/* Controles principales */
#controls {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
    flex-wrap: wrap;
    padding: 0 20px;
}

#controls input[type="file"] {
    flex: 1;
    min-width: 200px;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    background-color: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    direction: rtl;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#controls button {
    flex-shrink: 0;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

/* Estilos para el contenedor de búsqueda en los controles principales */
#controls .search-container {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: 10px;
}

#controls #graphSearchInput {
    width: 180px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--input-radius) 0 0 var(--input-radius);
    border: 1px solid var(--border-color);
    border-right: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

#controls #graphSearchButton {
    height: 36px;
    padding: 0 12px;
    border-radius: 0 var(--input-radius) var(--input-radius) 0;
    margin: 0;
    background-color: var(--highlight-color);
    color: white;
    transition: all 0.3s ease;
}

/* Estilos específicos para el botón de reset con icono */
#resetButton {
    padding: 0.75rem 1rem;
    margin: 5px;
    border: none;
    border-radius: var(--input-radius);
    background-color: var(--highlight-color);
    color: white;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#resetButton:hover {
    background-color: var(--highlight-hover-color, #1a56db);
    transform: translateY(-1px);
}

#resetButton i {
    font-size: 1rem;
}

button {
    padding: 0.75rem 1.25rem;
    margin: 5px;
    border: none;
    border-radius: var(--button-radius);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    font-size: 1rem;
    font-weight: 500;
    background-color: var(--button-bg-color);
    color: var(--button-text-color);
    box-shadow: 0 2px 4px var(--shadow-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.2px;
    position: relative;
    overflow: hidden;
}

button:hover {
    background-color: var(--button-hover-bg);
    box-shadow: 0 4px 8px var(--shadow-hover);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px var(--shadow-color);
}

#analyzeButton,
#generateGraph {
    background-color: var(--highlight-color);
    background-image: linear-gradient(135deg, var(--highlight-color), var(--highlight-hover));
    color: white;
    font-weight: 600;
    padding: 0.85rem 1.5rem;
    position: relative;
    overflow: hidden;
}

#analyzeButton:hover,
#generateGraph:hover {
    background-image: linear-gradient(135deg, var(--highlight-hover), var(--highlight-color));
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
    transform: translateY(-2px);
}

/* Estilo para botones desactivados */
.disabled-button,
.disabled-button:hover,
button[disabled],
button[disabled]:hover,
#graphControls button.disabled-button,
#graphControls button.disabled-button:hover,
#graphControls button[disabled],
#graphControls button[disabled]:hover {
    background-color: #cccccc !important;
    background-image: none !important;
    color: #666666 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
    opacity: 0.5 !important;
    border: 1px solid #999999 !important;
    pointer-events: none !important;
}

#generateGraph::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}

#analyzeButton:hover::after,
#generateGraph:hover::after {
    opacity: 1;
}

/* Resultados del análisis */
#analysisResults {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 15px;
    margin: 20px;
}

.analysis-section {
    margin-bottom: 20px;
}

.analysis-section h3 {
    margin-top: 0;
}

/* Badges */
.badge {
    background-color: var(--highlight-color);
    color: var(--button-text-color);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.8em;
    margin-left: 5px;
}

/* Grupos de coincidencias */
.coincidence-group summary {
    cursor: pointer;
    padding: 10px;
    background-color: var(--panel-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin-bottom: 5px;
}

.coincidence-details {
    padding: 10px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0 0 5px 5px;
}

.coincidence-details button {
    background-color: var(--highlight-color);
    color: var(--button-text-color);
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 10px;
}

.coincidence-details table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: 0 4px 8px var(--shadow-color);
    margin: 15px 0;
}

.coincidence-details th,
.coincidence-details td {
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 15px;
    text-align: left;
    transition: all var(--transition-speed) ease;
}

.coincidence-details tr:last-child td {
    border-bottom: none;
}

.coincidence-details th {
    background-color: var(--panel-bg-color);
    color: var(--text-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.coincidence-details tr:hover td {
    background-color: var(--hover-bg-color);
}

/* Contenedor del grafo */
/* ... (estilos anteriores sin cambios) ... */

#graphContainer {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    background-color: var(--bg-color);
    position: relative;
    min-height: 0; /* Importante para que flex funcione correctamente */
    overflow: hidden; /* Evita que los controles se salgan del contenedor */
    transition: all var(--transition-speed) ease;
    backdrop-filter: blur(5px);
    margin-bottom: 0;
}

#graphControls {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    z-index: 10;
    padding: 12px;
    background-color: var(--panel-bg-color);
    border-radius: var(--card-radius);
    box-shadow: 0 8px 16px var(--shadow-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: rgba(var(--panel-bg-color-rgb), 0.85);
    border: 1px solid var(--border-color);
    transition: all var(--transition-speed) ease;
}

#graphControls button {
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background-color: transparent;
    color: var(--text-color);
    font-size: 1.2rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#graphControls button:hover {
    background-color: var(--hover-bg-color);
    transform: translateY(-2px);
}

#graphControls button:active {
    transform: translateY(0);
}

/* Estilo para el botón de IA Connections cuando está activo */
#graphControls button.active-button {
    background-color: var(--highlight-color);
    color: var(--button-text-color);
    box-shadow: 0 0 5px var(--highlight-color);
}

/* Estilos para el filtro de conexiones */
#connectionFilterContainer {
    display: none;
    margin-left: 10px;
    background-color: var(--panel-bg-color);
    border-radius: 15px;
    padding: 5px 10px;
    box-shadow: 0 2px 4px var(--shadow-color);
    animation: fadeIn 0.3s ease;
}

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

#connectionFilter {
    padding: 5px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#connectionFilter:hover,
#connectionFilter:focus {
    border-color: var(--highlight-color);
    outline: none;
}

/* Estilo para el tooltip */
#graphControls button::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--text-color);
    color: var(--bg-color);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

#graphControls button:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 10px);
}

/* ... (resto de los estilos sin cambios) ... */

/* Información del nodo */
#nodeInfo {
    display: flex;
    justify-content: space-between;
    background-color: var(--panel-bg-color);
    border-radius: var(--card-radius);
    box-shadow: 0 10px 20px var(--shadow-color);
    overflow: hidden;
    margin: 10px 0;
    position: relative;
    transition: all var(--transition-speed) ease;
    border: 1px solid var(--border-color);
    max-height: 200px; /* Altura máxima para las tarjetas */
    overflow-y: auto; /* Permitir scroll vertical si el contenido es mayor */
}

.node-info-section {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 0;
    box-shadow: none;
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: visible; /* Cambiado de auto a visible para evitar barras de desplazamiento */
    min-height: 150px;
    max-height: 200px;
    display: flex;
    flex-direction: column;
}

.node-info-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, var(--highlight-color), var(--accent-color));
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}

.node-info-section:hover::before {
    opacity: 1;
}

.node-info-section:hover {
    background-color: var(--hover-bg-color);
}

.node-info-section h3 {
    color: var(--text-color);
    font-size: 1.1em;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--highlight-color);
    position: relative;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all var(--transition-speed) ease;
}

.node-info-section h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: linear-gradient(to right, var(--highlight-color), var(--accent-color));
    transition: width var(--transition-speed) ease;
}

.node-info-section:hover h3::after {
    width: 100%;
}

.node-info-section p {
    margin: 5px 0;
    font-size: 0.9em;
    color: var(--text-color);
}

.node-info-section ul {
    list-style-type: none;
    padding-left: 0;
    margin: 3px 0;
    max-height: 120px;
    overflow-y: auto;
}

.node-info-section li {
    margin-bottom: 4px;
    padding-left: 15px;
    position: relative;
    font-size: 0.85em;
}

.node-info-section li::before {
    content: '▹';
    color: var(--highlight-color);
    position: absolute;
    left: 0;
}

/* Borde entre paneles eliminado */

/* Estilos específicos para cada panel */
#basicInfo {
    overflow: hidden; /* Eliminar la barra de desplazamiento específicamente para el panel de información básica */
}

#graphAdvancedControls {
    padding: 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Indicador de carga */
#loadingIndicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    border: 5px solid var(--bg-color);
    border-top: 5px solid var(--highlight-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: var(--button-text-color);
    margin-top: 10px;
}

/* Estilos para el formulario de inicio de sesión */
.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
    box-sizing: border-box;
}

.login-container h2 {
    margin-bottom: 25px;
    color: var(--text-color);
    text-align: center;
    font-size: 1.8rem;
}

.login-container form {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 350px;
    padding: 25px;
    background-color: var(--panel-bg-color);
    border-radius: 8px;
    box-shadow: 0 6px 12px var(--shadow-color);
    transition: all 0.3s ease;
}

.login-container input {
    margin-bottom: 15px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.login-container input:focus {
    border-color: var(--highlight-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3);
}

.login-container #controls button {
    padding: 12px 20px;
    background-color: var(--button-bg-color);
    color: var(--button-text-color);
    border: none;
    border-radius: var(--button-radius);
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    margin: 0 8px;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 2px 4px var(--shadow-color);
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.3px;
}

.login-container #controls button:hover {
    background-color: var(--button-hover-bg);
    box-shadow: 0 4px 8px var(--shadow-hover);
    transform: translateY(-1px);
}

.login-container #controls button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px var(--shadow-color);
}

.login-container button:hover {
    background-color: #2980b9;
}

.login-container button:active {
    transform: scale(0.98);
}

@media (max-width: 576px) {
    .login-container h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .login-container form {
        padding: 20px;
        max-width: 300px;
    }
    
    .login-container input,
    .login-container button {
        padding: 10px;
        font-size: 14px;
    }
}

@media (max-height: 500px) {
    .login-container h2 {
        margin-bottom: 15px;
        font-size: 1.3rem;
    }
    
    .login-container form {
        padding: 15px;
    }
    
    .login-container input {
        margin-bottom: 10px;
        padding: 8px;
    }
}

/* Modal de instrucciones */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: var(--bg-color);
    margin: 5% auto;
    padding: 20px;
    border: 1px solid var(--border-color);
    width: 80%;
    max-width: 800px;
    border-radius: 5px;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
}

#instructionsContent {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 20px;
}

#instructionsContent h1 {
    color: var(--highlight-color);
    border-bottom: 2px solid var(--highlight-color);
    padding-bottom: 10px;
}

/* Estilos para el campo de búsqueda */
.search-controls {
    margin-bottom: 15px;
}

.search-container {
    display: flex;
    align-items: center;
    background-color: var(--panel-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--input-radius);
    overflow: hidden;
    box-shadow: 0 2px 4px var(--shadow-color);
    transition: all var(--transition-speed) ease;
}

.search-container:focus-within {
    border-color: var(--highlight-color);
    box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb), 0.2);
}

#graphSearchInput {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background-color: transparent;
    color: var(--text-color);
    font-size: 0.9rem;
    outline: none;
}

#graphSearchButton {
    background-color: var(--highlight-color);
    color: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color var(--transition-speed) ease;
}

#graphSearchButton:hover {
    background-color: var(--highlight-hover);
}

/* Estilo para nodos resaltados por búsqueda */
.search-highlight {
    box-shadow: 0 0 10px 5px var(--highlight-color) !important;
    border: 2px solid var(--highlight-color) !important;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 5px 2px var(--highlight-color); }
    50% { box-shadow: 0 0 15px 5px var(--highlight-color); }
    100% { box-shadow: 0 0 5px 2px var(--highlight-color); }
}

#instructionsContent h2 {
    color: var(--text-color);
    margin-top: 20px;
}

#instructionsContent p,
#instructionsContent li {
    line-height: 1.6;
}

#instructionsContent ul {
    padding-left: 20px;
}

/* Botones deshabilitados - Definición unificada en línea 506 */

/* Hover para botones deshabilitados - Definición unificada en línea 506 */

/* Estilos para scrollbar personalizado */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--panel-bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--button-bg-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--highlight-color);
}

/* Media queries para responsividad */
@media (max-width: 1200px) {
    #logo,
    #logoDark {
        max-width: 350px;
    }
    
    #graphControls {
        padding: 8px;
    }
    
    #graphControls button {
        margin: 0 3px;
    }
}

@media (max-width: 992px) {
    #logo,
    #logoDark {
        max-width: 300px;
    }
    
    #mainContainer {
        grid-template-columns: 1fr 1.5fr; /* Ajustar proporción */
    }
    
    #topControls {
        padding: 8px 5px;
    }
    
    .control-group {
        gap: 5px;
    }
    
    #graphControls {
        top: 20px;
    }
}

@media (max-width: 768px) {
    #mainContainer {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(auto, 40vh) minmax(auto, 40vh) auto;
        height: 100vh;
        overflow-y: auto;
    }

    #leftPanel,
    #rightPanel {
        grid-column: 1 / 2;
        min-height: 300px;
        max-height: 50vh;
        overflow-y: auto;
    }
    
    #rightPanel {
        grid-row: 2 / 3;
        padding: 10px;
    }

    #bottomSection {
        grid-column: 1 / 2;
        grid-row: 3 / 4;
        padding: 15px 10px;
    }

    #nodeInfo {
        flex-direction: column;
    }

    .node-info-section+.node-info-section {
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding-top: 15px;
        margin-top: 15px;
    }

    #logo,
    #logoDark {
        max-width: 250px;
    }

    #graphControls {
        position: static;
        transform: none;
        flex-wrap: wrap;
        justify-content: center;
        padding: 10px 5px;
        gap: 5px;
        background-color: var(--panel-bg-color);
        border-radius: 5px;
        margin-bottom: 10px;
    }

    #graphControls button {
        flex: 0 0 auto;
        margin: 2px;
    }
    
    #graphContainer {
        height: calc(100% - 70px);
    }
    
    #controls {
        padding: 10px 5px;
        gap: 8px;
    }
    
    #controls button {
        padding: 8px 15px;
    }
}

@media (max-width: 576px) {
    body, html {
        font-size: 14px;
    }
    
    #logo,
    #logoDark {
        max-width: 180px;
    }

    #controls {
        flex-direction: column;
        align-items: stretch;
    }

    #controls input[type="file"],
    #controls button {
        width: 100%;
        margin: 5px 0;
    }
    
    /* Clase específica para controles móviles */
    .mobile-controls {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .mobile-controls button {
        padding: 12px 10px;
        font-size: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    #topControls {
        padding: 5px;
    }
    
    .control-group {
        width: 100%;
        justify-content: space-between;
    }
    
    #languageDropdown {
        font-size: 14px;
        padding: 4px 8px;
    }
    
    .icon-button {
        font-size: 1.2rem;
        padding: 4px;
    }
    
    #graphControls button {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    
    #bottomSection {
        padding: 10px 5px;
    }
    
    .node-info-section {
        padding: 10px;
    }
    
    .node-info-section h3 {
        font-size: 1.1em;
        margin-bottom: 10px;
    }
}

/* Estilos para pantallas de alta resolución */
@media screen and (min-resolution: 192dpi) {
    body {
        font-size: 18px;
    }

    button,
    input[type="file"] {
        font-size: 1.125rem;
    }

    #graphContainer {
        border-width: 2px;
    }

    #bottomSection {
        font-size: 1em;
    }

    .node-info-section h3 {
        font-size: 1.3em;
    }

    .node-info-section p,
    .node-info-section li {
        font-size: 1em;
    }
}

/* Estilos para el botón de cierre de sesión */
.logout-button {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 8px 12px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    z-index: 1000;
    transition: background-color 0.3s;
}

.logout-button:hover {
    background-color: #d32f2f;
}

/* Estilos adicionales para mejorar la accesibilidad */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Estilos para mejorar el foco en elementos interactivos */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--highlight-color);
    outline-offset: 2px;
}

/* Estilos para mejorar la legibilidad del texto */
body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ajustes finales para asegurar consistencia */
* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

/* Estilos para idiomas RTL como árabe */
html[dir="rtl"] body,
body.rtl {
    direction: rtl;
    text-align: right;
}

/* Estilos modernos para el formulario de login */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: var(--bg-color);
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
    padding: 20px;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(135deg, 
        rgba(var(--accent-color-rgb), 0.05) 0%, 
        rgba(var(--highlight-color), 0.05) 100%);
    transform: rotate(30deg);
    z-index: 0;
}

.login-container h2 {
    color: var(--text-color);
    margin-bottom: 30px;
    font-size: 2rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    text-align: center;
    background: linear-gradient(135deg, var(--text-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px var(--shadow-color);
}

#loginForm {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 400px;
    background-color: var(--panel-bg-color);
    padding: 30px;
    border-radius: var(--card-radius);
    box-shadow: 0 10px 25px var(--shadow-color);
    position: relative;
    z-index: 1;
    transition: all var(--transition-speed) ease;
}

#loginForm input {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--input-radius);
    font-size: 1rem;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: all var(--transition-speed) ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05) inset;
}

#loginForm input:focus {
    border-color: var(--highlight-color);
    box-shadow: 0 0 0 3px rgba(var(--highlight-color), 0.2);
    outline: none;
}

#loginForm button {
    padding: 15px;
    background: linear-gradient(135deg, var(--highlight-color), var(--highlight-hover));
    color: white;
    border: none;
    border-radius: var(--button-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 4px 10px rgba(var(--highlight-color), 0.3);
    position: relative;
    overflow: hidden;
}

#loginForm button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(var(--highlight-color), 0.4);
}

#loginForm button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(var(--highlight-color), 0.3);
}

#loginForm button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}

#loginForm button:hover::after {
    opacity: 1;
}

/* Estilos para los controles avanzados del grafo - Eliminados los bordes */

/* Cuando los controles están colapsados */
#graphAdvancedControls.collapsed .controls-content {
    display: none;
}

#graphAdvancedControls.collapsed .controls-header h3 {
    display: inline-block;
}

/* Estilos para el encabezado de los controles */
.controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: var(--header-bg-color);
    border-bottom: 1px solid var(--border-color);
}

.controls-header h3 {
    margin: 0;
    font-size: 1rem;
}

/* Estilos para el contenido de los controles */
.controls-content {
    padding: 10px;
}

#graphAdvancedControls {
    max-height: 400px; /* Altura máxima para la tarjeta */
    overflow-y: auto; /* Habilitar scroll vertical */
}

#graphAdvancedControls:hover {
    opacity: 1;
}

/* Eliminados los estilos de .controls-header que ya no se utilizan */

/* Estilos de controls-content eliminados ya que no se necesitan */

/* Estilos de scrollbar eliminados */

/* Resto de estilos de scrollbar eliminados */

.control-group {
    margin-bottom: 15px;
}

.control-group {
    margin-top: 0;
}

.control-group h4 {
    margin: 0 0 6px 0;
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 600;
    padding-bottom: 3px;
    border-bottom: 1px solid var(--border-color);
}

.control-item {
    margin-bottom: 6px;
}

.control-item label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.85em;
    color: var(--text-color);
    font-weight: 500;
}

.control-item input[type="range"] {
    width: 100%;
    margin-bottom: 5px;
    accent-color: var(--highlight-color);
    height: 5px;
    border-radius: 2px;
}

.control-item select {
    width: 100%;
    padding: 8px;
    border-radius: var(--input-radius);
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 0.85em;
}

/* Estilos para grupos de controles específicos */
.hierarchical-controls,
.clustered-controls,
.radial-controls {
    display: none; /* Se mostrarán según la vista activa */
}

/* Clase para mostrar los controles específicos */
.show-controls {
    display: block;
}

/* Eliminados los estilos del estado colapsado */

/* Estilos responsivos para el formulario de login */
@media (max-width: 768px) {
    .login-container h2 {
        font-size: 1.8rem;
    }
    
    #loginForm {
        padding: 25px;
        max-width: 350px;
    }
}

@media (max-width: 480px) {
    .login-container h2 {
        font-size: 1.5rem;
    }
    
    #loginForm {
        padding: 20px;
        max-width: 300px;
    }
    
    #loginForm input {
        padding: 12px;
    }
    
    #loginForm button {
        padding: 12px;
    }
}

html[dir="rtl"] #leftPanel,
body.rtl #leftPanel {
    border-right: none;
    border-left: 1px solid var(--border-color);
}

html[dir="rtl"] .control-group,
body.rtl .control-group {
    flex-direction: row-reverse;
}

html[dir="rtl"] .data-label,
body.rtl .data-label {
    margin-right: 0;
    margin-left: 5px;
}

html[dir="rtl"] #graphControls button,
body.rtl #graphControls button {
    margin-right: 0;
    margin-left: 5px;
}

html[dir="rtl"] .node-info-section li::before,
body.rtl .node-info-section li::before {
    left: auto;
    right: 0;
}

html[dir="rtl"] .node-info-section li,
body.rtl .node-info-section li {
    padding-left: 0;
    padding-right: 20px;
}

html[dir="rtl"] #instructionsContent ul,
body.rtl #instructionsContent ul {
    padding-left: 0;
    padding-right: 20px;
}

/* Borde RTL entre paneles eliminado */