/* ============================================
   VARIABLES CSS - Interface Proxmox
============================================ */
:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-accent: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
    --accent-blue: #60a5fa;
    --accent-indigo: #818cf8;
    --accent-teal: #2dd4bf;
    --accent-purple: #a78bfa;
    --accent-orange: #fb923c;
    --accent-green: #4ade80;
    --accent-red: #f87171;
}

/* ============================================
   RESET & BASE
============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   CONTAINER
============================================ */
.proxmox-container {
    padding: 2rem;
    max-width: 2400px;
    margin: 0 auto;
    min-height: 100vh;
}

/* ============================================
   HEADER
============================================ */
.proxmox-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 20px;
    border: 2px solid var(--border);
    position: relative;
}

.proxmox-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    font-size: 3rem;
}

.proxmox-header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.back-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: rgba(96, 165, 250, 0.1);
    color: var(--accent-blue);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    border: 2px solid var(--accent-blue);
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: var(--accent-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(96, 165, 250, 0.3);
}

/* ============================================
   MAIN LAYOUT
============================================ */
.proxmox-main {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    min-height: 70vh;
}

/* ============================================
   SIDEBAR
============================================ */
.proxmox-sidebar {
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 2px solid var(--border);
    padding: 1.5rem;
    max-height: 80vh;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(96, 165, 250, 0.1);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(96, 165, 250, 0.2);
}

.datacenter-icon {
    font-size: 1.5rem;
}

.datacenter-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

/* Node Section */
.node-section {
    margin-bottom: 1.5rem;
}

.node-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(129, 140, 248, 0.1);
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid rgba(129, 140, 248, 0.2);
}

.node-icon {
    font-size: 1.3rem;
}

.node-name {
    font-weight: 600;
    color: var(--text-primary);
}

/* VM List */
.vm-list {
    margin-left: 1rem;
    margin-bottom: 1.5rem;
}

.vm-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: rgba(51, 65, 85, 0.5);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.vm-item:hover {
    background: rgba(96, 165, 250, 0.1);
    border-color: var(--accent-blue);
    transform: translateX(5px);
}

.vm-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.vm-status.running {
    background: var(--accent-green);
    box-shadow: 0 0 10px var(--accent-green);
}

.vm-status.stopped {
    background: var(--text-secondary);
}

.vm-id {
    font-weight: 600;
    color: var(--accent-blue);
    min-width: 30px;
}

.vm-name {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Storage Section */
.storage-section {
    margin-left: 1rem;
    margin-top: 1.5rem;
}

.storage-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: rgba(51, 65, 85, 0.3);
    border-radius: 8px;
}

.storage-icon {
    font-size: 1.2rem;
}

.storage-name {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ============================================
   CONTENT AREA
============================================ */
.proxmox-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 2px solid var(--border);
    padding: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-screen {
    text-align: center;
    max-width: 600px;
}

.welcome-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.welcome-screen h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.welcome-screen p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: rgba(51, 65, 85, 0.5);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(96, 165, 250, 0.1);
    border-color: var(--accent-blue);
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================================
   VM MODAL
============================================ */
.vm-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { 
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to { 
        opacity: 1;
        backdrop-filter: blur(10px);
    }
}

.vm-modal-content {
    background: #334d66;
    margin: 3% auto;
    padding: 0;
    border: 2px solid #4a6380;
    border-radius: 24px;
    width: 90%;
    max-width: 900px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.7);
    position: relative;
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-100px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Close Button */
.vm-modal-close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10;
    background: rgba(0, 0, 0, 0.3);
    line-height: 1;
}

.vm-modal-close:hover {
    color: var(--accent-blue);
    background: rgba(96, 165, 250, 0.2);
    transform: rotate(90deg) scale(1.1);
}

/* Modal Header */
.vm-modal-header {
    background: rgba(42, 63, 84, 0.8);
    padding: 2.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-bottom: 1px solid rgba(96, 165, 250, 0.2);
    position: relative;
}

.vm-modal-logo {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #5b8bb8, #7ba5d1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(91, 139, 184, 0.4);
    overflow: hidden;
}

.vm-logo-img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.vm-modal-header-text {
    flex: 1;
}

.vm-modal-status {
    margin-bottom: 0.5rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge.running {
    background: rgba(74, 222, 128, 0.2);
    color: var(--accent-green);
    border: 1px solid var(--accent-green);
}

.status-badge.running::before {
    content: '🟢';
    font-size: 0.8rem;
}

.status-badge.stopped {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-secondary);
    border: 1px solid var(--text-secondary);
}

.status-badge.stopped::before {
    content: '⚫';
    font-size: 0.8rem;
}

.vm-modal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.vm-modal-id {
    font-size: 1rem;
    color: #7ba5d1;
    font-weight: 600;
    margin: 0;
}

/* Modal Body */
.vm-modal-body {
    padding: 2.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.vm-modal-description {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #cbd5e1;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: rgba(42, 63, 84, 0.5);
    border-radius: 12px;
    border-left: 4px solid #5b8bb8;
}

/* Specs Section */
.vm-modal-specs {
    background: rgba(42, 63, 84, 0.6);
    border-radius: 16px;
    padding: 2rem;
    border: 2px solid rgba(91, 139, 184, 0.3);
    margin-bottom: 2rem;
}

.vm-modal-specs h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: #7ba5d1;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    background: rgba(42, 63, 84, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(91, 139, 184, 0.2);
    transition: all 0.3s ease;
}

.spec-item:hover {
    background: rgba(91, 139, 184, 0.1);
    border-color: rgba(91, 139, 184, 0.4);
}

.spec-label {
    font-weight: 600;
    color: #94a3b8;
    font-size: 0.9rem;
}

.spec-value {
    color: #2dd4bf;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Usage Section */
.vm-modal-usage {
    background: rgba(42, 63, 84, 0.6);
    border-radius: 16px;
    padding: 2rem;
    border: 2px solid rgba(91, 139, 184, 0.3);
}

.vm-modal-usage h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: #7ba5d1;
}

.usage-content {
    color: #cbd5e1;
    line-height: 1.7;
}

.usage-content ul {
    list-style: none;
    padding-left: 0;
}

.usage-content li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.usage-content li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #7ba5d1;
    font-weight: bold;
}

/* ============================================
   SCROLLBAR
============================================ */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-indigo);
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 1200px) {
    .proxmox-main {
        grid-template-columns: 300px 1fr;
    }
}

@media (max-width: 968px) {
    .proxmox-main {
        grid-template-columns: 1fr;
    }

    .proxmox-sidebar {
        max-height: 400px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .specs-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .proxmox-container {
        padding: 1rem;
    }

    .proxmox-header h1 {
        font-size: 1.8rem;
    }

    .vm-modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .vm-modal-header {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
    }

    .vm-modal-logo {
        width: 80px;
        height: 80px;
    }

    .vm-logo-img {
        width: 60px;
        height: 60px;
    }
}