/* ============================================
   VPS MONITOR DESIGN SYSTEM & UI STYLES
   ============================================ */

/* KPI Cards Layout */
.vps-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

/* Controls Section */
.vps-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-card, #1a1f35);
    border-radius: 12px;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
    box-shadow: var(--shadow-sm);
}

.vps-search-box {
    position: relative;
    flex-grow: 1;
    max-width: 480px;
}

.vps-search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted, #64748b);
}

.vps-search-box input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    background: var(--bg-primary, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
    color: var(--text-primary, #f1f5f9);
    font-size: 0.9rem;
    transition: all 0.3s;
}

.vps-search-box input:focus {
    outline: none;
    border-color: var(--accent-primary-light, #6366f1);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.vps-filters {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vps-filters select {
    padding: 10px 16px;
    background: var(--bg-primary, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
    color: var(--text-primary, #f1f5f9);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.vps-filters select:focus {
    outline: none;
    border-color: var(--accent-primary-light, #6366f1);
}

/* Grid Layout */
.vps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

/* VPS Card */
.vps-card {
    background: var(--bg-card, #1a1f35);
    border-radius: 12px;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.vps-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.vps-card.online {
    border-top: 3px solid var(--accent-success, #10b981);
}

.vps-card.offline {
    border-top: 3px solid var(--accent-danger, #ef4444);
    opacity: 0.75;
}

/* Card Header */
.vps-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.vps-card-title h4 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary, #f1f5f9);
}

.vps-ip {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--accent-primary-light, #818cf8);
}

/* Status Badge */
.vps-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.vps-status-badge.online {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success, #10b981);
}

.vps-status-badge.offline {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-danger, #ef4444);
}

/* Pulse Animation */
.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.online .pulse-dot {
    background: var(--accent-success, #10b981);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 1.8s infinite;
}

.offline .pulse-dot {
    background: var(--accent-danger, #ef4444);
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Card Metadata */
.vps-card-meta {
    font-size: 0.8rem;
    color: var(--text-secondary, #94a3b8);
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.owner-tag {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-primary-light, #818cf8);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Resource Bar Row */
.vps-card-resources {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
    border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
    padding-top: 14px;
}

.resource-bar-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.resource-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-secondary, #94a3b8);
}

.resource-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.resource-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Network Section */
.vps-card-network {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
    padding: 12px 0;
    margin-bottom: 14px;
}

.network-info {
    display: flex;
    flex-direction: column;
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
}

.network-info span:last-child {
    font-weight: 600;
    color: var(--text-secondary, #94a3b8);
}

.vps-sparkline {
    overflow: visible;
}

.net-muted {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
}

/* Card Footer */
.vps-card-footer {
    border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
    padding-top: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.vps-footer-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-muted, #94a3b8);
}

.ping-text strong {
    color: var(--accent-primary-light, #818cf8);
}

.vps-actions {
    display: flex;
    gap: 6px;
}

.vps-action-btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.vps-action-btn.copy {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary-light, #818cf8);
    border-color: rgba(99, 102, 241, 0.2);
}

.vps-action-btn.copy:hover {
    background: var(--accent-primary, #6366f1);
    color: #fff;
    border-color: var(--accent-primary, #6366f1);
}

.vps-action-btn.ping {
    background: transparent;
    color: var(--text-secondary, #94a3b8);
    border-color: rgba(255, 255, 255, 0.08);
}

.vps-action-btn.ping:hover {
    border-color: var(--accent-primary-light, #818cf8);
    color: var(--accent-primary-light, #818cf8);
}

/* Table Wrapper */
.vps-table-wrapper {
    background: var(--bg-card, #1a1f35);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
    border-radius: 12px;
    overflow-x: auto;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

/* Alerts Section */
.vps-alerts-section {
    background: var(--bg-card, #1a1f35);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.vps-alerts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
    padding-bottom: 12px;
}

.vps-alerts-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #f1f5f9);
}

.vps-alerts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vps-alert-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    border-left: 4px solid transparent;
}

.vps-alert-item.danger {
    background: rgba(239, 68, 68, 0.07);
    border-color: var(--accent-danger, #ef4444);
}

.vps-alert-item.warning {
    background: rgba(245, 158, 11, 0.07);
    border-color: var(--accent-warning, #f59e0b);
}

.vps-alert-icon {
    font-size: 1.1rem;
}

.vps-alert-info {
    flex-grow: 1;
}

.vps-alert-title {
    font-weight: 700;
    color: var(--text-primary, #f1f5f9);
    margin-bottom: 2px;
}

.vps-alert-desc {
    color: var(--text-secondary, #94a3b8);
}

.vps-alert-time {
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
}

.vps-alerts-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-muted, #64748b);
    font-size: 0.88rem;
}

.vps-alerts-empty span {
    margin-right: 6px;
}

.vps-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-muted, #64748b);
    background: var(--bg-card, #1a1f35);
    border-radius: 12px;
    border: 1px dashed var(--border-color, rgba(255, 255, 255, 0.08));
}

/* ============================================
   LIGHT MODE SPECIFIC OVERRIDES
   ============================================ */

body.light-mode .vps-controls {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

body.light-mode .vps-search-box input {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

body.light-mode .vps-search-box input::placeholder {
    color: #94a3b8;
}

body.light-mode .vps-filters select {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

body.light-mode .vps-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

body.light-mode .vps-card:hover {
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.08);
}

body.light-mode .vps-card-title h4 {
    color: #0f172a;
}

body.light-mode .vps-ip {
    color: #4f46e5;
}

body.light-mode .owner-tag {
    background: rgba(79, 70, 229, 0.08);
    color: #4f46e5;
}

body.light-mode .resource-label {
    color: #475569;
}

body.light-mode .resource-track {
    background: #f1f5f9;
}

body.light-mode .vps-card-meta {
    color: #475569;
}

body.light-mode .vps-card-footer {
    border-top: 1px solid #f1f5f9;
}

body.light-mode .vps-card-resources {
    border-top: 1px solid #f1f5f9;
}

body.light-mode .vps-card-network {
    border-top: 1px solid #f1f5f9;
}

body.light-mode .vps-footer-info {
    color: #64748b;
}

body.light-mode .ping-text strong {
    color: #4f46e5;
}

body.light-mode .vps-action-btn.copy {
    background: rgba(79, 70, 229, 0.08);
    color: #4f46e5;
    border-color: rgba(79, 70, 229, 0.15);
}

body.light-mode .vps-action-btn.copy:hover {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
}

body.light-mode .vps-action-btn.ping {
    background: transparent;
    color: #475569;
    border-color: #cbd5e1;
}

body.light-mode .vps-action-btn.ping:hover {
    border-color: #4f46e5;
    color: #4f46e5;
}

body.light-mode .vps-table-wrapper {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

body.light-mode .vps-alerts-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

body.light-mode .vps-alerts-header h3 {
    color: #0f172a;
}

body.light-mode .vps-alert-title {
    color: #0f172a;
}

body.light-mode .vps-alert-desc {
    color: #475569;
}

body.light-mode .vps-alert-item.danger {
    background: rgba(239, 68, 68, 0.04);
}

body.light-mode .vps-alert-item.warning {
    background: rgba(245, 158, 11, 0.04);
}

body.light-mode .vps-db-status {
    background: rgba(79, 70, 229, 0.05) !important;
    border: 1px solid rgba(79, 70, 229, 0.12) !important;
}

body.light-mode .vps-empty {
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    color: #64748b;
}
