:root {
    --bg-dark: #0a0a14;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --neon-cyan: #00f0ff;
    --neon-purple: #b026ff;
    --neon-blue: #0050ff;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --danger: #ff3366;
    --success: #00e676;
    --backdrop-blur: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Dynamic Animated Background */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.6;
    border-radius: 50%;
    animation: float 10s infinite alternate cubic-bezier(0.45, 0.05, 0.55, 0.95);
}

.blob-1 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--neon-purple), transparent);
    top: -50px;
    left: -50px;
    animation-delay: 0s;
}

.blob-2 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, var(--neon-cyan), transparent);
    bottom: 50px;
    right: -20px;
    animation-delay: -3s;
}

.blob-3 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--neon-blue), transparent);
    top: 40%;
    left: 30%;
    animation-delay: -6s;
    opacity: 0.4;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 40px) scale(1.1); }
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--backdrop-blur));
    -webkit-backdrop-filter: blur(var(--backdrop-blur));
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* App Layout */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    position: relative;
    z-index: 1;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    margin: 15px;
    border-radius: 16px;
    flex-shrink: 0;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.glow-icon {
    font-size: 24px;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { text-shadow: 0 0 10px var(--neon-cyan); transform: scale(1); }
    50% { text-shadow: 0 0 20px var(--neon-cyan), 0 0 30px var(--neon-cyan); transform: scale(1.05); }
    100% { text-shadow: 0 0 10px var(--neon-cyan); transform: scale(1); }
}

.header-titles h1 {
    font-size: 1.1rem;
    font-weight: 600;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.dot {
    width: 6px;
    height: 6px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.3s;
    padding: 8px;
    border-radius: 50%;
}

.icon-btn:hover, .icon-btn:active {
    background: rgba(255,255,255,0.1);
    transform: rotate(45deg);
}

/* Main Content Area */
.content-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 15px 100px 15px; /* bottom padding for nav */
}

/* Scrollbar hiding for clean look */
.content-area::-webkit-scrollbar {
    display: none;
}

.tab-section {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.tab-section.active {
    display: block;
}

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

h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.mt-15 { margin-top: 15px; }

/* Dashboard Widgets */
.widget-row {
    display: flex;
    gap: 15px;
}

.widget {
    flex: 1;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.widget h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

/* Progress Rings */
.progress-ring-container {
    position: relative;
    width: 80px;
    height: 80px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring__circle {
    stroke: var(--neon-cyan);
    stroke-dasharray: 214; /* 2 * pi * 34 */
    stroke-dashoffset: 214;
    transition: stroke-dashoffset 1s ease-out;
    stroke-linecap: round;
}

.progress-ring__bg {
    stroke: rgba(255,255,255,0.1);
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    font-weight: 600;
}

/* Info Card */
.info-card {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-value {
    font-weight: 500;
    font-size: 0.95rem;
}

/* Section specific styling */
.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.sort-toggles {
    display: flex;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    overflow: hidden;
}

.sort-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.2s;
}

.sort-btn.active {
    background: rgba(255,255,255,0.1);
    color: var(--neon-cyan);
}

/* Lists */
.list-container {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.process-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    transition: 0.2s;
}

.process-item:hover {
    background: rgba(255,255,255,0.08);
}

.process-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.process-name {
    font-weight: 500;
    font-size: 0.95rem;
}

.process-cmd {
    font-size: 0.75rem;
    color: var(--text-secondary);
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.process-stats {
    text-align: right;
    font-size: 0.85rem;
}

.stat-cpu { color: var(--neon-cyan); margin-bottom: 2px; }
.stat-mem { color: var(--neon-purple); }

/* Skeleton Loading */
.skeleton-row {
    height: 40px;
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.service-card {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    text-align: center;
}

.svc-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.svc-status.active { background-color: var(--success); box-shadow: 0 0 10px var(--success); }
.svc-status.inactive { background-color: var(--danger); box-shadow: 0 0 10px var(--danger); }

.service-card h4 {
    font-size: 0.9rem;
    font-weight: 500;
}

.restart-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.2s;
}

.restart-btn:active {
    background: rgba(255,255,255,0.2);
    transform: scale(0.95);
}

/* Files / Actions */
.file-shortcuts, .actions-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
}

.file-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 12px;
    border-radius: 10px;
    color: white;
    text-align: left;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.neon-btn {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.action-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    padding: 15px;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.2s;
}

.action-btn:active { transform: scale(0.98); }

.danger-btn {
    background: rgba(255, 51, 102, 0.2);
    color: #ff6b8b;
    border: 1px solid var(--danger);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-around;
    padding: 10px 5px;
    border-radius: 20px;
}

.nav-item {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: 0.3s;
    width: 60px;
}

.nav-item i {
    font-size: 1.2rem;
    transition: 0.3s;
}

.nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
}

.nav-item.active {
    color: var(--neon-cyan);
}

.nav-item.active i {
    transform: translateY(-4px);
    text-shadow: 0 0 10px var(--neon-cyan);
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    animation: toast-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.toast.fade-out {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
}

/* HTOP Layout */
.htop-container {
    width: 100%;
    height: calc(100vh - 180px); /* Fill space between header and nav */
    display: flex;
    flex-direction: column;
    font-family: 'Courier New', Courier, monospace; /* Terminal look */
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px;
}

.htop-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.8rem;
}

.htop-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.htop-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.htop-label {
    width: 28px;
    color: var(--text-secondary);
}

.htop-bar {
    flex-grow: 1;
    height: 12px;
    background: rgba(255,255,255,0.1);
    display: flex;
    position: relative;
    border: 1px solid rgba(255,255,255,0.05);
}

.htop-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.htop-low { background-color: var(--success); }
.htop-norm { background-color: var(--neon-cyan); }
.htop-sys { background-color: var(--danger); }
.htop-mem { background-color: var(--neon-purple); }
.htop-swp { background-color: #ff9900; }

.htop-val {
    width: 75px;
    text-align: right;
    color: var(--text-secondary);
}

.htop-val-text {
    color: var(--text-primary);
}

.htop-right {
    flex: 1;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--text-secondary);
}

.htop-table-wrapper {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: auto;
}

.htop-table-wrapper::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
.htop-table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

.htop-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    white-space: nowrap;
}

.htop-table th {
    text-align: left;
    padding: 4px 6px;
    color: var(--success);
    position: sticky;
    top: 0;
    background: rgba(10, 10, 20, 0.95);
    z-index: 10;
}

.htop-table td {
    padding: 4px 6px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.htop-table tr:hover {
    background: rgba(255,255,255,0.1);
}
