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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 20px;
    background-color: #1a252f;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 10px 0;
}

.nav-item {
    display: block;
    padding: 15px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: background-color 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background-color: #34495e;
}

.nav-item.active {
    background-color: #34495e;
    border-left-color: #3498db;
}

.nav-item span {
    font-size: 14px;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: white;
}

/* View Containers */
.view {
    display: none;
    flex-direction: column;
    height: 100%;
}

.view.active {
    display: flex;
}

.view-header {
    background-color: #2c3e50;
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #34495e;
}

.view-title h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.view-subtitle {
    font-size: 14px;
    margin: 5px 0 0 0;
    opacity: 0.8;
    font-weight: normal;
}

.controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: #2980b9;
}

.btn:active {
    background-color: #21618c;
}

#statusMessage {
    font-size: 14px;
    color: #ecf0f1;
}

#statusMessage.success {
    color: #2ecc71;
}

#statusMessage.error {
    color: #e74c3c;
}

.grid-container, .tables-container {
    flex: 1;
    padding: 20px;
    overflow: hidden;
}

#myGrid, #tablesGrid {
    width: 100%;
    height: 100%;
}

.ag-cell-inline-editing {
    background-color: #fff3cd !important;
}

.editable-column {
    background-color: #f8f9fa;
}

/* Tables grid - context menu rows */
#tablesGrid .ag-row {
    cursor: context-menu;
}

#tablesGrid .ag-row:hover {
    background-color: #f0f8ff !important;
}

/* Custom Context Menu */
.context-menu {
    position: fixed;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    min-width: 200px;
    padding: 4px 0;
    display: none;
}

.context-menu.active {
    display: block;
}

.context-menu-item {
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #2c3e50;
    transition: background-color 0.15s;
}

.context-menu-item:hover {
    background-color: #3498db;
    color: white;
}

.context-menu-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.context-menu-text {
    flex: 1;
}

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

.modal.active {
    display: block;
}

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

.modal-header {
    background-color: #2c3e50;
    color: white;
    padding: 20px 30px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.modal-close:hover {
    color: #e74c3c;
}

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

.preview-info {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.preview-info p {
    margin: 5px 0;
    font-size: 14px;
}

.preview-section {
    margin-bottom: 30px;
}

.preview-section h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

.preview-columns-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.preview-columns-table th {
    background-color: #34495e;
    color: white;
    padding: 10px;
    text-align: left;
    font-weight: 600;
}

.preview-columns-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #ddd;
}

.preview-columns-table tr:hover {
    background-color: #f5f5f5;
}

.preview-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    overflow-x: auto;
    display: block;
}

.preview-data-table thead {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.preview-data-table tbody {
    display: block;
    max-height: 300px;
    overflow-y: auto;
}

.preview-data-table tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.preview-data-table th {
    background-color: #2c3e50;
    color: white;
    padding: 10px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.preview-data-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #ddd;
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-data-table tbody tr:hover {
    background-color: #f5f5f5;
}
