/* Model Comparison Page Styles */

/* Model Selection Grid */
.model-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.model-selection-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.model-selection-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.model-selection-card.selected {
    border-color: #0056b3;
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f2ff 100%);
}

.model-info h4 {
    margin-bottom: 0.5rem;
    color: #1a202c;
    font-size: 1.2rem;
}

.model-info p {
    color: #64748b;
    margin-bottom: 1rem;
}

.model-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.model-params {
    font-weight: 600;
    color: #0056b3;
    font-size: 0.9rem;
}

.selection-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

/* Comparison Actions */
.comparison-container h3 {
    margin-bottom: 1rem;
}

.comparison-actions {
    display: flex;
    gap: 1rem;
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card h4 {
    margin-bottom: 0.5rem;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card span {
    font-size: 2rem;
    font-weight: 700;
    color: #0056b3;
}

/* Comparison Table */
.comparison-table-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    position: relative;
}

.comparison-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: -0.5rem;
    padding: 0.5rem;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    margin: 0;
}

.comparison-table th,
.comparison-table td {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.comparison-table th {
    background-color: #f7fafc;
    font-weight: 600;
    color: #2d3748;
    position: sticky;
    top: 0;
    z-index: 10;
}

.comparison-table .aspect-label {
    font-weight: 600;
    color: #1a202c;
    background-color: #f8fafc;
    position: sticky;
    left: 0;
    z-index: 15;
    border-right: 2px solid #e2e8f0;
    min-width: 120px;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.comparison-table .aspect-label::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #f8fafc;
    z-index: -1;
}

.comparison-table th:first-child {
    position: sticky;
    left: 0;
    z-index: 20;
    border-right: 2px solid #e2e8f0;
    min-width: 120px;
    background-color: #f7fafc;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.comparison-table th:first-child::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #f7fafc;
    z-index: -1;
}

.comparison-table td {
    color: #4a5568;
}

/* Charts Container */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.chart-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.chart-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.chart-card h4 {
    margin-bottom: 1rem;
    color: #1a202c;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f1f5f9;
}

.chart-card canvas {
    height: 300px !important;
    width: 100% !important;
    max-width: 100%;
}

/* Animation for selected cards */
.model-selection-card.selected::before {
    content: '✓';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #0056b3;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.model-selection-card {
    position: relative;
}

/* Loading state for charts */
.chart-card.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.chart-card.loading::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #0056b3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .model-selection-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .model-selection-card {
        padding: 1rem;
    }
    
    .selection-controls {
        flex-direction: column;
    }
    
    .comparison-actions {
        flex-direction: row;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .quick-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card span {
        font-size: 1.5rem;
    }
    
    .comparison-table-container {
        padding: 1rem;
        margin: 0 0 2rem 0;
        border-radius: 8px;
    }
    
    .comparison-table-wrapper {
        margin: -0.25rem;
        padding: 0.25rem;
    }
    
    .comparison-table {
        min-width: 400px;
        font-size: 0.85rem;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .comparison-table .aspect-label,
    .comparison-table th:first-child {
        min-width: 100px;
        font-size: 0.8rem;
        box-shadow: 1px 0 3px rgba(0, 0, 0, 0.08);
        border-right: 1px solid #e2e8f0;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .chart-card {
        padding: 1rem;
    }
    
    .chart-card canvas {
        height: 250px !important;
    }
}

@media (max-width: 480px) {
    .model-meta {
        flex-direction: row;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .comparison-actions {
        flex-direction: row;
        gap: 0.75rem;
    }
    
    .comparison-actions .btn {
        text-align: center;
        justify-content: center;
    }
    
    .comparison-table {
        min-width: 300px;
        font-size: 0.7rem;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 0.5rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .comparison-table .aspect-label,
    .comparison-table th:first-child {
        min-width: 80px;
        font-size: 0.75rem;
        padding-right: 0.5rem;
        box-shadow: 1px 0 2px rgba(0, 0, 0, 0.06);
        border-right: 1px solid #e2e8f0;
    }
    
    .chart-card h4 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .chart-card canvas {
        height: 200px !important;
    }
    
    .stat-card {
        padding: 0.875rem;
    }
    
    .stat-card h4 {
        font-size: 0.8rem;
        margin-bottom: 0.375rem;
    }
    
    .stat-card span {
        font-size: 1.25rem;
    }
}

/* Responsive table scroll hint */
@media (max-width: 768px) {
    .comparison-table-container::-webkit-scrollbar {
        height: 6px;
    }
    
    .comparison-table-container::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }
    
    .comparison-table-container::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 3px;
    }
    
    .comparison-table-container::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
