:root {
    --bg-base: #0b0714;      /* Dark purple/black */
    --bg-surface: #140d26;   /* Deep purple */
    --bg-surface-hover: #1e1338;
    --border-color: #3b2866;
    
    --text-main: #f5f0ff;
    --text-muted: #bda6e8;
    
    --accent-primary: #9d4edd; /* Pink/Purple */
    --accent-hover: #c77dff;   /* Lighter pink */
    --accent-blue: #3a86ff;    /* Vibrant blue */
    
    --status-online: #00f5d4;
    --status-offline: #ff006e;
    --status-starting: #fee440;
    
    --font-main: 'Inter', sans-serif;
    --border-radius: 12px;
    --transition: all 0.2s ease;
}

@keyframes borderBlink {
    0% { box-shadow: 0 0 5px rgba(157, 78, 221, 0.4), inset 0 0 5px rgba(157, 78, 221, 0.2); border-color: rgba(157, 78, 221, 0.6); }
    50% { box-shadow: 0 0 15px rgba(58, 134, 255, 0.6), inset 0 0 10px rgba(58, 134, 255, 0.3); border-color: rgba(58, 134, 255, 0.8); }
    100% { box-shadow: 0 0 5px rgba(157, 78, 221, 0.4), inset 0 0 5px rgba(157, 78, 221, 0.2); border-color: rgba(157, 78, 221, 0.6); }
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* SIDEBAR */
.sidebar {
    width: 260px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
}

.sidebar-header i {
    color: var(--accent-primary);
    font-size: 28px;
}

.sidebar-header .highlight {
    color: var(--accent-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
}

.nav-item i {
    font-size: 20px;
}

.nav-item:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-main);
}

.nav-item.active {
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-blue));
    color: #fff;
    box-shadow: 0 4px 15px rgba(157, 78, 221, 0.4);
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-color);
}

.nav-item.logout {
    color: var(--status-offline);
}

.nav-item.logout:hover {
    background-color: rgba(255, 0, 110, 0.1);
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.top-header {
    padding: 32px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-blue));
    -webkit-background-clip: text;
    color: transparent;
}

.text-muted {
    color: var(--text-muted);
    font-size: 14px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

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

.status-badge.online { background: rgba(0, 245, 212, 0.1); color: var(--status-online); border: 1px solid var(--status-online); box-shadow: 0 0 10px rgba(0, 245, 212, 0.2); }
.status-badge.online .status-dot { background: var(--status-online); box-shadow: 0 0 10px var(--status-online); }

.status-badge.offline { background: rgba(255, 0, 110, 0.1); color: var(--status-offline); border: 1px solid var(--status-offline); box-shadow: 0 0 10px rgba(255, 0, 110, 0.2); }
.status-badge.offline .status-dot { background: var(--status-offline); box-shadow: 0 0 10px var(--status-offline); }

.status-badge.starting { background: rgba(254, 228, 64, 0.1); color: var(--status-starting); border: 1px solid var(--status-starting); box-shadow: 0 0 10px rgba(254, 228, 64, 0.2); }
.status-badge.starting .status-dot { background: var(--status-starting); box-shadow: 0 0 10px var(--status-starting); }

/* VIEWS */
.view-section {
    padding: 0 40px 40px;
}

.quick-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
}

.btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.btn-primary { background: linear-gradient(45deg, var(--accent-primary), var(--accent-blue)); color: #fff; box-shadow: 0 4px 15px rgba(157, 78, 221, 0.3); }
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 6px 20px rgba(58, 134, 255, 0.4); }

.btn-success { background: var(--status-online); color: #000; box-shadow: 0 4px 15px rgba(0, 245, 212, 0.3); }
.btn-success:hover { filter: brightness(1.1); }

.btn-danger { background: var(--status-offline); color: #fff; box-shadow: 0 4px 15px rgba(255, 0, 110, 0.3); }
.btn-danger:hover { filter: brightness(1.1); }

/* METRICS */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.metric-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
    animation: borderBlink 4s infinite alternate;
}

.metric-card:hover {
    transform: translateY(-2px);
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.metric-icon.blue { background: rgba(58, 134, 255, 0.1); color: var(--accent-blue); }
.metric-icon.green { background: rgba(0, 245, 212, 0.1); color: var(--status-online); }
.metric-icon.yellow { background: rgba(254, 228, 64, 0.1); color: var(--status-starting); }
.metric-icon.purple { background: rgba(157, 78, 221, 0.1); color: var(--accent-primary); }

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

.metric-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.metric-value {
    font-size: 22px;
    font-weight: 700;
}

/* PANELS */
.dashboard-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    animation: borderBlink 6s infinite alternate;
}

.panel h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.graph-placeholder {
    height: 200px;
    background: var(--bg-base);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 12px;
    background: var(--bg-base);
    border-radius: 8px;
}

.activity-item .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
}

.activity-item .dot.blue { background: var(--accent-primary); }

.activity-item p {
    font-size: 14px;
    margin-bottom: 4px;
}

.activity-item .time {
    font-size: 12px;
    color: var(--text-muted);
}

/* CONSOLE */
.console-panel {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    padding: 0;
    overflow: hidden;
}

.console-output {
    flex: 1;
    background: #050505;
    padding: 20px;
    overflow-y: auto;
    font-family: 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #e5e5e5;
}

.console-input-wrapper {
    display: flex;
    border-top: 1px solid var(--border-color);
    background: var(--bg-base);
}

.console-input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 16px 20px;
    color: #fff;
    font-family: 'Consolas', monospace;
    font-size: 14px;
    outline: none;
}

.console-input-wrapper button {
    background: transparent;
    border: none;
    color: var(--accent-primary);
    padding: 0 24px;
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.console-input-wrapper button:hover {
    color: var(--accent-hover);
}

/* TABLES */
.file-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 12px 16px;
    background: var(--bg-base);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.current-path {
    font-family: monospace;
    font-size: 14px;
    color: var(--accent-primary);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 16px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.data-table tr:hover td {
    background: var(--bg-base);
}

.data-table td i {
    font-size: 20px;
    vertical-align: middle;
    margin-right: 12px;
}

.data-table td i.ph-folder-open { color: var(--accent-primary); }
.data-table td i.ph-file-text { color: var(--text-muted); }

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

.modal-content {
    background: var(--bg-surface);
    padding: 32px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.modal-content h3 { margin-bottom: 12px; }
.modal-content p { color: var(--text-muted); margin-bottom: 24px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; }

/* RAIN EFFECT */
.rain-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.raindrop {
    position: absolute;
    width: 6px;
    height: 60px;
    background: linear-gradient(to bottom, rgba(157, 78, 221, 0), rgba(157, 78, 221, 0.9));
    animation: rainDrop 1s linear infinite;
    opacity: 0.6;
    border-radius: 4px;
}

.raindrop:nth-child(even) {
    background: linear-gradient(to bottom, rgba(58, 134, 255, 0), rgba(58, 134, 255, 0.8));
}

@keyframes rainDrop {
    0% {
        transform: translateY(-20px) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.4;
    }
    90% {
        opacity: 0.2;
    }
    100% {
        transform: translateY(100vh) translateX(20px);
        opacity: 0;
    }
}

/* Đảm bảo nội dung panel nổi lên trên hiệu ứng mưa */
.app-container {
    position: relative;
    z-index: 10;
}

/* SETTINGS UI */
.property-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-base);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.property-item .prop-name {
    font-size: 14px;
    font-weight: 500;
}

.prop-input {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    width: 120px;
    text-align: right;
}

.prop-input:focus {
    border-color: var(--accent-primary);
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--status-offline);
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--status-online);
}

/* LOGIN UI */
.login-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(11, 7, 20, 0.85); /* Dark base with opacity */
    backdrop-filter: blur(12px); /* Glassmorphism background blur */
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: rgba(30, 19, 56, 0.4);
    border: 1px solid rgba(157, 78, 221, 0.3);
    box-shadow: 0 0 40px rgba(157, 78, 221, 0.15), inset 0 0 20px rgba(157, 78, 221, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 48px 40px;
    text-align: center;
    animation: modalIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-icon {
    font-size: 56px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-blue));
    -webkit-background-clip: text;
    color: transparent;
    margin-bottom: 16px;
    display: inline-block;
    filter: drop-shadow(0 0 10px rgba(157, 78, 221, 0.4));
}

.login-box h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.login-box p {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 32px;
}

.login-input-group {
    position: relative;
    margin-bottom: 16px;
}

.login-input-group i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 20px;
    transition: var(--transition);
}

.login-input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.login-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(157, 78, 221, 0.2);
    background: rgba(0, 0, 0, 0.5);
}

.login-input:focus + i, .login-input:not(:placeholder-shown) + i {
    color: var(--accent-primary);
}

.login-btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    border-radius: 12px;
    margin-top: 16px;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 2px;
}

@keyframes modalIn {
    0% { opacity: 0; transform: scale(0.9) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
