body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #1b1816;
    font-family: Arial, sans-serif;
}

.ui-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 100;
    background-color: rgba(27, 24, 22, 0.8);
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ff6b00;
    display: flex;
    flex-wrap: wrap;
    width: 320px;
    max-width: 320px;
}

.ui-controls button {
    margin-right: 5px;
    margin-bottom: 5px;
    padding: 5px 10px;
    background-color: #444444;
    color: white;
    border: 2px solid #ff6b00;
    border-radius: 4px;
    cursor: pointer;
}

.ui-controls button.active {
    background-color: #ff6b00;
}

/* Tool button styling */
.tool-btn {
    width: 45px !important;
    height: 45px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.tool-icon {
    width: 24px;
    height: 24px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.wire-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='8' y1='12' x2='16' y2='12'%3E%3C/line%3E%3Cline x1='2' y1='9' x2='4' y2='12'%3E%3C/line%3E%3Cline x1='2' y1='15' x2='4' y2='12'%3E%3C/line%3E%3Cline x1='22' y1='9' x2='20' y2='12'%3E%3C/line%3E%3Cline x1='22' y1='15' x2='20' y2='12'%3E%3C/line%3E%3C/svg%3E");
}

.switch-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'%3E%3C/rect%3E%3Ccircle cx='12' cy='12' r='5' fill='white'%3E%3C/circle%3E%3C/svg%3E");
}

.output-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpolygon points='12,2 22,12 12,22 2,12' fill='%23444444'%3E%3C/polygon%3E%3Ccircle cx='12' cy='12' r='4' fill='white'%3E%3C/circle%3E%3C/svg%3E");
}

.and-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10' fill='%23444444'%3E%3C/circle%3E%3Cpath d='M7 7 L17 17 M7 17 L17 7' stroke='white' stroke-width='2'%3E%3C/path%3E%3C/svg%3E");
}

.not-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5'%3E%3Ccircle cx='12' cy='12' r='10' fill='%23444444'%3E%3C/circle%3E%3Cpath d='M6 12 C7.5 15, 9 9, 12 12 C15 15, 16.5 9, 18 12' stroke='white' stroke-width='2.5'%3E%3C/path%3E%3C/svg%3E");
}

.delete-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M3 6h18'%3E%3C/path%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'%3E%3C/path%3E%3Cpath d='M10 11v6'%3E%3C/path%3E%3Cpath d='M14 11v6'%3E%3C/path%3E%3C/svg%3E");
}

.divider {
    width: 100%;
    height: 1px;
    background-color: #ff6b00;
    margin: 5px 0;
}

.info {
    position: absolute;
    bottom: 10px;
    left: 10px;
    color: #ff6b00;
    font-family: monospace;
    font-size: 14px;
    background-color: rgba(27, 24, 22, 0.8);
    padding: 5px;
    border-radius: 5px;
}

/* Tool notification styling */
.tool-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 18px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none; /* Prevent capturing mouse events */
    z-index: 1000;
    transition: opacity 0.5s;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background-color: #2a2724;
    margin: 10% auto;
    padding: 20px;
    border: 2px solid #ff6b00;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    color: white;
}

.close {
    color: #ff6b00;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: white;
}

#export-data,
#import-data,
#circuit-name,
#library-import-data,
#library-circuit-name {
    width: 100%;
    height: 150px;
    background-color: #1b1816;
    color: white;
    border: 1px solid #6b2d00;
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 10px;
    font-family: monospace;
}

#circuit-name,
#library-circuit-name {
    height: 30px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

/* All buttons in the application should use this styling */
button {
    margin-right: 10px;
    padding: 8px 16px;
    background-color: #444444;
    color: white;
    border: 2px solid #ff6b00;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background-color: #ff6b00;
}

#export-container,
#import-container,
#library-import-container,
#library-save-container {
    margin-top: 15px;
}

/* Library styles */
.library-container {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 15px;
}

.library-item {
    background-color: #1b1816;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 4px;
    border: 1px solid #6b2d00;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.library-item-name {
    font-weight: bold;
    margin-right: 10px;
}

.library-item-buttons {
    display: flex;
}

.rename-input {
    background-color: #1b1816;
    color: white;
    border: 1px solid #6b2d00;
    border-radius: 4px;
    padding: 8px;
    width: 200px;
    margin-right: 10px;
}

#library-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

/* File selection message styling */
#selected-file-name {
    margin-left: 10px;
    color: #aaa;
}

/* File input styling */
.file-input-container {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.file-input-container input[type="file"] {
    display: none;
}

/* Component counter styling */
.component-counter {
    position: absolute;
    top: 135px;
    left: 10px;
    z-index: 90;
    background-color: rgba(27, 24, 22, 0.8);
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ff6b00;
    color: white;
    font-family: monospace;
    font-size: 14px;
    width: 140px;
}

.counter-label {
    color: #ff6b00;
    margin-right: 5px;
}

.counter-value {
    color: white;
    font-weight: bold;
}