* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f5f5f5;
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

h1 {
    color: #333;
    margin-bottom: 10px;
}

.controls {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

button {
    background-color: #4a90e2;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #3a7bc8;
}

#reset {
    background-color: #e74c3c;
}

#reset:hover {
    background-color: #c0392b;
}

.info-panel {
    display: flex;
    justify-content: space-between;
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.instructions, .settings {
    flex: 1;
    min-width: 300px;
}

.instructions h3 {
    margin-bottom: 10px;
    color: #333;
}

.instructions ul {
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 5px;
}

.settings {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.settings label {
    display: flex;
    align-items: center;
    gap: 10px;
}

input[type="range"] {
    flex-grow: 1;
}

#graph-container {
    position: relative;
    background-color: white;
    border-radius: 8px;
    min-height: 500px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.node {
    position: absolute;
    width: 60px;
    height: 60px;
    background-color: #3498db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    cursor: move;
    user-select: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.delete-node {
    position: absolute;
    top: -5px;
    left: -5px;
    width: 20px;
    height: 20px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 100;
}

.node:hover .delete-node {
    opacity: 1;
}

.node .pagerank {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edge {
    position: absolute;
    background-color: #2c3e50;
    height: 2px;
    transform-origin: 0 0;
    pointer-events: auto;
    z-index: 10;
    cursor: pointer;
    transition: height 0.2s, background-color 0.2s;
}

/* Create a larger hit area for easier clicking */
.edge::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 15px;
    top: -7px;
    left: 0;
    background-color: transparent;
}

.edge:hover {
    background-color: #e74c3c;
    height: 4px;
}

.edge::after {
    content: '';
    position: absolute;
    right: 0;
    top: -4px;
    width: 0;
    height: 0;
    border-left: 8px solid #2c3e50;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: border-left-color 0.2s;
}

.edge:hover::after {
    border-left-color: #e74c3c;
}

.dragging-edge {
    background-color: #ff9900 !important;
    height: 3px !important;
    z-index: 999;
}

.dragging-edge::after {
    border-left-color: #ff9900;
}

/* Edge importance styling */
.edge-high-importance {
    background-color: #27ae60;
    height: 4px;
}

.edge-high-importance::after {
    border-left-color: #27ae60;
}

.edge-medium-importance {
    background-color: #3498db;
    height: 3px;
}

.edge-medium-importance::after {
    border-left-color: #3498db;
}

.edge-low-importance {
    background-color: #95a5a6;
    height: 2px;
}

.edge-low-importance::after {
    border-left-color: #95a5a6;
}

/* Hover effects for importance-styled edges */
.edge-high-importance:hover,
.edge-medium-importance:hover,
.edge-low-importance:hover {
    background-color: #e74c3c;
    height: 4px;
}

.edge-high-importance:hover::after,
.edge-medium-importance:hover::after,
.edge-low-importance:hover::after {
    border-left-color: #e74c3c;
}

/* Edge and node highlighting on hover */
.edge-highlight {
    background-color: #e67e22 !important;
    height: 5px !important;
    box-shadow: 0 0 10px rgba(230, 126, 34, 0.8);
    z-index: 100;
}

.edge-highlight::after {
    border-left-color: #e67e22 !important;
}

.node-highlight {
    box-shadow: 0 0 15px rgba(230, 126, 34, 0.8) !important;
    z-index: 100;
}

/* Pinned elements styling */
.edge-pinned {
    box-shadow: 0 0 12px rgba(230, 126, 34, 0.9) !important;
}

.node-pinned {
    box-shadow: 0 0 15px rgba(230, 126, 34, 0.9) !important;
}

.row-pinned {
    background-color: #fff3e0 !important;
    border-left: 3px solid #e67e22;
}

/* Importance label styling */
.importance-label {
    position: absolute;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    z-index: 1000;
    cursor: pointer;
    font-size: 12px;
    transform: translate(-50%, -50%);
}

.label-header {
    background-color: #3498db;
    color: white;
    padding: 8px 12px;
    border-radius: 6px 6px 0 0;
    font-weight: bold;
}

.label-content {
    padding: 10px 12px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.label-title {
    font-weight: bold;
    color: #555;
}

.label-footer {
    font-size: 10px;
    text-align: center;
    color: #777;
    padding: 5px;
    background-color: #f5f5f5;
    border-radius: 0 0 6px 6px;
}

/* Analytics Section Styling */
#analytics-section {
    margin-top: 30px;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#analytics-section h3 {
    margin-bottom: 15px;
    color: #333;
}

#ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

#ranking-table th, 
#ranking-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

#ranking-table th {
    background-color: #f8f8f8;
    font-weight: bold;
    color: #555;
}

#ranking-table tbody tr:hover {
    background-color: #f5f9ff;
}

#ranking-table .highest-rank {
    font-weight: bold;
    color: #2ecc71;
}

#ranking-table .page-id {
    font-weight: bold;
}

#ranking-table .pagerank-value {
    font-family: monospace;
}

#ranking-table .links {
    color: #555;
}

/* Link ranks table styling */
#link-ranks-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

#link-ranks-section h3 {
    margin-bottom: 15px;
    color: #333;
}

#links-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-bottom: 20px;
}

#links-table th,
#links-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

#links-table th {
    background-color: #f8f8f8;
    font-weight: bold;
    color: #555;
}

#links-table tbody tr:hover {
    background-color: #fff3e0;
    cursor: pointer;
}

.link-importance-high {
    color: #27ae60;
    font-weight: bold;
}

.link-importance-medium {
    color: #3498db;
}

.link-importance-low {
    color: #95a5a6;
}

.link-high:hover {
    background-color: rgba(39, 174, 96, 0.1) !important;
}

.link-medium:hover {
    background-color: rgba(52, 152, 219, 0.1) !important;
}

.link-low:hover {
    background-color: rgba(149, 165, 166, 0.1) !important;
}

.node-from, .node-to {
    font-weight: bold;
}

/* Analytics summary styling */
.analytics-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.summary-item {
    background-color: white;
    padding: 10px 15px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    flex: 1;
    min-width: 120px;
}

.summary-label {
    display: block;
    font-size: 12px;
    color: #777;
    margin-bottom: 5px;
}

.summary-value {
    font-size: 16px;
    font-weight: bold;
}

.high-value {
    color: #27ae60;
}

.medium-value {
    color: #3498db;
}

.low-value {
    color: #95a5a6;
}

/* Algorithm explanation styling */
#algorithm-explanation {
    margin-top: 30px;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#algorithm-explanation h3 {
    margin-bottom: 15px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.explanation-content {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
}

.explanation-content p {
    margin-bottom: 15px;
}

.explanation-content h4 {
    margin: 20px 0 10px;
    color: #2980b9;
}

.explanation-content ol, 
.explanation-content ul {
    margin-left: 25px;
    margin-bottom: 15px;
}

.explanation-content li {
    margin-bottom: 8px;
}

.explanation-content .footnote {
    font-style: italic;
    color: #777;
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-top: 20px;
}

.explanation-content strong {
    color: #2c3e50;
    font-weight: bold;
}
