:root {
    --bg-color: #0b0f19;
    --card-bg: rgba(23, 31, 50, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.12), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.12), transparent 25%);
    background-attachment: fixed;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent));
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.user-info {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.page-title {
    margin-bottom: 2.5rem;
}

.page-title h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-title p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.vps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Card Styling */
.vps-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(12px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.vps-card:hover {
    transform: translateY(-5px);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 15px rgba(59, 130, 246, 0.1);
}

.vps-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vps-ip {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.vps-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 8px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

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

.detail-value {
    color: #e2e8f0;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
}

.connect-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.connect-btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 90%;
    max-width: 1000px;
    height: 80vh;
    background: #000;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: all 0.3s ease;
    overflow: hidden;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #111827;
    border-bottom: 1px solid #1f2937;
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    font-weight: 500;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.green { background: #10b981; box-shadow: 0 0 8px #10b981; }
.status-dot.red { background: #ef4444; box-shadow: 0 0 8px #ef4444; }
.status-dot.yellow { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }

.close-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #fff;
}

.terminal-container {
    flex: 1;
    padding: 1rem;
    background: #000;
    overflow: hidden;
}

/* Xterm overrides */
.xterm-viewport::-webkit-scrollbar {
    width: 8px;
}
.xterm-viewport::-webkit-scrollbar-track {
    background: #111827; 
}
.xterm-viewport::-webkit-scrollbar-thumb {
    background: #374151; 
    border-radius: 4px;
}
.xterm-viewport::-webkit-scrollbar-thumb:hover {
    background: #4b5563; 
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
