/* style.css */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
}
.main-header {
    background-color: #2c3e50;
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.main-header h1 { font-size: 1.5em; margin: 0; border: none; }
.user-info a { color: #3498db; text-decoration: none; margin-left: 15px; }
.user-info a:hover { text-decoration: underline; }

.container {
    max-width: 1300px;
    margin: 20px auto;
    padding: 25px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

h2, h3, h4 { color: #2c3e50; }
h2 { font-size: 1.5em; margin-top: 40px; margin-bottom: 20px; border-bottom: 2px solid #3498db; padding-bottom: 10px; }
h3 { font-size: 1.3em; margin: 0; border: none; }
h4 { margin-top: 0; border-bottom: 1px solid #ddd; padding-bottom: 10px; margin-bottom: 20px; display: flex; align-items: center; }
h5 { margin: 0 0 10px 0; font-size: 1.1em; color: #34495e; }


/* Formularios */
form { background-color: #f9f9f9; padding: 20px; border-radius: 5px; margin-bottom: 20px; border: 1px solid #e0e0e0; }
.form-group { margin-bottom: 15px; }
label { display: block; margin-bottom: 5px; font-weight: bold; color: #34495e; }
input[type="text"], input[type="url"], select { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
button { background-color: #3498db; color: white; padding: 10px 20px; border: none; border-radius: 4px; cursor: pointer; font-size: 1em; transition: background-color 0.3s; }
button:hover { background-color: #2980b9; }

/* Pestañas (Tabs) */
.proyectos-tabs-container { margin-top: 30px; }
ul.project-tabs { list-style-type: none; padding: 0; margin: 0 0 -1px 0; display: flex; flex-wrap: wrap; border-bottom: 1px solid #ccc; }
.tab-link { padding: 10px 20px; cursor: pointer; background-color: #ecf0f1; border: 1px solid #ccc; border-bottom: none; border-radius: 5px 5px 0 0; margin-right: 5px; color: #34495e; transition: background-color 0.3s, color 0.3s; }
.tab-link:hover { background-color: #dfe6e9; }
.tab-link.active { background-color: #fff; border-color: #ccc; color: #2c3e50; font-weight: bold; position: relative; z-index: 2; }
#no-projects-msg { padding: 10px; color: #7f8c8d; }
.project-content-panels { border: 1px solid #ccc; padding: 20px; border-radius: 0 5px 5px 5px; background-color: #fff; position: relative; z-index: 1; }
.project-panel { display: none; }
.project-panel.active { display: block; }

/* Asistente Estratégico */
.strategic-assistant { margin-bottom: 30px; padding: 20px; background-color: #eaf2f8; border: 1px solid #aed6f1; border-radius: 5px; }
.strategic-assistant h4 { color: #2e86c1; border-color: #aed6f1; }
.recommendations-container { display: flex; flex-direction: column; gap: 15px; }
.recommendation-card { padding: 15px; border-radius: 4px; border-left-width: 5px; border-left-style: solid; background-color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.recommendation-card.type-info { border-left-color: #3498db; }
.recommendation-card.type-warning { border-left-color: #f39c12; }
.recommendation-card.type-risk { border-left-color: #e74c3c; }
.recommendation-card .title { font-weight: bold; display: block; margin-bottom: 8px; font-size: 1.1em; }
.recommendation-card .message { margin: 0; line-height: 1.5; }
.recommendation-card .message a { font-weight: bold; color: #2980b9; text-decoration: none; }
.recommendation-card .message a:hover { text-decoration: underline; }
.loader { text-align: center; color: #7f8c8d; font-style: italic; }
.icon-brain::before { content: '🧠'; margin-right: 10px; }
.icon-pie-chart::before { content: '📊'; margin-right: 10px; }

/* Dashboard de Resumen (Anchor Texts) */
.anchor-dashboard { margin-bottom: 30px; padding: 20px; background-color: #f9f9f9; border: 1px solid #e0e0e0; border-radius: 5px; }
.anchor-dashboard h4 { border-color: #ddd; }
/* --- NUEVOS ESTILOS PARA LAS COLUMNAS DEL DASHBOARD --- */
.dashboard-columns { display: flex; gap: 30px; }
.dashboard-stats { flex: 1; display: flex; flex-direction: column; gap: 20px; }
.dashboard-chart { flex: 1; }
/* Dentro de la sección "Dashboard de Resumen (Anchor Texts)" en tu style.css */

.stat-box { 
    padding: 15px; 
    background: #fff; 
    border: 1px solid #e9ecef; 
    border-radius: 4px; 
    /* --- INICIO DEL CAMBIO --- */
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
    border-left-width: 5px;
    border-left-color: transparent;
    /* --- FIN DEL CAMBIO --- */
}

/* --- NUEVAS REGLAS --- */
.stat-box:hover {
    background-color: #f8f9fa;
}

.stat-box.active {
    border-left-color: #3498db;
    background-color: #f1f8fe;
}
/* --- FIN DE NUEVAS REGLAS --- */
.tier-stats-list, .anchor-stats-list { list-style-type: none; padding: 0; margin: 0; }
.tier-stats-list li, .anchor-stats-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f1f3f5; }
.tier-stats-list li:last-child, .anchor-stats-list li:last-child { border-bottom: none; }
.stat-label { color: #495057; }
.stat-value { font-weight: bold; color: #2c3e50; }
.stat-anchor {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-style: italic;
    color: #8e44ad;
}

.chart-container { position: relative; height: 300px; width: 100%; }

/* Proyecto y Columnas */
.proyecto-container { padding: 0; border: none; }
.proyecto-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.delete-project-btn { background: #e74c3c; color: white; border: none; border-radius: 50%; width: 30px; height: 30px; font-size: 16px; cursor: pointer; line-height: 30px; flex-shrink: 0; }
.delete-project-btn:hover { background: #c0392b; }
.money-site { font-size: 1.4em; font-weight: bold; color: #e67e22; word-break: break-all; }
.tier-section { display: flex; gap: 20px; align-items: flex-start; }
.forms-column { flex: 1; min-width: 280px; max-width: 320px; }
.graph-column { flex: 3; padding-left: 20px; border-left: 1px solid #eee; cursor: pointer; }

/* Gráfico de Pirámide y Nodos */
/* ... (el resto del CSS es idéntico al anterior) ... */
.pyramid-tree, .pyramid-tree ul { list-style-type: none; position: relative; }
.pyramid-tree { padding-left: 0; }
.pyramid-tree ul { padding-left: 30px; }
.pyramid-tree ul::before, .pyramid-tree li::before { transition: opacity 0.3s ease; }
.pyramid-tree ul::before { content: ''; position: absolute; top: 0; left: 10px; width: 1px; height: 100%; background-color: #bdc3c7; }
.pyramid-tree li { margin: 10px 0; position: relative; padding-left: 25px; }
.pyramid-tree li::before { content: ''; position: absolute; top: 20px; left: 0; width: 20px; height: 1px; background-color: #bdc3c7; }
.node { background-color: #fff; border: 1px solid #bdc3c7; border-radius: 5px; padding: 10px; display: flex; flex-direction: column; align-items: stretch; box-shadow: 0 2px 4px rgba(0,0,0,0.05); transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease; }
.node a { word-break: break-all; }
.node-main-content { display: flex; align-items: center; gap: 10px; }
.node-url-anchor { display: flex; flex-direction: column; }
.anchor-text-display { font-style: italic; color: #8e44ad; font-size: 0.9em; margin-top: 4px; }
.tier-label { font-weight: bold; padding: 2px 6px; border-radius: 3px; color: #fff; font-size: 0.8em; flex-shrink: 0; }
.node-tier-1 { background-color: #27ae60; } .node-tier-2 { background-color: #2980b9; } .node-tier-3 { background-color: #8e44ad; } .node-tier-4 { background-color: #f39c12; } .node-tier-5 { background-color: #c0392b; }
.status-indicator { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.status-planeado { background-color: #f1c40f; } .status-creado { background-color: #3498db; } .status-indexado { background-color: #2ecc71; }
.node-actions { margin-left: 0; margin-top: 10px; align-self: flex-end; display: flex; gap: 5px; }
.node-actions button, .node-actions .view-site-btn { font-size: 0.8em; padding: 4px 8px; color: white; border-radius: 4px; border: none; cursor: pointer; text-decoration: none; display: inline-block; transition: background-color 0.2s; }
.view-site-btn { background-color: #27ae60; }
.view-site-btn:hover { background-color: #229954; }
.edit-link-btn { background-color: #3498db; }
.edit-link-btn:hover { background-color: #2980b9; }
.delete-link-btn { background-color: #e74c3c; }
.delete-link-btn:hover { background-color: #c0392b; }
.edit-form-inline { display: flex; gap: 10px; align-items: center; padding: 5px; background: #ecf0f1; border-radius: 5px; }
.edit-form-inline input, .edit-form-inline select { padding: 5px; }
.edit-form-inline input[type="text"] { flex-grow: 1; }
.money-site-node { border-color: #e67e22; border-width: 2px; }
.project-panel.path-highlight-active .node, .project-panel.path-highlight-active .money-site-node { opacity: 0.25; transform: scale(0.98); }
.project-panel.path-highlight-active .pyramid-tree li::before, .project-panel.path-highlight-active .pyramid-tree ul::before { opacity: 0.25; }
.project-panel.path-highlight-active .node.highlighted { opacity: 1; transform: scale(1); box-shadow: 0 0 15px rgba(52, 152, 219, 0.7); }
.project-panel.path-highlight-active li.highlighted > .pyramid-tree > li::before, .project-panel.path-highlight-active li.highlighted > ul::before { opacity: 1; background-color: #3498db; }
.project-panel.path-highlight-active li.highlighted > .node { border-color: #3498db; }

/* ... (estilos anteriores) ... */

/* --- NUEVOS ESTILOS PARA LA NAVEGACIÓN PRINCIPAL --- */
.main-nav {
    background-color: #ecf0f1;
    border-bottom: 1px solid #bdc3c7;
    padding: 0 40px;
}
.main-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
}
.main-nav a {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: #34495e;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}
.main-nav a:hover {
    background-color: #dfe6e9;
    color: #2c3e50;
}
.main-nav a.active {
    border-bottom-color: #3498db;
    color: #2c3e50;
}

/* --- NUEVOS ESTILOS PARA LA PÁGINA DE INFORMES --- */
.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.report-header h2 {
    margin: 0;
    border: none;
}
.button-csv {
    background-color: #27ae60;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s;
}
.button-csv:hover {
    background-color: #229954;
}
.report-table-container {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
}
th, td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: left;
}
th {
    background-color: #f2f2f2;
    font-weight: 600;
}
tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}
tbody tr:hover {
    background-color: #f1f8fe;
}
td a {
    color: #2980b9;
    text-decoration: none;
}
td a:hover {
    text-decoration: underline;
}
/* ... (todos los estilos anteriores que ya tienes) ... */

/* --- ACTUALIZACIÓN DE ESTILOS PARA LA PÁGINA DE INFORMES --- */
.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap; /* Para pantallas pequeñas */
}
.report-header h2 {
    margin: 0 0 10px 0; /* Espacio inferior en móvil */
    border: none;
}
.report-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}
.filter-form select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    font-size: 0.9em;
}

/* ... (resto de estilos de la tabla que ya tenías) ... */

/* --- NUEVOS ESTILOS PARA LAS INSIGNIAS DE ESTADO --- */
.status-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
}
.status-planeado { background-color: #f1c40f; color: #5B4A0B; }
.status-creado { background-color: #3498db; }
.status-indexado { background-color: #2ecc71; }