/* Max-Flow Min-Cut Simulator Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(26, 26, 46, 0.8);
    border-radius: 10px;
    border: 1px solid #333;
}

header h1 {
    font-size: 2.5rem;
    color: #4488ff;
    text-shadow: 0 0 20px rgba(68, 136, 255, 0.5);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: #888;
    font-weight: 300;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    margin-bottom: 20px;
}

/* Canvas Container */
.canvas-container {
    position: relative;
    background: #0a0a0f;
    border-radius: 10px;
    border: 2px solid #333;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

#flowCanvas {
    display: block;
    width: 100%;
    cursor: crosshair;
}

.canvas-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #444;
    font-size: 0.85rem;
    color: #aaa;
}

.overlay-text p {
    margin: 5px 0;
}

/* Controls Panel */
.controls-panel {
    background: rgba(26, 26, 46, 0.9);
    border-radius: 10px;
    border: 1px solid #333;
    padding: 20px;
    height: fit-content;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.control-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
}

.control-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.control-section h3 {
    font-size: 1.1rem;
    color: #4488ff;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Buttons */
.button-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #4488ff, #3366cc);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5599ff, #4477dd);
}

.btn-success {
    background: linear-gradient(135deg, #00cc66, #009944);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #00dd77, #00aa55);
}

.btn-warning {
    background: linear-gradient(135deg, #ff9900, #cc7700);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #ffaa11, #dd8811);
}

.btn-danger {
    background: linear-gradient(135deg, #ff4444, #cc2222);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #ff5555, #dd3333);
}

/* Slider */
.slider-group {
    margin-top: 15px;
}

.slider-group label {
    display: block;
    margin-bottom: 8px;
    color: #aaa;
    font-size: 0.9rem;
}

.slider-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #333;
    outline: none;
    -webkit-appearance: none;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4488ff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(68, 136, 255, 0.5);
}

.slider-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4488ff;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(68, 136, 255, 0.5);
}

#speedValue {
    display: inline-block;
    margin-left: 10px;
    color: #4488ff;
    font-weight: bold;
}

/* Checkboxes */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #aaa;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.checkbox-label:hover {
    color: #fff;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4488ff;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.stat-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #333;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.3rem;
    font-weight: bold;
    color: #4488ff;
}

/* Path Display */
.path-display {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #333;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #aaa;
    line-height: 1.6;
}

/* Legend */
.legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #aaa;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid;
}

.legend-color.source {
    background: #00ff00;
    border-color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.legend-color.sink {
    background: #ff4444;
    border-color: #ff4444;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

.legend-color.normal {
    background: #4488ff;
    border-color: #4488ff;
    box-shadow: 0 0 10px rgba(68, 136, 255, 0.5);
}

.legend-color.saturated {
    background: #ff4444;
    border-color: #ff4444;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.8);
}

.legend-color.mincut {
    background: transparent;
    border-color: #ff4444;
    border-width: 3px;
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.8);
}

.legend-color.augmenting {
    background: #ffff00;
    border-color: #ffff00;
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.5);
}

/* Footer */
footer {
    text-align: center;
    padding: 15px;
    background: rgba(26, 26, 46, 0.8);
    border-radius: 10px;
    border: 1px solid #333;
    color: #666;
    font-size: 0.9rem;
}

/* Scrollbar Styling */
.controls-panel::-webkit-scrollbar {
    width: 8px;
}

.controls-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.controls-panel::-webkit-scrollbar-thumb {
    background: #4488ff;
    border-radius: 4px;
}

.controls-panel::-webkit-scrollbar-thumb:hover {
    background: #5599ff;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .controls-panel {
        max-height: none;
    }

    header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .button-group {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .canvas-overlay {
        font-size: 0.75rem;
        padding: 10px;
    }
}

/* Animation for complete state */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.complete-animation {
    animation: pulse 2s ease-in-out infinite;
}

/* Focus styles for accessibility */
.btn:focus,
input:focus,
checkbox:focus {
    outline: 2px solid #4488ff;
    outline-offset: 2px;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(68, 136, 255, 0.9);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
