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

:root {
    --primary: #0066cc;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --border: #bdc3c7;
    --bg-dark: #1a1a1a;
    --bg-light: #f8f9fa;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--dark);
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

header {
    background: linear-gradient(135deg, var(--primary) 0%, #0052a3 100%);
    color: white;
    padding: 20px 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 28px;
    margin-bottom: 5px;
}

header p {
    font-size: 14px;
    opacity: 0.9;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.toolbar-section {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: #0052a3;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.btn-secondary {
    background: var(--light);
    color: var(--dark);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #e0e0e0;
}

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

.btn-success:hover {
    background: #218838;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

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

.btn-info:hover {
    background: #138496;
}

.input-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    background: white;
    border: 1px solid var(--border);
    overflow-y: auto;
}

.sidebar-left {
    width: 200px;
    border-right: 1px solid var(--border);
    padding: 15px;
}

.sidebar-right {
    width: 300px;
    border-left: 1px solid var(--border);
    padding: 0;
    display: flex;
    flex-direction: column;
}

.sidebar h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--dark);
}

.component-palette {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.component-item {
    padding: 10px 12px;
    background: var(--bg-light);
    border: 2px solid var(--primary);
    border-radius: 4px;
    cursor: move;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    user-select: none;
}

.component-item:hover {
    background: #e3f2fd;
    box-shadow: 0 2px 6px rgba(0, 102, 204, 0.2);
}

.canvas-container {
    flex: 1;
    position: relative;
    background: var(--bg-light);
    overflow: auto;
}

canvas {
    display: block;
    background: white;
}

.context-menu {
    position: fixed;
    background: white;
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 150px;
}

.context-item {
    display: block;
    width: 100%;
    padding: 10px 15px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.context-item:hover {
    background: var(--bg-light);
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-panel {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.tab-panel.active {
    display: flex;
    flex-direction: column;
}

.threats-list, .paths-list, .stats-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.threat-card {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-light);
    border-left: 4px solid var(--danger);
}

.threat-card.high {
    border-left-color: var(--danger);
    background: #ffe6e6;
}

.threat-card.medium {
    border-left-color: var(--warning);
    background: #fff9e6;
}

.threat-card.low {
    border-left-color: var(--success);
    background: #e6f9e6;
}

.threat-card h4 {
    font-size: 13px;
    margin-bottom: 5px;
    color: var(--dark);
}

.threat-card p {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.threat-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    color: white;
}

.threat-badge.critical {
    background: var(--danger);
}

.threat-badge.high {
    background: #ff6b6b;
}

.threat-badge.medium {
    background: var(--warning);
    color: black;
}

.threat-badge.low {
    background: var(--success);
}

.placeholder {
    color: #999;
    font-size: 12px;
    font-style: italic;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 500px;
    padding: 30px;
    position: relative;
}

.close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: var(--dark);
}

.modal h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--dark);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 13px;
    color: var(--dark);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
}

.form-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin-right: 8px;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.button-group button {
    flex: 1;
}

scrollbar-width: thin;
scrollbar-color: #bdc3c7 #f0f0f0;

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f0f0f0;
}

::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}
