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

body {
    font-family: Arial, sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

#toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    flex-wrap: wrap;
}

#search {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

#search:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 3px rgba(33, 150, 243, 0.3);
}

button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

#select-search-btn {
    background: #4CAF50;
    color: white;
}

#select-search-btn:hover {
    background: #45a049;
}

#filter-btn {
    background: #2196F3;
    color: white;
}

#filter-btn:hover {
    background: #1976D2;
}

#reset-btn {
    background: #757575;
    color: white;
}

#reset-btn:hover {
    background: #616161;
}

#export-svg-btn {
    background: #9c27b0;
    color: white;
}

#export-svg-btn:hover {
    background: #7b1fa2;
}

#faculty-filter-btn {
    background: #ff9800;
    color: white;
}

#faculty-filter-btn:hover {
    background: #f57c00;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
}

.modal-actions-top {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.modal-actions-top button {
    flex: 1;
    padding: 6px 12px;
    font-size: 12px;
    background: #e0e0e0;
    color: #333;
}

.modal-actions-top button:hover {
    background: #bdbdbd;
}

#faculty-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 15px;
}

.faculty-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.15s;
}

.faculty-item:last-child {
    border-bottom: none;
}

.faculty-item:hover {
    background: #f5f5f5;
}

.faculty-item input[type="checkbox"] {
    margin-left: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.faculty-color-badge {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    margin-left: 10px;
    flex-shrink: 0;
}

.faculty-name {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.faculty-count {
    font-size: 12px;
    color: #888;
    margin-right: 8px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-actions button {
    min-width: 80px;
}

.btn-primary {
    background: #2196F3;
    color: white;
}

.btn-primary:hover {
    background: #1976D2;
}

.btn-secondary {
    background: #757575;
    color: white;
}

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

#status {
    margin-left: auto;
    color: #666;
    font-size: 13px;
}

#legend {
    display: flex;
    gap: 20px;
    padding: 8px 15px;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    font-size: 12px;
    color: #555;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-line {
    display: inline-block;
    width: 30px;
    height: 3px;
}

.legend-line.and-line {
    background: #333;
}

.legend-line.or-line {
    background: #2196F3;
    background: repeating-linear-gradient(
        90deg,
        #2196F3,
        #2196F3 4px,
        transparent 4px,
        transparent 8px
    );
}

.legend-line.equiv-line {
    background: repeating-linear-gradient(
        90deg,
        #999,
        #999 6px,
        transparent 6px,
        transparent 10px
    );
}

.legend-credit {
    margin-left: auto;
    color: #888;
    font-size: 11px;
}

.legend-credit a {
    color: #1976D2;
    text-decoration: none;
}

.legend-credit a:hover {
    text-decoration: underline;
}

#cy {
    flex: 1;
    width: 100%;
    background: #fff;
}

/* Highlight for search results */
.highlighted {
    background: #fff3cd;
}
