/* PerisaiData — Dashboard Stylesheet */

:root {
    --bg-primary: #070b14;
    --bg-secondary: #0c1220;
    --bg-card: rgba(12, 18, 35, 0.85);
    --bg-glass: rgba(12, 18, 35, 0.6);
    --cyan: #00d4ff;
    --cyan-dim: rgba(0, 212, 255, 0.12);
    --cyan-glow: rgba(0, 212, 255, 0.25);
    --green: #00e676;
    --green-dim: rgba(0, 230, 118, 0.12);
    --red: #ff1744;
    --red-dim: rgba(255, 23, 68, 0.12);
    --amber: #ffab00;
    --amber-dim: rgba(255, 171, 0, 0.12);
    --purple: #b388ff;
    --text-primary: #e0e6f0;
    --text-secondary: rgba(224, 230, 240, 0.55);
    --text-dim: rgba(224, 230, 240, 0.3);
    --border: rgba(0, 212, 255, 0.08);
    --border-hover: rgba(0, 212, 255, 0.2);
    --font-display: 'Orbitron', monospace;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius: 12px;
    --sidebar-width: 260px;
}

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

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Effects */
.bg-grid {
    position: fixed; inset: 0; z-index: 0;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.bg-glow {
    position: fixed; z-index: 0; pointer-events: none;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.06), transparent 70%);
    top: -200px; right: -200px;
}

/* ===== LOGIN PAGE ===== */
.login-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
}

.login-container {
    position: relative; z-index: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 48px 40px;
    width: 380px;
    text-align: center;
    backdrop-filter: blur(20px);
    box-shadow: 0 0 60px rgba(0, 212, 255, 0.05);
}

.login-icon {
    width: 64px; height: 64px; margin: 0 auto 20px;
    color: var(--cyan);
    animation: pulse-glow 2s ease-in-out infinite;
}

.login-icon svg { width: 100%; height: 100%; }

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.4)); }
    50% { filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.7)); }
}

.login-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 4px;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 32px;
}

.login-form { text-align: left; }

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px var(--cyan-dim);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(179, 136, 255, 0.15));
    border: 1px solid var(--cyan);
    border-radius: 10px;
    color: var(--cyan);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 2px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: all 0.3s;
    margin-top: 8px;
}

.btn-login:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.25), rgba(179, 136, 255, 0.25));
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.2);
    transform: translateY(-1px);
}

.alert-error {
    background: var(--red-dim);
    border: 1px solid rgba(255, 23, 68, 0.3);
    color: var(--red);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.alert-success {
    background: var(--green-dim);
    border: 1px solid rgba(0, 230, 118, 0.3);
    color: var(--green);
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    margin-bottom: 20px;
    position: relative; z-index: 1;
}

/* ===== DASHBOARD ===== */
.dashboard {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 10;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.logo-icon {
    width: 36px; height: 36px;
    color: var(--cyan);
    flex-shrink: 0;
}

.logo-icon svg { width: 100%; height: 100%; }

.logo-text {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.logo-sub {
    font-size: 0.65rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.nav-item:hover {
    background: var(--cyan-dim);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--cyan-dim);
    color: var(--cyan);
    border: 1px solid rgba(0, 212, 255, 0.15);
}

.nav-logout { margin-top: auto; color: var(--red); }
.nav-logout:hover { background: var(--red-dim); }

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
}

.panel { display: none; }
.panel.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.panel-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px;
}

.panel-header h2 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--cyan-dim);
    color: var(--cyan);
}

.badge-green { background: var(--green-dim); color: var(--green); }
.badge-red { background: var(--red-dim); color: var(--red); }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
}

.empty-state svg { margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 1rem; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state span { font-size: 0.85rem; }

/* Device Cards */
.devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.device-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all 0.3s;
}

.device-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.05);
}

.device-card.online { border-left: 3px solid var(--green); }
.device-card.offline { border-left: 3px solid var(--text-dim); }

.device-header {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 20px;
}

.device-status {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.device-status.online {
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
    animation: blink 2s ease-in-out infinite;
}

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

.device-status.offline { background: var(--text-dim); }

.device-info { flex: 1; }
.device-info h3 { font-size: 1rem; font-weight: 600; }
.device-model { font-size: 0.8rem; color: var(--text-dim); }

.device-battery {
    display: flex; align-items: center; gap: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.device-details {
    display: flex; flex-direction: column; gap: 12px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.detail-row {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.85rem;
}

.detail-row > span:first-child { color: var(--text-secondary); }
.text-dim { color: var(--text-dim); font-family: var(--font-mono); font-size: 0.8rem; }

.device-actions {
    display: flex; gap: 8px;
}

.action-form { flex: 1; }

.btn-action {
    width: 100%;
    padding: 10px 8px;
    border-radius: 8px;
    border: 1px solid;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font-body);
}

.btn-lock {
    background: var(--green-dim);
    border-color: rgba(0, 230, 118, 0.2);
    color: var(--green);
}
.btn-lock:hover { background: rgba(0, 230, 118, 0.2); box-shadow: 0 0 15px rgba(0, 230, 118, 0.15); }

.btn-reboot {
    background: var(--amber-dim);
    border-color: rgba(255, 171, 0, 0.2);
    color: var(--amber);
}
.btn-reboot:hover { background: rgba(255, 171, 0, 0.2); box-shadow: 0 0 15px rgba(255, 171, 0, 0.15); }

.btn-wipe {
    background: var(--red-dim);
    border-color: rgba(255, 23, 68, 0.2);
    color: var(--red);
}
.btn-wipe:hover { background: rgba(255, 23, 68, 0.2); box-shadow: 0 0 15px rgba(255, 23, 68, 0.15); }

/* Log List */
.log-list {
    display: flex; flex-direction: column; gap: 2px;
}

.log-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: background 0.2s;
}

.log-item:hover { background: var(--bg-glass); }

.log-icon { font-size: 1.2rem; flex-shrink: 0; }
.log-content { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.log-device { font-size: 0.85rem; font-weight: 500; }
.log-desc { font-size: 0.8rem; color: var(--text-secondary); }
.log-time { font-size: 0.75rem; color: var(--text-dim); font-family: var(--font-mono); white-space: nowrap; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 100%; position: relative; flex-direction: row; padding: 12px; }
    .sidebar-header { display: none; }
    .sidebar-nav { flex-direction: row; gap: 8px; }
    .nav-item span { display: none; }
    .main-content { margin-left: 0; padding: 16px; }
    .devices-grid { grid-template-columns: 1fr; }
    .device-actions { flex-direction: column; }
}
