/**
 * Graph Theory Fundamentals Tutorial
 * Dark Theme Stylesheet with Neon Accents
 */

/* Simulation Container (parent div) */
#content_sim {
    background-color: #0d1117;
    padding: 10px;
    border-radius: 8px;
}

/* Main Container */
.gt-container {
    background-color: #0d1117;
    border-radius: 8px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    color: #e0e0e0;
    max-width: 800px;
    margin: 0 auto;
}

/* Module Navigation */
.gt-module-nav {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.gt-module-nav button {
    background-color: #161b22;
    color: #8b949e;
    border: 1px solid #30363d;
    padding: 8px 16px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.gt-module-nav button:hover {
    background-color: #21262d;
    color: #c9d1d9;
    border-color: #8b949e;
}

.gt-module-nav button.active {
    background-color: #238636;
    color: #ffffff;
    border-color: #238636;
}

/* Control Panel */
.gt-control-panel {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.gt-section-label {
    color: #58a6ff;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 10px;
    border-bottom: 1px solid #30363d;
    padding-bottom: 5px;
}

.gt-control-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.gt-control-row label {
    color: #8b949e;
    font-size: 12px;
    min-width: 80px;
}

.gt-control-row input[type="checkbox"] {
    accent-color: #58a6ff;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.gt-control-row button {
    background-color: #21262d;
    color: #58a6ff;
    border: 1px solid #30363d;
    padding: 6px 12px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.gt-control-row button:hover {
    background-color: #30363d;
    border-color: #58a6ff;
}

.gt-control-row button.danger {
    color: #f85149;
    border-color: #f85149;
}

.gt-control-row button.danger:hover {
    background-color: #f85149;
    color: #ffffff;
}

/* Canvas Container */
.gt-canvas-container {
    position: relative;
    width: 100%;
    height: 400px;
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    overflow: hidden;
}

.gt-canvas-container canvas {
    display: block;
    cursor: crosshair;
}

/* Info Overlay */
.gt-info-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(22, 27, 34, 0.95);
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 10px;
    font-size: 11px;
    color: #c9d1d9;
    max-width: 180px;
}

.gt-info-overlay h4 {
    color: #58a6ff;
    margin: 0 0 8px 0;
    font-size: 12px;
    border-bottom: 1px solid #30363d;
    padding-bottom: 4px;
}

.gt-info-item {
    margin-bottom: 4px;
}

.gt-info-item span.label {
    color: #8b949e;
}

.gt-info-item span.value {
    color: #7ee787;
}

/* Mode Indicator */
.gt-mode-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(22, 27, 34, 0.95);
    border: 1px solid #58a6ff;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 11px;
    color: #58a6ff;
    font-weight: bold;
}

/* Side Panel (Matrix/Histogram) */
.gt-side-panel {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.gt-matrix-view, .gt-list-view {
    flex: 1;
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 10px;
    overflow: auto;
    max-height: 200px;
}

.gt-matrix-view h4, .gt-list-view h4 {
    color: #58a6ff;
    margin: 0 0 10px 0;
    font-size: 12px;
}

.gt-matrix-view table {
    border-collapse: collapse;
    font-size: 11px;
}

.gt-matrix-view td, .gt-matrix-view th {
    border: 1px solid #30363d;
    padding: 4px 8px;
    text-align: center;
    min-width: 25px;
}

.gt-matrix-view th {
    background-color: #21262d;
    color: #58a6ff;
}

.gt-matrix-view td {
    color: #c9d1d9;
}

.gt-matrix-view td.highlight {
    background-color: #238636;
    color: #ffffff;
}

.gt-matrix-view td.zero {
    color: #484f58;
}

.gt-matrix-view td.negative {
    background-color: #f8514933;
    color: #f85149;
}

.gt-matrix-view td.diagonal {
    background-color: #58a6ff33;
    color: #58a6ff;
    font-weight: bold;
}

/* Adjacency List */
.gt-list-view ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gt-list-view li {
    padding: 4px 0;
    border-bottom: 1px solid #21262d;
    font-size: 11px;
}

.gt-list-view .node-label {
    color: #f0883e;
    font-weight: bold;
}

.gt-list-view .neighbors {
    color: #7ee787;
}

/* Histogram View */
.gt-histogram-container {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

.gt-histogram-container h4 {
    color: #58a6ff;
    margin: 0 0 10px 0;
    font-size: 12px;
}

.gt-histogram {
    display: flex;
    align-items: flex-end;
    height: 100px;
    gap: 8px;
    padding: 10px;
    background-color: #0d1117;
    border-radius: 4px;
}

.gt-histogram-bar {
    flex: 1;
    background: linear-gradient(to top, #238636, #7ee787);
    border-radius: 2px 2px 0 0;
    min-width: 20px;
    transition: height 0.3s ease;
    position: relative;
}

.gt-histogram-bar .bar-label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #8b949e;
}

.gt-histogram-bar .bar-value {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #7ee787;
}

/* Degree Stats */
.gt-degree-stats {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.gt-degree-stat {
    background-color: #21262d;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 11px;
}

.gt-degree-stat .stat-label {
    color: #8b949e;
}

.gt-degree-stat .stat-value {
    color: #f0883e;
    font-weight: bold;
}

/* Instructions */
.gt-instructions {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 10px 15px;
    margin-top: 15px;
    font-size: 11px;
    color: #8b949e;
}

.gt-instructions span {
    color: #58a6ff;
    font-weight: bold;
}

/* Legend */
.gt-legend-box {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 10px 15px;
    margin-top: 15px;
}

.gt-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #c9d1d9;
}

.gt-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #30363d;
}

/* Isomorphism Puzzle */
.gt-iso-container {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.gt-iso-panel {
    flex: 1;
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 10px;
}

.gt-iso-panel h4 {
    color: #58a6ff;
    margin: 0 0 10px 0;
    font-size: 12px;
    text-align: center;
}

.gt-iso-canvas {
    width: 240px;
    height: 160px;
    background-color: #0d1117;
    border-radius: 4px;
    cursor: grab;
}

.gt-iso-canvas:active {
    cursor: grabbing;
}

.gt-iso-result {
    text-align: center;
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.gt-iso-result.match {
    background-color: rgba(35, 134, 54, 0.3);
    color: #7ee787;
    border: 1px solid #238636;
}

.gt-iso-result.no-match {
    background-color: rgba(248, 81, 73, 0.2);
    color: #f85149;
    border: 1px solid #f85149;
}

/* Tooltip */
.gt-tooltip {
    position: absolute;
    background: rgba(22, 27, 34, 0.95);
    border: 1px solid #58a6ff;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 11px;
    color: #c9d1d9;
    pointer-events: none;
    z-index: 100;
    display: none;
}

.gt-tooltip.visible {
    display: block;
}

/* Edge Edit Popup */
.gt-edge-popup {
    position: absolute;
    background: rgba(22, 27, 34, 0.98);
    border: 1px solid #58a6ff;
    border-radius: 8px;
    padding: 12px;
    z-index: 200;
    min-width: 180px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.gt-popup-title {
    color: #58a6ff;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #30363d;
}

.gt-popup-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.gt-popup-row label {
    color: #8b949e;
    font-size: 11px;
    min-width: 50px;
}

.gt-popup-row span {
    color: #7ee787;
    font-size: 12px;
    font-weight: bold;
}

.gt-popup-row button {
    flex: 1;
    background: #21262d;
    color: #c9d1d9;
    border: 1px solid #30363d;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    transition: all 0.2s ease;
}

.gt-popup-row button:hover {
    background: #30363d;
    border-color: #58a6ff;
    color: #58a6ff;
}

.gt-popup-row button.danger {
    color: #f85149;
    border-color: #f8514966;
}

.gt-popup-row button.danger:hover {
    background: #f85149;
    color: #fff;
    border-color: #f85149;
}

#gt-edge-close {
    background: #238636;
    color: #fff;
    border-color: #238636;
}

#gt-edge-close:hover {
    background: #2ea043;
}

/* Animation for new elements */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.gt-pulse {
    animation: pulse 0.3s ease;
}

/* Responsive */
@media (max-width: 700px) {
    .gt-side-panel {
        flex-direction: column;
    }
    
    .gt-iso-container {
        flex-direction: column;
    }
    
    .gt-module-nav button {
        font-size: 10px;
        padding: 6px 10px;
    }
}
