/* ==============================================
   GRAPH SEARCH ALGORITHMS VISUALIZATION - CSS
   ============================================== */

/* Container */
.gs-container {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    background: #0d1117;
    border-radius: 12px;
    padding: 20px;
    box-sizing: border-box;
}

/* Algorithm Selection Tabs */
.gs-algo-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.gs-algo-tabs button {
    background: #21262d;
    border: 1px solid #30363d;
    color: #8b949e;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    transition: all 0.2s ease;
}

.gs-algo-tabs button:hover {
    background: #30363d;
    color: #c9d1d9;
}

.gs-algo-tabs button.active {
    background: #238636;
    border-color: #238636;
    color: #fff;
}

.gs-algo-tabs button[data-algo="bfs"].active { background: #2188ff; border-color: #2188ff; }
.gs-algo-tabs button[data-algo="dfs"].active { background: #a371f7; border-color: #a371f7; }
.gs-algo-tabs button[data-algo="components"].active { background: #f0883e; border-color: #f0883e; }
.gs-algo-tabs button[data-algo="bipartite"].active { background: #ff6b9d; border-color: #ff6b9d; }
.gs-algo-tabs button[data-algo="cycle"].active { background: #f85149; border-color: #f85149; }

/* Control Panel */
.gs-control-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    background: #161b22;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

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

.gs-control-group label {
    color: #8b949e;
    font-size: 12px;
}

.gs-control-panel button {
    background: #21262d;
    border: 1px solid #30363d;
    color: #c9d1d9;
    padding: 8px 14px;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    transition: all 0.15s ease;
}

.gs-control-panel button:hover {
    background: #30363d;
}

.gs-control-panel button.primary {
    background: #238636;
    border-color: #238636;
    color: #fff;
}

.gs-control-panel button.primary:hover {
    background: #2ea043;
}

.gs-control-panel button.danger {
    background: #21262d;
    border-color: #f85149;
    color: #f85149;
}

.gs-control-panel button.danger:hover {
    background: #f8514933;
}

.gs-control-panel button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Speed Slider */
.gs-speed-slider {
    width: 100px;
    accent-color: #58a6ff;
}

/* Graph Properties */
.gs-control-panel input[type="checkbox"] {
    accent-color: #58a6ff;
}

/* Main Layout */
.gs-main-layout {
    display: flex;
    gap: 15px;
    min-height: 450px;
}

/* Canvas Container */
.gs-canvas-container {
    flex: 1;
    position: relative;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    overflow: hidden;
    min-height: 400px;
}

.gs-canvas-container canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

/* Side Panel - Data Structures */
.gs-side-panel {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Structure Visualization (Queue/Stack) */
.gs-structure-viz {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 12px;
}

.gs-structure-viz h4 {
    color: #58a6ff;
    font-size: 13px;
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #30363d;
}

.gs-structure-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 40px;
}

.gs-structure-item {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3498db;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    border-radius: 5px;
    animation: itemPop 0.2s ease;
}

.gs-structure-item.stack {
    background: #a371f7;
}

.gs-structure-item.front {
    border: 2px solid #f0b429;
    box-shadow: 0 0 8px #f0b42966;
}

@keyframes itemPop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Log Window */
.gs-log-window {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 12px;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 180px;
    max-height: 220px;
}

.gs-log-window h4 {
    color: #7ee787;
    font-size: 13px;
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #30363d;
    flex-shrink: 0;
}

.gs-log-content {
    flex: 1;
    overflow-y: auto;
    font-size: 11px;
    height: 150px;
}

.gs-log-entry {
    color: #8b949e;
    padding: 4px 0;
    border-bottom: 1px solid #21262d;
}

.gs-log-entry:last-child {
    border-bottom: none;
}

.gs-log-entry.highlight {
    color: #f0b429;
    font-weight: bold;
}

.gs-log-entry.success {
    color: #7ee787;
}

.gs-log-entry.error {
    color: #f85149;
}

.gs-log-entry .step-num {
    color: #58a6ff;
    margin-right: 8px;
}

/* Algorithm Info Panel */
.gs-algo-info {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 12px;
}

.gs-algo-info h4 {
    color: #f0883e;
    font-size: 13px;
    margin: 0 0 8px 0;
}

.gs-algo-info p {
    color: #8b949e;
    font-size: 11px;
    margin: 0;
    line-height: 1.5;
}

/* Stats Row */
.gs-stats-row {
    display: flex;
    gap: 15px;
    padding: 10px 15px;
    background: #161b22;
    border-radius: 8px;
    margin-top: 10px;
}

.gs-stat {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gs-stat .label {
    color: #8b949e;
    font-size: 11px;
}

.gs-stat .value {
    color: #7ee787;
    font-size: 13px;
    font-weight: bold;
}

/* Legend */
.gs-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px 15px;
    background: #161b22;
    border-radius: 8px;
    margin-top: 10px;
}

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

.gs-legend-color {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid #30363d;
}

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

.gs-instructions span {
    color: #58a6ff;
}

/* Result Banner */
.gs-result-banner {
    display: none;
    padding: 12px 20px;
    background: #238636;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    text-align: center;
    margin-top: 10px;
    animation: fadeIn 0.3s ease;
}

.gs-result-banner.error {
    background: #f85149;
}

.gs-result-banner.warning {
    background: #f0883e;
}

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

/* Preset Dropdown */
.gs-preset-select {
    background: #21262d;
    color: #58a6ff;
    border: 1px solid #30363d;
    padding: 8px 12px;
    border-radius: 5px;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
}

/* Start Node Selector */
.gs-start-node {
    width: 60px;
    background: #21262d;
    color: #7ee787;
    border: 1px solid #30363d;
    padding: 6px 10px;
    border-radius: 5px;
    font-family: inherit;
    font-size: 12px;
    text-align: center;
}

/* Distance/Layer Colors for BFS */
.layer-0 { background: #f85149 !important; }
.layer-1 { background: #f0883e !important; }
.layer-2 { background: #f0b429 !important; }
.layer-3 { background: #3fb950 !important; }
.layer-4 { background: #58a6ff !important; }
.layer-5 { background: #a371f7 !important; }

/* Bipartite Colors */
.bipartite-red { background: #f85149 !important; }
.bipartite-blue { background: #58a6ff !important; }

/* Component Colors - Pastel Palette */
.component-0 { background: #ff6b9d !important; }
.component-1 { background: #00d4ff !important; }
.component-2 { background: #7ee787 !important; }
.component-3 { background: #f0b429 !important; }
.component-4 { background: #a371f7 !important; }
.component-5 { background: #ff9f43 !important; }

/* Preset Buttons */
.gs-preset-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.gs-preset-btn {
    background: #21262d;
    border: 1px solid #30363d;
    color: #8b949e;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.gs-preset-btn:hover {
    background: #30363d;
    color: #c9d1d9;
}

/* Scrollbar Styling */
.gs-log-content::-webkit-scrollbar {
    width: 6px;
}

.gs-log-content::-webkit-scrollbar-track {
    background: #21262d;
    border-radius: 3px;
}

.gs-log-content::-webkit-scrollbar-thumb {
    background: #484f58;
    border-radius: 3px;
}

.gs-log-content::-webkit-scrollbar-thumb:hover {
    background: #6e7681;
}

/* Discovery/Finish Time Display */
.gs-time-display {
    position: absolute;
    font-size: 9px;
    color: #8b949e;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 900px) {
    .gs-main-layout {
        flex-direction: column;
    }
    
    .gs-side-panel {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .gs-structure-viz,
    .gs-log-window {
        flex: 1;
        min-width: 200px;
    }
}

/* Fix for parent container */
#content_sim {
    background-color: #0d1117;
}
