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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #1f2937;
}

/* Navbar */
.navbar {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: #2563eb !important;
}

.navbar-brand i {
    margin-right: 0.5rem;
}

/* Buttons */
.btn-outline-secondary {
    border: 1px solid #e5e7eb;
    color: #6b7280;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-outline-secondary:hover {
    background: #f3f4f6;
    border-color: #6b7280;
}

.btn-outline-primary {
    border: 1px solid #2563eb;
    color: #2563eb;
    background: white;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-outline-primary:hover {
    background: #2563eb;
    color: white;
}

.btn-primary {
    background: #2563eb;
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.btn-primary:hover {
    background: #1d4ed8;
}

/* Control Bar */
.control-bar {
    background: white;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
}

/* Tree Container */
.tree-container {
    background: white;
    border: 1px solid #e5e7eb;
    height: calc(100vh - 200px);
    margin-bottom: 1rem;
    overflow: auto;
}

.tree-container svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Status Bar */
.status-bar {
    background: white;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
}

/* Tree Node Styles */
.link {
    fill: none;
    stroke: #ccc;
    stroke-width: 2px;
}

.node {
    cursor: pointer;
}

.node rect {
    transition: all 0.2s;
}

.node:hover rect {
    stroke: #000 !important;
    stroke-width: 3px !important;
}

/* Search Results */
.search-results {
    position: absolute;
    background: white;
    border: 1px solid #e5e7eb;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 250px;
}

.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}

.search-result-item:hover {
    background: #f3f4f6;
}

.search-result-item strong {
    display: block;
    color: #1f2937;
}

.search-result-item small {
    color: #6b7280;
    font-size: 0.75rem;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1100;
}

.toast {
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-top: 10px;
    min-width: 280px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid;
}

.toast-success { border-left-color: #10b981; }
.toast-error { border-left-color: #ef4444; }
.toast-warning { border-left-color: #f59e0b; }
.toast-info { border-left-color: #2563eb; }

.toast-body {
    padding: 0.75rem 1rem;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .control-bar .row > div {
        margin-bottom: 0.5rem;
    }
    
    .tree-container {
        height: 50vh !important;
    }
}