/* filepath: c:\Users\David\OneDrive\Desktop\Website\portfolio-website\css\sorting-visualizer.css */
/* Sorting Visualizer Styles - Updated Dark Theme */

.visualizer-section {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
    margin-bottom: 30px; /* Increased from 30px to create proper gap */
}

/* Controls Panel */
.controls-panel {
    background: #2a2a2a;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #3a3a3a;
}

.algorithm-selector, .size-control, .speed-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.algorithm-selector label,
.size-control label,
.speed-control label {
    font-weight: 600;
    color: #e0e0e0;
}

.algorithm-selector select {
    padding: 8px 12px;
    border: 2px solid #3a3a3a;
    border-radius: 6px;
    font-size: 1rem;
    background: #1f1f1f;
    color: #e0e0e0;
    cursor: pointer;
    transition: border-color 0.3s;
}

.algorithm-selector select:hover,
.algorithm-selector select:focus {
    border-color: #10b981;
    outline: none;
}

.algorithm-selector select option {
    background: #1f1f1f;
    color: #e0e0e0;
}

input[type="range"] {
    width: 120px;
    cursor: pointer;
    background: #3a3a3a;
}

input[type="range"]::-webkit-slider-thumb {
    background: #10b981;
}

input[type="range"]::-moz-range-thumb {
    background: #10b981;
}

#sizeValue, #speedValue {
    font-weight: 600;
    color: #10b981;
    min-width: 50px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: #3a3a3a;
    color: #e0e0e0;
}

.btn-secondary:hover {
    background: #4a4a4a;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 158, 11, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Visualization Container */
.visualization-container {
    background: #2a2a2a;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    margin-bottom: 20px;
    position: relative;
    border: 1px solid #3a3a3a;
}

#sortCanvas {
    width: 100%;
    height: 400px;
    display: block;
    background: #1f1f1f;
    border-radius: 8px;
}

/* Stats Panel */
.stats-panel {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #3a3a3a;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-label {
    font-weight: 600;
    color: #9ca3af;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #10b981;
}

/* Algorithm Info Panel */
.algorithm-info {
    background: #2a2a2a;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    margin-bottom: 20px;
    border: 1px solid #3a3a3a;
}

.algorithm-info h3 {
    color: #10b981;
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #3a3a3a;
}

.complexity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.complexity-item {
    padding: 10px;
    background: #1f1f1f;
    border-radius: 6px;
    border-left: 3px solid #10b981;
}

.complexity-item strong {
    display: block;
    color: #9ca3af;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.complexity-item span {
    color: #10b981;
    font-size: 1.1rem;
    font-weight: 600;
}

.algorithm-description {
    color: #b0b0b0;
    line-height: 1.6;
    margin-top: 20px;
}

/* Legend */
.legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    padding: 20px;
    background: #1a1a1a;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.5);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border: 1px solid #2a2a2a;
    border-radius: 3px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .controls-panel {
        flex-direction: column;
        align-items: stretch;
    }
    
    .algorithm-selector,
    .size-control,
    .speed-control {
        justify-content: space-between;
    }
    
    .action-buttons {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .visualizer-section {
        padding: 15px;
        margin-bottom: 40px; /* Maintain gap on mobile */
    }
    
    .controls-panel {
        padding: 15px;
    }
    
    #sortCanvas {
        height: 300px;
    }
    
    .stats-panel {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .complexity-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .action-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    
    input[type="range"] {
        width: 100px;
    }
}