body {
    font-family: Arial, sans-serif;
    margin: 0;
    background-color: #f4f7f6;
    color: #333;
}

header {
    background-color: #fff;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 24px;
    color: #005f7c;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.header-actions a {
    text-decoration: none;
    color: #005f7c;
    padding: 8px 15px;
    border: 1px solid #005f7c;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.header-actions a:hover {
    background-color: #e0f2f7;
}

.more-options {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #555;
}

.search-bar {
    padding: 15px 20px;
    background-color: #e9ecef;
    border-bottom: 1px solid #ced4da;
}

.search-bar input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

.tabs {
    display: flex;
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    padding-left: 20px;
}

.tab-button {
    background: none;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 16px;
    color: #555;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s, color 0.3s;
}

.tab-button.active {
    color: #005f7c;
    border-bottom-color: #005f7c;
    font-weight: bold;
}

.container {
    display: flex;
    height: calc(100vh - 180px); /* Adjust based on header/search/tabs height */
    min-width: 0; /* Ensures the container can be smaller than its content */
}

.left-panel {
    width: 300px;
    min-width: 300px; /* Prevents the panel from shrinking below 300px */
    border-right: 1px solid #ddd;
    background-color: #f8f9fa;
    overflow-y: auto;
    padding: 15px;
    flex-shrink: 0; /* Prevents the panel from shrinking */
}

.right-panel {
    flex: 1; /* Takes up remaining space */
    min-width: 0; /* Allows the panel to be smaller than its content */
    padding: 20px;
    overflow-y: auto;
    overflow-x: auto; /* Adds horizontal scroll if content overflows */
    background-color: #fff;
}

/* Tree View Styling */
.tree-group {
    margin-bottom: 10px;
}

.tree-group-toggle {
    font-weight: bold;
    cursor: pointer;
    display: block;
    padding: 5px 0;
    color: #005f7c;
    position: relative;
    padding-left: 15px;
}
.tree-group-toggle::before {
    content: '▶'; /* Right arrow */
    position: absolute;
    left: 0;
    top: 5px;
    transition: transform 0.2s;
    font-size: 10px; /* Smaller arrow */
}
.tree-group-toggle.expanded::before {
    content: '▼'; /* Down arrow */
}

.tree-group-list {
    list-style: none;
    padding-left: 15px;
    margin: 0;
    display: none; /* Hidden by default */
}

.code-set-item {
    padding: 5px 2px;
    cursor: pointer;
    color: #333;
    transition: background-color 0.2s;
    border-radius: 3px;
    margin-left: 5px;
    font-size: 14px;
}

.code-set-item:hover {
    background-color: #e0f2f7;
}

.code-set-item.selected {
    background-color: #007bff;
    color: white;
    font-weight: bold;
}

.code-set-item.inactive {
    color: #999;
    font-style: italic;
}

/* Right Panel Details */
#codeSetDetails {
    min-height: 200px; /* Ensure space before content loads */
}

.details-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.status-badge {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: bold;
    color: white;
}
.active-status {
    background-color: #28a745; /* Green */
}
.inactive-status {
    background-color: #dc3545; /* Red */
}

.right-panel h2 {
    color: #005f7c;
    margin-top: 0;
    margin-bottom: 10px;
}

.metadata p {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 20px 0;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.detail-grid h3 {
    margin-top: 0;
    color: #005f7c;
    font-size: 16px;
}

.detail-grid p {
    margin: 0;
    font-size: 15px;
}

.code-values-section {
    margin-top: 30px;
}

.code-values-section h3 {
    color: #005f7c;
    margin-bottom: 15px;
}

.code-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.code-actions label {
    font-size: 14px;
}

.icon-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.icon-button:hover {
    background-color: #0056b3;
}

.icon-button .icon {
    font-size: 16px;
}

/* DataTables customization */
#codesTable {
    width: 100% !important; /* Override DataTables default width */
    border-collapse: collapse;
    margin-top: 10px;
}

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

#codesTable th {
    background-color: #f2f2f2;
    font-weight: bold;
}

#codesTable tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

#codesTable tbody tr:hover {
    background-color: #e0f2f7;
}

/* Admin view basic styling (will need more detail) */
.admin-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.admin-container h1, .admin-container h2 {
    color: #005f7c;
}

.admin-container hr {
    margin: 40px 0;
    border: 0;
    border-top: 1px solid #eee;
}

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

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

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.form-group input[type="checkbox"] {
    margin-top: 5px;
    transform: scale(1.2); /* Make checkbox slightly larger */
}


.btn-primary {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px; /* Smaller buttons for table actions */
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.3s;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 5px 10px; /* Smaller buttons for table actions */
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.3s;
    margin-left: 10px;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

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

.admin-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.admin-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.admin-table tbody tr:hover {
    background-color: #e0f2f7;
}

.admin-actions button {
    margin-right: 5px;
}

/* Ensure DataTables buttons have correct styling */
.dataTables_wrapper .dt-buttons {
    margin-bottom: 10px;
}
.dataTables_wrapper .dt-button {
    background-color: #007bff !important;
    color: white !important;
    border-radius: 5px !important;
    padding: 8px 12px !important;
    margin-right: 5px !important;
    cursor: pointer !important;
    border: none !important;
}
.dataTables_wrapper .dt-button:hover {
    background-color: #0056b3 !important;
}

.green-dot, .red-dot, .blue-dot, .purple-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.green-dot {
    background-color: #28a745;
}
.red-dot {
    background-color: #dc3545;
}
.blue-dot {
    background-color: #007bff;
}
.purple-dot {
    background-color: #c300ff;
}