body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: #f0f0f0;
}

.toolbar {
    background-color: #333;
    color: white;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

button {
    padding: 8px 16px;
    background-color: #0078d4;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

button:hover {
    background-color: #005a9e;
}

.container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.panel {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #ccc;
    overflow: auto;
}

.left-panel {
    background-color: #e5e5e5;
}

.right-panel {
    background-color: white;
    padding: 0; /* Remove padding to let split container fill */
    display: flex;
    flex-direction: column;
}

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

.split-section {
    flex: 1;
    padding: 15px;
    overflow: auto;
    border-bottom: 2px solid #ccc;
}

#tableContainer {
    width: 100%;
    height: 300px; /* Fixed height for table part or flex */
}

#imageContainer {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: auto;
    border: 1px dashed #999;
    background-color: #fff;
}

#previewImage {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Tabs (Removed main tabs, kept for admin if needed or cleanup) */
.tabs {
    display: none;
}

.tab-btn {
    background-color: #f1f1f1;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 10px 20px;
    transition: 0.3s;
    color: black;
}

.tab-btn:hover {
    background-color: #ddd;
}

.tab-btn.active {
    background-color: #0078d4;
    color: white;
}

.tab-content {
    display: none;
    flex: 1;
    flex-direction: column;
}

.tab-content.active {
    display: flex;
}

/* Mapping Table */
#mappingTable {
    width: 100%;
    border-collapse: collapse;
}

#mappingTable th, #mappingTable td {
    border: 1px solid #ddd;
    padding: 8px;
    vertical-align: middle;
}

#mappingTable select, #mappingTable input {
    width: 100%;
    padding: 5px;
}

/* Modal */
.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.4); 
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto; 
    padding: 20px;
    border: 1px solid #888;
    width: 80%; 
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Admin Panel Styles */
.admin-content {
    width: 90%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    height: 80vh;
}

.admin-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 15px;
}

.admin-tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
    color: #666;
    border-bottom: 3px solid transparent;
}

.admin-tab-btn.active {
    color: #0078d4;
    border-bottom: 3px solid #0078d4;
}

.admin-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.admin-tab-content.active {
    display: block;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

.admin-table th, .admin-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.admin-table th {
    background-color: #f9f9f9;
}

.action-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
}

.delete-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
}

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

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.control-group select {
    width: 100%;
    padding: 8px;
}

#optionsList {
    list-style: none;
    padding: 0;
}

#optionsList li {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.add-option-box {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.add-option-box input {
    flex: 1;
    padding: 8px;
}

.admin-footer {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    text-align: right;
}

.primary-btn {
    background-color: #0078d4;
    color: white;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}
