:root {
    --primary: #00f2fe;
    --secondary: #4facfe;
    --bg: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text: #f8fafc;
    --text-dim: #94a3b8;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
}

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
}

.circle-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    right: -100px;
}

.circle-2 {
    width: 300px;
    height: 300px;
    background: var(--secondary);
    bottom: -50px;
    left: -50px;
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    position: relative;
}

.glass {
    background: var(--glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem 2rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.logo h1 span {
    color: var(--primary);
}

.logo p {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 2px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.system-stats {
    display: flex;
    justify-content: space-around;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat .label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.stat .value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0 10px;
}

h2 {
    font-size: 1.2rem;
    font-weight: 500;
}

.btn-icon {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--primary);
    color: var(--bg);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 242, 254, 0.2);
}

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

.device-card {
    background: var(--glass);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.device-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.device-header {
    display: flex;
    justify-content: flex-start;
    margin-bottom: -5px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: 0.3s;
}

.status-online {
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.status-offline {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

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

.status-online .status-dot {
    background: #4ade80;
    box-shadow: 0 0 10px #4ade80;
    animation: pulse 2s infinite;
}

.status-offline .status-dot {
    background: #94a3b8;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

.device-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.device-info p {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-family: monospace;
    letter-spacing: 0.5px;
}

.device-actions {
    display: flex;
    gap: 0.8rem;
}

.wake-btn {
    flex: 3;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: var(--bg);
    padding: 0.8rem;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.shutdown-btn {
    flex: 2;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: #f87171;
    padding: 0.8rem;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.shutdown-btn:hover {
    background: #f87171;
    color: var(--bg);
    transform: scale(1.02);
}

.wake-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 242, 254, 0.3);
}

.delete-btn {
    flex: 1;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 0.8rem;
    border-radius: 14px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-btn:hover {
    background: #ef4444;
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.modal h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    padding: 1rem 1.2rem;
    border-radius: 14px;
    color: white;
    margin-bottom: 1.2rem;
    outline: none;
    font-size: 1rem;
    transition: 0.3s;
}

input:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.5);
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 1rem;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    transition: 0.3s;
}

.btn-primary { 
    background: var(--primary); 
    color: var(--bg); 
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 242, 254, 0.2);
}

.btn-secondary { 
    background: rgba(255, 255, 255, 0.05); 
    color: white; 
    border: 1px solid var(--glass-border);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

footer {
    margin-top: 4rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
    padding-bottom: 2rem;
}

.loading, .empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-dim);
    background: var(--glass);
    border-radius: 24px;
    border: 1px dashed var(--glass-border);
}

@media (max-width: 600px) {
    .container { padding: 1rem; }
    header { flex-direction: column; gap: 1.5rem; text-align: center; }
    .system-stats { gap: 10px; padding: 1rem; }
    .stat .label { font-size: 0.6rem; }
    .stat .value { font-size: 0.85rem; }
}
