﻿:root {
    --ai-bg: #0f172a;
    --ai-panel: #1e293b;
    --ai-border: #334155;
    --ai-text: #f8fafc;
    --ai-muted: #94a3b8;
    --ai-cyan: #06b6d4;
    --ai-blue: #3b82f6;
    --ai-red: #ef4444;
    --ai-green: #10b981;
}

/* Modal Base */
#vram-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.vram-modal-hidden {
    opacity: 0 !important;
    pointer-events: none;
}

.vram-modal-container {
    background: var(--ai-bg);
    border: 1px solid var(--ai-border);
    border-radius: 12px;
    width: 900px;
    max-width: 95vw;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

/* Header */
.vram-modal-header {
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--ai-border);
    color: var(--ai-text);
}

    .vram-modal-header h4 {
        margin: 0;
        font-size: 1.1rem;
    }

.vram-close-btn {
    background: none;
    border: none;
    color: var(--ai-text);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Body */
.vram-modal-body {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
}

.vram-panel {
    flex: 1;
    background: var(--ai-panel);
    border: 1px solid var(--ai-border);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.vram-panel-title {
    font-weight: 600;
    color: var(--ai-text);
    text-align: center;
    border-bottom: 1px dashed var(--ai-border);
    padding-bottom: 0.5rem;
}

/* Controls */
.vram-control-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

    .vram-control-group label {
        color: var(--ai-text);
        font-weight: 500;
        font-size: 0.9rem;
    }

.vram-hint {
    font-size: 0.75rem;
    color: var(--ai-muted);
}

.vram-select {
    width: 100%;
    padding: 0.5rem;
    background: var(--ai-bg);
    color: var(--ai-text);
    border: 1px solid var(--ai-border);
    border-radius: 6px;
    outline: none;
}

.vram-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Toggle Switch (Tumb) */
.vram-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

    .vram-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.vram-slider-switch {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--ai-border);
    transition: .4s;
    border-radius: 24px;
}

    .vram-slider-switch:before {
        position: absolute;
        content: "";
        height: 18px;
        width: 18px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        transition: .4s;
        border-radius: 50%;
    }

.vram-switch input:checked + .vram-slider-switch {
    background-color: var(--ai-cyan);
}

    .vram-switch input:checked + .vram-slider-switch:before {
        transform: translateX(20px);
    }

/* Range Slider */
.vram-range {
    width: 100%;
    cursor: pointer;
    accent-color: var(--ai-cyan);
}

/* Visualizer Chart */
.vram-chart-container {
    text-align: center;
    margin-top: 1rem;
}

.vram-metric-large {
    font-size: 3rem;
    font-weight: bold;
    color: var(--ai-text);
    line-height: 1;
}

.vram-unit {
    font-size: 1.5rem;
    color: var(--ai-muted);
    font-weight: normal;
}

.vram-metric-label {
    font-size: 0.85rem;
    color: var(--ai-muted);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* The Bar */
.vram-bar-wrapper {
    background: #0f172a;
    height: 24px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 1px solid var(--ai-border);
}

.vram-server-limit {
    position: absolute;
    left: 80%;
    top: 0;
    height: 100%;
    width: 2px;
    background: rgba(255, 255, 255, 0.2);
    border-left: 1px dashed white;
    z-index: 10;
}

.vram-bar {
    height: 100%;
    width: 100%;
    border-radius: 12px;
    transition: width 0.4s ease-out, background-color 0.4s ease;
}

.vram-bar-danger {
    background-color: var(--ai-red);
}

.vram-bar-safe {
    background-color: var(--ai-cyan);
}

.vram-bar-optimal {
    background-color: var(--ai-green);
}

/* Badges */
.vram-status-badges {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.vram-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    background: rgba(255,255,255,0.1);
    color: var(--ai-muted);
}

.vram-badge-active {
    background: rgba(6, 182, 212, 0.15);
    color: var(--ai-cyan);
    border: 1px solid var(--ai-cyan);
}

.vram-badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--ai-red);
    border: 1px solid var(--ai-red);
}

.vram-badge-optimal {
    background: rgba(16, 185, 129, 0.15);
    color: var(--ai-green);
    border: 1px solid var(--ai-green);
}

.vram-deploy-action {
    margin-top: auto;
    text-align: center;
}

/* Mobile Adaptability */
.vram-modal-container {
    max-height: 95vh;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .vram-modal-body {
        flex-direction: column;
        padding: 1rem;
    }

    .vram-panel {
        padding: 1rem;
    }

    .vram-metric-large {
        font-size: 2.5rem;
    }

    .vram-modal-container {
        width: 100%;
        border-radius: 8px;
    }
}
