/* ============================================
   FocusGuard Command Center - Professional Refined Theme
   ============================================ */

:root {
    --bg-deep: #f0f2f5;
    --bg-card: #ffffff;
    --bg-elevated: #f8fafc;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --accent-primary: #0ea5e9;
    --accent-primary-soft: #e0f2fe;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    padding: 16px 24px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon {
    width: 40px; height: 40px;
    background: var(--accent-primary);
    color: white;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
}
.logo-icon svg { width: 24px; height: 24px; }
.logo-text h1 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.5px; }
.logo-sub { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; font-family: 'JetBrains Mono'; }

.header-stats { display: flex; align-items: center; gap: 24px; }
.stat { text-align: center; }
.stat-value { font-family: 'JetBrains Mono'; font-weight: 700; color: var(--accent-primary); font-size: 1.5rem; }
.stat-label { font-size: 0.7rem; text-transform: uppercase; color: var(--text-muted); }

.header-divider {
    width: 1px;
    height: 32px;
    background: var(--border);
    margin: 0 8px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.user-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.logout-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.logout-btn:hover {
    color: var(--accent-red);
    border-color: var(--accent-red);
    background: #fff1f2;
}

.logout-btn svg {
    width: 20px;
    height: 20px;
}

/* Main Layout */
.main {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    flex: 1;
    min-height: 0;
}

/* Clients Panel */
.clients-panel {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 16px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.panel-header h2 { font-size: 0.8rem; text-transform: uppercase; color: var(--text-secondary); letter-spacing: 0.5px; }

.client-grid { padding: 12px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }

.client-card {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}
.client-card:hover { border-color: var(--accent-primary); background: var(--bg-elevated); }
.client-card.selected {
    border-color: var(--accent-primary);
    background: var(--accent-primary-soft);
    box-shadow: 0 0 0 2px var(--accent-primary-soft);
    transform: translateX(4px);
}

.client-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.client-icon { color: var(--text-muted); }
.client-card.selected .client-icon { color: var(--accent-primary); }
.client-name-group { display: flex; flex-direction: column; line-height: 1.2; }
.client-user-name { font-weight: 700; font-size: 1.1rem; color: var(--text-primary); }
.client-machine-name { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.display-user { font-weight: 700; }
.display-machine { font-size: 0.9rem; color: var(--text-muted); font-weight: 400; }
.client-meta { font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.client-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); transition: var(--transition); }
.client-status-dot.online { background: var(--accent-green); box-shadow: 0 0 8px var(--accent-green); }
.client-status-dot.offline { background: var(--accent-red); box-shadow: 0 0 8px var(--accent-red); }

/* Config Panel */
.config-panel {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.selected-client {
    padding: 20px 24px;
    background: var(--bg-elevated);
    display: flex; align-items: center; gap: 16px;
    border-bottom: 1px solid var(--border);
}
.client-avatar {
    width: 44px; height: 44px;
    background: var(--accent-primary); color: white;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
}
.client-info .client-name { font-size: 1.1rem; }
.client-status { font-size: 0.8rem; }

/* Tabs Navigation */
.tabs-nav {
    display: flex;
    background: var(--bg-elevated);
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    gap: 32px;
}

.tab-btn {
    background: none; border: none;
    padding: 16px 0;
    font-family: inherit; font-size: 0.9rem; font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    display: flex; align-items: center; gap: 8px;
    position: relative;
    transition: var(--transition);
}
.tab-btn svg { width: 18px; height: 18px; }
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active { color: var(--accent-primary); }
.tab-btn.active::after {
    content: ''; position: absolute; bottom: -1px; left: 0; right: 0;
    height: 3px; background: var(--accent-primary); border-radius: 3px 3px 0 0;
}

/* Tab Content */
.config-content { flex: 1; overflow-y: auto; padding: 24px; }
.tab-content { display: none; height: 100%; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }

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

.tab-header { margin-bottom: 24px; }
.tab-header h2 { font-size: 1.25rem; margin-bottom: 4px; }
.tab-header p { color: var(--text-muted); font-size: 0.9rem; }

/* Keywords Tab Layout */
.keyword-entry-grid {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 20px;
    margin-bottom: 24px;
}
.entry-card, .stats-mini-card {
    background: var(--bg-elevated);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.entry-card h3 { font-size: 0.9rem; margin-bottom: 12px; color: var(--text-secondary); }

.stats-mini-card { display: flex; flex-direction: column; justify-content: center; align-items: center; }
.mini-label { font-size: 0.75rem; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.mini-value { font-family: 'JetBrains Mono'; font-size: 2.5rem; font-weight: 700; color: var(--accent-primary); }

/* Processes Tab Layout */
.processes-layout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    height: 100%;
}

.sub-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
}
.sub-header h3 { font-size: 0.9rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }

.header-actions { display: flex; gap: 10px; align-items: center; }
.small-search {
    padding: 6px 12px; font-size: 0.8rem; border: 1px solid var(--border);
    border-radius: 6px; background: var(--bg-elevated); width: 150px;
}

/* Advanced Tab Layout */
.advanced-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.advanced-card {
    background: var(--bg-elevated);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.advanced-card.full-width { grid-column: 1 / -1; }
.card-title {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 0.95rem; margin-bottom: 20px;
    color: var(--text-secondary);
}
.card-title svg { width: 20px; height: 20px; color: var(--accent-primary); }

/* Components */
.input-group { display: flex; gap: 8px; margin-bottom: 16px; }
.input-group input {
    flex: 1; padding: 12px 16px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); font-family: 'JetBrains Mono';
    font-size: 0.9rem; transition: var(--transition);
}
.input-group input:focus { border-color: var(--accent-primary); outline: none; box-shadow: 0 0 0 3px var(--accent-primary-soft); }

.add-btn {
    width: 48px; background: var(--accent-primary); color: white;
    border: none; border-radius: var(--radius-sm); font-size: 1.5rem; cursor: pointer;
}

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
    background: white; border: 1px solid var(--border); padding: 6px 12px;
    border-radius: 20px; font-size: 0.85rem; font-family: 'JetBrains Mono';
    display: flex; align-items: center; gap: 8px;
}
.tag-remove { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; }
.tag-remove:hover { color: var(--accent-red); }

.selectable-list {
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-sm); height: 400px; overflow-y: auto;
}
.list-item {
    padding: 10px 16px; font-family: 'JetBrains Mono'; font-size: 0.85rem;
    border-bottom: 1px solid rgba(0,0,0,0.02); cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    transition: var(--transition);
}
.list-item:hover { background: white; color: var(--accent-primary); }

.list-action-btn {
    width: 24px; height: 24px;
    border-radius: 4px; border: 1px solid var(--border);
    background: white; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; font-weight: 700;
    transition: var(--transition);
}

.list-item:hover .list-action-btn {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.list-item.is-blocked {
    background: #fff1f2;
    color: var(--accent-red);
}

.list-item.is-blocked .list-action-btn {
    background: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
}

.mode-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode-btn {
    padding: 16px; border: 2px solid var(--border); border-radius: var(--radius);
    background: white; cursor: pointer; text-align: left; transition: var(--transition);
}
.mode-btn.active { border-color: var(--accent-primary); background: var(--accent-primary-soft); }
.mode-icon { font-size: 1.2rem; margin-bottom: 8px; }
.mode-btn span { display: block; font-weight: 700; font-size: 0.95rem; }
.mode-btn small { font-size: 0.75rem; color: var(--text-muted); }

.browser-checkboxes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.browser-check {
    display: flex; align-items: center; gap: 10px; cursor: pointer;
    padding: 8px; border: 1px solid var(--border); border-radius: 6px;
}

/* Actions Area */
.actions {
    padding: 24px; background: var(--bg-elevated); border-top: 1px solid var(--border);
    display: flex; gap: 16px;
}
.btn {
    padding: 14px 28px; border-radius: var(--radius-sm); font-weight: 700;
    font-size: 1rem; cursor: pointer; display: flex; align-items: center; gap: 10px;
    border: none; transition: var(--transition);
}
.btn svg { width: 20px; height: 20px; }
.btn-primary { background: var(--accent-primary); color: white; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3); }
.btn-ghost { background: none; border: 1px solid var(--border-strong); color: var(--text-secondary); }
.btn-ghost:hover { background: white; border-color: var(--text-primary); }

/* Range Styling */
.range-wrapper { display: flex; align-items: center; gap: 16px; }
.range-wrapper input { flex: 1; }
.range-wrapper output { font-family: 'JetBrains Mono'; font-weight: 700; color: var(--accent-primary); width: 80px; text-align: right; }

/* Custom Scroll */
.custom-scroll::-webkit-scrollbar { width: 6px; }
.custom-scroll::-webkit-scrollbar-track { background: transparent; }
.custom-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }

.toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    padding: 14px 28px; border-radius: 30px; color: white; font-weight: 600;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2); z-index: 1000;
}
.toast.success { background: var(--accent-green); }
.toast.error { background: var(--accent-red); }
.toast.hidden { display: none; }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }
