:root {
    --bg-primary: #0b0c10;
    --bg-card: rgba(22, 26, 38, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(139, 92, 246, 0.3);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent: #8b5cf6;
    --accent-hover: #a78bfa;
    --accent-glow: rgba(139, 92, 246, 0.15);
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.15);
    
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

/* Radiant Backdrop Glow */
.bg-glow {
    position: absolute;
    top: -10%;
    left: 20%;
    width: 60vw;
    height: 60vh;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: 0;
    pointer-events: none;
}

.container {
    width: 100%;
    max-width: 1100px;
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    z-index: 1;
}

/* Glass Card Styling */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition-smooth);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* Header Area */
header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-emoji {
    font-size: 2.8rem;
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.3));
}

h1 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.8rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 40%, #a78bfa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 4px;
}

/* Password Panel */
.password-box {
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(15, 17, 26, 0.8);
    border-radius: var(--radius-md);
    max-width: 320px;
    width: 100%;
}

.pw-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pw-icon {
    font-size: 1rem;
    color: var(--text-muted);
}

#admin-password {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    width: 100%;
}

#admin-password::placeholder {
    color: var(--text-muted);
}

.pw-status {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.status-unlocked {
    color: var(--success);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* RAM Card Styles */
.ram-card {
    background: linear-gradient(135deg, rgba(22, 26, 38, 0.8) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-color: rgba(139, 92, 246, 0.15);
}

.ram-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.ram-details h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ram-numbers {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 4px;
    font-family: 'Outfit', sans-serif;
}

.muted {
    color: var(--text-muted);
    font-weight: 400;
}

.ram-percentage {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent-hover);
    text-shadow: 0 0 20px var(--accent-glow);
}

.progress-bar-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 9999px;
    height: 10px;
    width: 100%;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 9999px;
    width: 0%;
    transition: width 0.8s cubic-bezier(0.1, 0.8, 0.25, 1);
}

.progress-bar.safe {
    background: linear-gradient(90deg, #10b981, #34d399);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.progress-bar.warning {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.progress-bar.danger {
    background: linear-gradient(90deg, #ef4444, #f87171);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.warning-banner {
    display: none;
    margin-top: 14px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: #fca5a5;
    font-size: 0.85rem;
    font-weight: 500;
    animation: pulse 2s infinite;
}

/* Grid layout */
.servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

/* Server Card Specifics */
.server-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.server-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    transition: var(--transition-smooth);
}

.active-server::before {
    background: var(--success);
    box-shadow: 0 3px 15px var(--success);
}

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

.server-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.server-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
}

.badge {
    padding: 4px 8px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-heavy {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-medium {
    background: rgba(245, 158, 11, 0.1);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-light {
    background: rgba(16, 185, 129, 0.1);
    color: #a7f3d0;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.server-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.server-meta {
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    display: flex;
    gap: 8px;
}

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

.meta-value {
    color: var(--text-primary);
    font-weight: 500;
}

.server-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
    padding-top: 10px;
}

/* Status Dot Indicator */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.status-dot.running {
    background-color: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: pulse-dot 2s infinite;
}

.status-dot.stopped {
    background-color: var(--text-muted);
}

.status-dot.transitioning {
    background-color: var(--warning);
    box-shadow: 0 0 10px var(--warning);
    animation: rotate 1.5s linear infinite;
}

/* Custom Interactive Buttons */
.btn {
    flex: 1;
    padding: 11px 16px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: var(--transition-smooth);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.btn-start {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}

.btn-start:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

.btn-start:active:not(:disabled) {
    transform: translateY(0);
}

.btn-stop {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-stop:hover:not(:disabled) {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
    border-color: transparent;
    transform: translateY(-1px);
}

.btn-stop:active:not(:disabled) {
    transform: translateY(0);
}

/* Toast Message */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1e1b4b;
    border: 1px solid var(--accent);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    font-size: 0.9rem;
    font-weight: 500;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition-smooth);
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-color: var(--success);
    background: #064e3b;
}

.toast.error {
    border-color: var(--danger);
    background: #7f1d1d;
}

/* Footer Styling */
footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 24px;
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

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

@keyframes rotate {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .header-main {
        flex-direction: column;
        align-items: flex-start;
    }
    .password-box {
        max-width: 100%;
    }
    .container {
        padding: 24px 16px;
    }
}
