/* Models Page - Modern Colorful Design */
/* Following UI Style Guide principles */

/* ===== Page Header ===== */
#page-models .page-header {
    margin-bottom: 24px;
}

#page-models .page-title {
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Models Card ===== */
#page-models .card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
}

#page-models .card h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, #a855f715 0%, transparent 50%);
}

#page-models .card h3::before {
    content: '';
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #a855f725, #a855f710);
    border: 1px solid #a855f730;
    border-radius: 8px;
    box-shadow: 0 0 16px #a855f730;
}

/* ===== Models Table ===== */
#page-models .table {
    width: 100%;
    border-collapse: collapse;
}

#page-models .table thead {
    background: var(--bg-dark);
}

#page-models .table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

#page-models .table td {
    padding: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

#page-models .table tbody tr {
    transition: all 0.2s ease;
}

#page-models .table tbody tr:hover {
    background: var(--bg-hover);
}

#page-models .table tbody tr:last-child td {
    border-bottom: none;
}

/* Model ID column */
#page-models .table td:first-child {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.8rem;
    color: #a855f7;
    font-weight: 600;
}

/* Model Name column */
#page-models .table td:nth-child(2) {
    color: var(--text-primary);
    font-weight: 600;
}

/* Model Type Badge */
.model-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.model-type-badge.prediction {
    background: #3b82f620;
    color: #3b82f6;
    border: 1px solid #3b82f630;
}

.model-type-badge.generator {
    background: #22c55e20;
    color: #22c55e;
    border: 1px solid #22c55e30;
}

.model-type-badge.classifier {
    background: #f59e0b20;
    color: #f59e0b;
    border: 1px solid #f59e0b30;
}

/* Accuracy Indicator */
.accuracy-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.accuracy-bar {
    width: 60px;
    height: 6px;
    background: var(--bg-dark);
    border-radius: 3px;
    overflow: hidden;
}

.accuracy-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.accuracy-fill.high {
    background: linear-gradient(90deg, #22c55e, #3b82f6);
}

.accuracy-fill.medium {
    background: linear-gradient(90deg, #f59e0b, #eab308);
}

.accuracy-fill.low {
    background: linear-gradient(90deg, #ef4444, #f59e0b);
}

.accuracy-value {
    font-weight: 600;
    font-size: 0.9rem;
}

.accuracy-value.high { color: #22c55e; }
.accuracy-value.medium { color: #f59e0b; }
.accuracy-value.low { color: #ef4444; }

/* Drift Score Badge */
.drift-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.drift-badge.low {
    background: #22c55e20;
    color: #22c55e;
    border: 1px solid #22c55e30;
}

.drift-badge.medium {
    background: #f59e0b20;
    color: #f59e0b;
    border: 1px solid #f59e0b30;
}

.drift-badge.high {
    background: #ef444420;
    color: #ef4444;
    border: 1px solid #ef444430;
}

/* Status Badge */
#page-models .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

#page-models .status-badge.running,
#page-models .status-badge.active {
    background: #22c55e20;
    color: #22c55e;
    border: 1px solid #22c55e30;
}

#page-models .status-badge.running::before,
#page-models .status-badge.active::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse 1.5s infinite;
}

#page-models .status-badge.idle,
#page-models .status-badge.inactive {
    background: var(--bg-hover);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

#page-models .status-badge.warning,
#page-models .status-badge.degraded {
    background: #f59e0b20;
    color: #f59e0b;
    border: 1px solid #f59e0b30;
}

#page-models .status-badge.healthy {
    background: #22c55e15;
    color: #22c55e;
    border: 1px solid #22c55e25;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Action Button */
#page-models .btn-sm {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

#page-models .btn-sm:hover {
    background: #a855f715;
    border-color: #a855f740;
    color: #a855f7;
}

/* ===== Model Info Modal ===== */
.model-info-modal .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.model-info-modal .detail-row:last-child {
    border-bottom: none;
}

.model-info-modal .detail-row span:first-child {
    color: var(--text-muted);
}

.model-info-modal .detail-row span:last-child {
    color: var(--text-primary);
    font-weight: 500;
}

/* ===== Animations ===== */
#page-models .card {
    animation: cardAppear 0.4s ease forwards;
    opacity: 0;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#page-models .table tbody tr {
    animation: rowAppear 0.3s ease forwards;
    opacity: 0;
}

#page-models .table tbody tr:nth-child(1) { animation-delay: 100ms; }
#page-models .table tbody tr:nth-child(2) { animation-delay: 150ms; }
#page-models .table tbody tr:nth-child(3) { animation-delay: 200ms; }
#page-models .table tbody tr:nth-child(4) { animation-delay: 250ms; }
#page-models .table tbody tr:nth-child(5) { animation-delay: 300ms; }

@keyframes rowAppear {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    #page-models .table {
        font-size: 0.8rem;
    }

    #page-models .table th,
    #page-models .table td {
        padding: 10px 12px;
    }

    .accuracy-bar {
        display: none;
    }
}
