:root {
    --bg-color: #0f172a;
    --sidebar-bg: #1e293b;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8;
    --danger-color: #ef4444;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --border-radius: 12px;
    --font-family: 'Outfit', sans-serif;
}

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

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

.app-container {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2.5rem;
    text-align: center;
}

.logo {
    width: 80px;
    height: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.3));
}

.brand h3 {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1.4;
}

/* Sidebar Menu Items */
.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
    font-weight: 500;
}

.menu-item i {
    width: 20px;
    text-align: center;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.menu-item.active {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-color);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.1);
}

.user-info {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.user-info p {
    margin-bottom: 4px;
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 2.5rem;
    overflow-y: auto;
    position: relative;
}

/* Section Visibility Logic */
.content-section {
    display: none;
    /* Hidden by default */
    animation: fadeIn 0.3s ease-in-out;
}

.content-section.active {
    display: block;
    /* Shown when active */
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

h1 {
    font-weight: 300;
    font-size: 2rem;
    letter-spacing: -0.5px;
}

.status-indicator {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(34, 197, 94, 0.15);
    color: var(--success-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px currentColor;
}

/* Grid & Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card,
.stat-card {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.stat-card h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
}

.value.safe {
    color: var(--success-color);
}

.value.danger {
    color: var(--danger-color);
}

/* Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th,
td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.code-font {
    font-family: 'Fira Code', monospace;
    color: var(--accent-color);
    font-size: 0.9rem;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.status-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success-color);
}

.status-badge.status-blocked {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
}

/* Buttons & Inputs */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent-color);
    color: #000;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 4px 8px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

input[type="text"],
input[type="password"],
textarea,
.code-editor {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    transition: border 0.2s;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Visualizer */
.code-editor {
    font-family: 'Fira Code', monospace;
    min-height: 300px;
    line-height: 1.5;
}

.preview-box {
    background: #ffffff;
    min-height: 300px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: auto;
}