/* Algorithm Visualizer Styles */
/* Shared CSS for algorithm visualization components */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

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

.control-group label {
    font-weight: 600;
    color: #495057;
    min-width: 80px;
}

.control-group select,
.control-group input[type="range"] {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
}

.control-group button {
    padding: 10px 20px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.control-group button:hover {
    background: #357abd;
}

.control-group button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.visualization {
    margin: 30px 0;
    min-height: 400px;
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 2px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    padding: 20px;
}

.bar {
    background: #4a90e2;
    border: 1px solid #333;
    min-width: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.bar.comparing {
    background: #e74c3c;
}

.bar.sorted {
    background: #27ae60;
}

.bar.active {
    background: #f39c12;
}

.bar-label {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 600;
}

.playback-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.playback-controls button {
    padding: 12px 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    min-width: 50px;
}

.playback-controls button:hover:not(:disabled) {
    background: #218838;
}

.playback-controls button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.metrics {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    padding: 20px;
    background: #e3f2fd;
    border-radius: 8px;
    border: 1px solid #bbdefb;
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.metric-label {
    font-size: 12px;
    font-weight: 600;
    color: #1976d2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: #1565c0;
}

.info-panel {
    padding: 20px;
    background: #e8f5e8;
    border-radius: 8px;
    border: 1px solid #c8e6c9;
}

.info-panel h3 {
    color: #2e7d32;
    margin-bottom: 15px;
    font-size: 18px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.info-item strong {
    color: #2e7d32;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.help-panel {
    margin-top: 30px;
    padding: 20px;
    background: #fff3cd;
    border-radius: 8px;
    border: 1px solid #ffeaa7;
}

.help-panel h3 {
    color: #856404;
    margin-bottom: 15px;
    font-size: 18px;
}

.help-panel ul {
    list-style: none;
    margin-bottom: 15px;
}

.help-panel li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.help-panel li:before {
    content: '•';
    color: #856404;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Graph Visualization Styles */
.visualization svg {
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.visualization circle {
    transition: all 0.3s ease;
}

.visualization line {
    transition: all 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .controls,
    .playback-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .control-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .metrics {
        flex-direction: column;
        gap: 20px;
    }
}

/* Back Button Styling */
.back-button {
    display: inline-block;
    padding: 12px 24px;
    background: #4a90e2;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.2s ease;
    margin: 20px 0;
}

.back-button:hover {
    background: #357abd;
    color: white;
    text-decoration: none;
}

/* Footer Styling */
footer {
    background: #2c3e50;
    color: white;
    margin-top: 50px;
    padding: 40px 0 20px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-social-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.footer-social-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #bdc3c7;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.footer-social-link:hover {
    color: white;
    background: #34495e;
    text-decoration: none;
}

.footer-social-link svg {
    width: 20px;
    height: 20px;
}

.footer-text {
    text-align: center;
    color: #95a5a6;
    font-size: 14px;
}

.footer-text p {
    margin: 0;
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-social-links {
        flex-direction: column;
        gap: 15px;
    }
    
    footer {
        padding: 30px 0 15px;
    }
}
