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

.modal-content {
    background-color: white;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.modal-header h2 {
    margin: 0;
    padding: 0;
    background: none;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #7f8c8d;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 24px;
}

.modal-close:hover {
    color: #2c3e50;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Settings Tabs */
.settings-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #7f8c8d;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #2c3e50;
}

.tab-btn.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.tab-content {
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tab-content h3 {
    color: #2c3e50;
    background: none;
    padding: 0;
    margin-bottom: 16px;
}

.tab-content h4 {
    color: #34495e;
    margin-top: 16px;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Preset Items */
.preset-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 8px;
}

.preset-icon {
    font-size: 20px;
    min-width: 24px;
}

.preset-name {
    font-weight: 600;
    flex: 1;
    color: #2c3e50;
}

.preset-dims {
    color: #7f8c8d;
    font-size: 13px;
}

.preset-category {
    margin-bottom: 24px;
}

/* Setting Items */
.setting-item {
    margin-bottom: 16px;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2c3e50;
}

.setting-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.setting-item input[type="number"] {
    margin-left: 10px;
}

/* Preset Tables */
.preset-table-container {
    overflow-x: auto;
    margin-bottom: 8px;
}

.preset-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.preset-table th {
    background: #34495e;
    color: white;
    padding: 8px 6px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    white-space: nowrap;
}

.preset-table td {
    padding: 4px;
    border-bottom: 1px solid #ecf0f1;
    vertical-align: middle;
}

.preset-table tr:hover {
    background: #f8f9fa;
}

.preset-table .add-preset-row {
    background: #f0f8ff;
}

.preset-table .add-preset-row:hover {
    background: #e6f3ff;
}

.preset-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
}

.preset-input:focus {
    outline: none;
    border-color: #3498db;
}

.preset-icon-input {
    width: 40px;
    text-align: center;
    font-size: 16px;
}

.preset-name-input {
    min-width: 100px;
}

.preset-unit-select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

.delete-preset-row {
    padding: 4px 8px !important;
    font-size: 16px !important;
}

.add-preset-btn {
    padding: 4px 12px !important;
    font-size: 16px !important;
    background: #27ae60 !important;
}
