/* Variables & Base System */
:root {
    --bg-gradient: radial-gradient(circle at 10% 20%, rgb(245, 247, 252) 0%, rgb(230, 235, 248) 90%);
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(0, 0, 0, 0.08);
    --card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.06);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --primary-color: #7f00ff;
    --secondary-color: #0284c7;
    
    /* Status Colors */
    --color-green: #10b981;
    --color-yellow: #f59e0b;
    --color-red: #ef4444;
    --color-gray: #64748b;
    
    --color-green-rgb: 16, 185, 129;
    --color-yellow-rgb: 245, 158, 11;
    --color-red-rgb: 239, 68, 68;
    --color-gray-rgb: 100, 116, 139;
    
    /* Text Colors */
    --text-main: #0f172a;
    --text-muted: rgba(15, 23, 42, 0.6);
    --text-cyan: #0284c7;
    --text-cyan-rgb: 2, 132, 199;
    
    /* Extra Variables */
    --box-bg: rgba(0, 0, 0, 0.03);
    --box-border: rgba(0, 0, 0, 0.06);
    --modal-bg: #ffffff;
    --row-hover-bg: rgba(0, 0, 0, 0.02);
    --btn-bg: rgba(0, 0, 0, 0.04);
    --btn-border: rgba(0, 0, 0, 0.08);
    --hover-border: rgba(127, 0, 255, 0.3);

    /* Terminal Variables */
    --terminal-bg: #f8fafc;
    --terminal-header-bg: #e2e8f0;
    --terminal-text: #0f172a;
    --terminal-shadow: inset 0 0 6px rgba(0, 0, 0, 0.05);
    --terminal-title-color: #475569;
    --terminal-line-num-border: #cbd5e1;
    --terminal-line-num-color: #64748b;
}

html.dark {
    --bg-gradient: radial-gradient(circle at 10% 20%, rgb(15, 12, 30) 0%, rgb(20, 24, 45) 90%);
    --card-bg: rgba(30, 35, 60, 0.35);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --primary-color: #7f00ff;
    --secondary-color: #00e5ff;
    
    /* Status Colors */
    --color-green: #00e676;
    --color-yellow: #ffd600;
    --color-red: #ff1744;
    --color-gray: #b0bec5;
    
    --color-green-rgb: 0, 230, 118;
    --color-yellow-rgb: 255, 214, 0;
    --color-red-rgb: 255, 23, 68;
    --color-gray-rgb: 176, 190, 197;
    
    /* Text Colors */
    --text-main: #f5f6fa;
    --text-muted: rgba(245, 246, 250, 0.65);
    --text-cyan: #00e5ff;
    --text-cyan-rgb: 0, 229, 255;
    
    /* Extra Variables */
    --box-bg: rgba(0, 0, 0, 0.2);
    --box-border: rgba(255, 255, 255, 0.05);
    --modal-bg: #131524;
    --row-hover-bg: rgba(255, 255, 255, 0.02);
    --btn-bg: rgba(255, 255, 255, 0.05);
    --btn-border: rgba(255, 255, 255, 0.1);
    --hover-border: rgba(255, 255, 255, 0.18);

    /* Terminal Variables */
    --terminal-bg: #0b0d19;
    --terminal-header-bg: #151a2e;
    --terminal-text: #e3e9f0;
    --terminal-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
    --terminal-title-color: rgba(245, 246, 250, 0.65);
    --terminal-line-num-border: #1f2430;
    --terminal-line-num-color: #4f5b66;
}

.vm-monitoring-tab {
    background: var(--bg-gradient);
    font-family: var(--font-body);
    color: var(--text-main);
    min-height: 100vh;
    padding: 2.5rem 1.5rem;
    border-radius: 24px;
    margin-top: 1.5rem;
}

.glass-bg-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Glassmorphism Card Style Helper */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

.card-hover {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
}

.card-hover:hover {
    transform: translateY(-4px);
    border-color: var(--hover-border);
    box-shadow: 0 12px 40px 0 rgba(127, 0, 255, 0.25);
}

/* Dashboard Header */
.dashboard-header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.brand-logo {
    font-size: 2.5rem;
    animation: brainPulse 2s infinite ease-in-out;
}

.brand-text h1 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(45deg, #00e5ff, #7f00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.global-time {
    font-family: monospace;
    font-size: 0.95rem;
    color: var(--text-cyan);
    background: rgba(var(--text-cyan-rgb), 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(var(--text-cyan-rgb), 0.2);
}

/* Executive Cards Overview */
.executive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    padding: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-header h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
}

.ip-address {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: monospace;
    margin-bottom: 1.2rem;
}

.metrics-row {
    display: flex;
    justify-content: space-between;
    background: var(--box-bg);
    border: 1px solid var(--box-border);
    padding: 1rem;
    border-radius: 12px;
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
}

/* Tab & Main Section Layout */
.main-content {
    padding: 2rem;
}

.tab-controls {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: var(--text-main);
    background: linear-gradient(135deg, rgba(127, 0, 255, 0.6), rgba(0, 229, 255, 0.6));
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.25);
}

.search-box {
    margin-left: auto;
}

.search-box input {
    background: var(--box-bg);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    width: 250px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

/* Data Tables */
.table-container {
    overflow-x: auto;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.dashboard-table th, 
.dashboard-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--card-border);
}

.dashboard-table th {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-table td {
    font-size: 0.95rem;
}

.dashboard-table tbody tr:hover {
    background: var(--row-hover-bg);
}

/* Badges */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.badge-success {
    background: rgba(var(--color-green-rgb), 0.15);
    color: var(--color-green);
    border: 1px solid rgba(var(--color-green-rgb), 0.3);
}

.badge-warning {
    background: rgba(var(--color-yellow-rgb), 0.15);
    color: var(--color-yellow);
    border: 1px solid rgba(var(--color-yellow-rgb), 0.3);
}

.badge-danger {
    background: rgba(var(--color-red-rgb), 0.15);
    color: var(--color-red);
    border: 1px solid rgba(var(--color-red-rgb), 0.3);
}

.badge-secondary {
    background: rgba(var(--color-gray-rgb), 0.15);
    color: var(--color-gray);
    border: 1px solid rgba(var(--color-gray-rgb), 0.3);
}

/* Interactive Action Buttons */
.action-btn-group {
    display: flex;
    gap: 0.5rem;
}

.btn {
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    color: var(--text-main);
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 8px;
}

.btn-logs:hover {
    background: rgba(0, 229, 255, 0.15);
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.btn-diagnose:hover {
    background: rgba(127, 0, 255, 0.15);
    border-color: var(--primary-color);
    color: #b05cff;
}

/* Modals Overlay & Content */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 8, 20, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--modal-bg);
    width: 90%;
    max-width: 800px;
    padding: 2rem;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-main);
}

/* Terminal logs console styling */
.terminal-view {
    background: var(--terminal-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: var(--terminal-shadow);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.terminal-header {
    background: var(--terminal-header-bg);
    padding: 0.6rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
}

.terminal-dots {
    display: flex;
    gap: 0.45rem;
}

.terminal-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot-red { background: var(--color-red); }
.dot-yellow { background: var(--color-yellow); }
.dot-green { background: var(--color-green); }

.terminal-title {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--terminal-title-color);
}

.terminal-content {
    padding: 1.2rem;
    max-height: 350px;
    overflow-y: auto;
    font-family: 'Consolas', 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
    color: var(--terminal-text);
}

.log-line {
    display: flex;
    margin-bottom: 0.25rem;
}

.log-line-num {
    color: var(--terminal-line-num-color);
    width: 45px;
    user-select: none;
    text-align: right;
    padding-right: 12px;
    border-right: 1px solid var(--terminal-line-num-border);
    margin-right: 12px;
}

.log-line-level {
    font-weight: 700;
    width: 55px;
}

.log-summary-footer {
    background: var(--box-bg);
    border: 1px dashed var(--box-border);
    border-radius: 8px;
    padding: 0.8rem 1.2rem;
    display: flex;
    justify-content: space-between;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Diagnostic report styling */
.diag-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.diag-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
}

.diag-box {
    background: var(--box-bg);
    padding: 1.2rem;
    border-radius: 12px;
    border: 1px solid var(--box-border);
}

.diag-box h3 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    letter-spacing: 0.5px;
}

.diag-text {
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Classes utilities */
.text-cyan { color: var(--text-cyan) !important; }
.text-green { color: var(--color-green) !important; }
.text-yellow { color: var(--color-yellow) !important; }
.text-red { color: var(--color-red) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-center { text-align: center; }
.py-4 { padding-top: 2rem; padding-bottom: 2rem; }

/* Micro-animations */
@keyframes brainPulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(0, 229, 255, 0.3)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.6)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(0, 229, 255, 0.3)); }
}

@keyframes statusPulse {
    0% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 0.4; }
}

/* Responsive */
@media(max-width: 768px) {
    .dashboard-header { flex-direction: column; gap: 1rem; text-align: center; }
    .brand { flex-direction: column; }
    .tab-controls { flex-direction: column; align-items: stretch; }
    .search-box { margin-left: 0; width: 100%; }
    .search-box input { width: 100%; }
}

/* System Telemetry Dashboard */
.system-telemetry-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.telemetry-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.telemetry-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.telemetry-header h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: var(--text-main);
}

.telemetry-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.telemetry-stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.telemetry-stat .label {
    color: var(--text-muted);
}

.telemetry-stat .value {
    color: var(--text-main);
    font-family: monospace;
}

.telemetry-progress-bg {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.4rem;
}

.telemetry-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), background 0.8s ease;
}

/* Specific Progress Bar Gradients */
#sysCpuBar {
    background: linear-gradient(90deg, #00c6ff 0%, #0072ff 100%);
    box-shadow: 0 0 8px rgba(0, 198, 255, 0.4);
}

#sysMemBar {
    background: linear-gradient(90deg, #11998e 0%, #38ef7d 100%);
    box-shadow: 0 0 8px rgba(56, 239, 125, 0.4);
}

#sysDiskBar {
    background: linear-gradient(90deg, #f12711 0%, #f5af19 100%);
    box-shadow: 0 0 8px rgba(245, 175, 25, 0.4);
}

/* Control Actions Card and Reboot Button */
.telemetry-actions-card {
    border-color: rgba(239, 68, 68, 0.15);
    background: rgba(239, 68, 68, 0.02);
}

.telemetry-actions-card:hover {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.04);
}

.btn-restart-vm {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.3));
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ff8a8a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-restart-vm:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.4), rgba(239, 68, 68, 0.6));
    border-color: #ff335c;
    color: #fff;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-restart-vm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: var(--text-muted);
}
