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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
header {
    text-align: center;
    color: white;
    padding: 30px 0;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 12px;
    justify-content: center;
}

.tab-btn {
    flex: 0 1 auto;
    min-width: 250px;
    padding: 18px 30px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.2em;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Card Sections */
.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.card h3 {
    color: #764ba2;
    margin: 15px 0 10px 0;
    font-size: 1.3em;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

input[type="number"],
input[type="text"],
select {
    width: 100%;
    max-width: 300px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: #667eea;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    margin-right: 10px;
    margin-top: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85em;
    margin: 2px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Algorithms Grid */
.algorithms-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.algorithms-grid label {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.algorithms-grid label:hover {
    background: #e9ecef;
}

.algorithms-grid input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Datasets Container */
.datasets-container {
    margin-top: 20px;
}

#datasets-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.dataset-item {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dataset-info {
    flex: 1;
}

.dataset-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
    justify-content: flex-end;
    margin-top: auto;
}

.dataset-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.dataset-item.selected {
    border-color: #667eea;
    background: #e7eafd;
}

.dataset-item strong {
    color: #667eea;
}

/* Characteristics Display */
#dataset-characteristics {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.char-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.char-item {
    background: white;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.char-item strong {
    display: block;
    color: #667eea;
    margin-bottom: 5px;
}

/* Recommendation Box */
.recommendation-box {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    border-radius: 8px;
    padding: 20px;
    border-left: 5px solid #f39c12;
}

.recommendation-box h3 {
    color: #d35400;
    margin-bottom: 10px;
}

.recommendation-box .complexity {
    font-weight: bold;
    color: #e67e22;
}

.recommendation-box .alternatives,
.recommendation-box .warnings {
    margin-top: 15px;
}

.recommendation-box ul {
    list-style-position: inside;
    margin-top: 8px;
}

/* Results Table */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.results-table th,
.results-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.results-table th {
    background: #667eea;
    color: white;
    font-weight: 600;
}

.results-table tr:hover {
    background: #f8f9fa;
}

.results-table .best-time {
    background: #d4edda;
    font-weight: bold;
}

/* Search result indicators */
.found-yes {
    color: #28a745;
    font-weight: bold;
    font-size: 1.2em;
}

.found-no {
    color: #dc3545;
    font-weight: bold;
    font-size: 1.2em;
}

/* Benchmark Results */
.benchmark-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #667eea;
}

.stat-card h4 {
    color: #667eea;
    margin-bottom: 15px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

.stat-row:last-child {
    border-bottom: none;
}

/* Visualization */
.visualization-setup,
.visualization-player {
    margin: 20px 0;
}

.visualization-player {
    text-align: center;
}

#visualization-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin: 15px 0;
}

.speed-control input[type="range"] {
    width: 200px;
}

.step-info {
    text-align: center;
    font-size: 1.1em;
    font-weight: 600;
    color: #667eea;
    margin: 10px 0;
}

#visualization-canvas {
    width: 100%;
    max-width: 900px;
    height: 450px;
    border: 3px solid #667eea;
    border-radius: 8px;
    margin: 20px auto;
    display: block;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.vis-description {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 15px;
    margin-top: 15px;
    border-radius: 4px;
    font-size: 1.05em;
}
    background: white;
}

#visualization-controls {
    margin-bottom: 20px;
}

#visualization-description {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #667eea;
    margin-top: 15px;
    font-weight: 500;
}

#speed-slider {
    width: 200px;
    margin-left: 10px;
}

/* Footer */
footer {
    text-align: center;
    color: white;
    padding: 20px 0;
    margin-top: 30px;
    opacity: 0.9;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

    header h1 {
        font-size: 2em;
    }

    .card {
        padding: 15px;
    }

    .btn {
        width: 100%;
        margin-right: 0;
    }
}

