/* Base styles */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
}

/* Container styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header styles */
.gemini-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.gemini-header h1 {
    margin: 0;
    font-size: 24px;
    color: #1976d2;
}

.gemini-header p {
    margin: 5px 0 0 0;
    color: #666;
}

.theme-toggle-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: #1976d2;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.theme-toggle-btn:hover {
    background: #1565c0;
}

/* Chat area styles */
.gemini-chat-area {
    height: 400px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    margin-bottom: 20px;
}

.gemini-message {
    margin-bottom: 15px;
}

.gemini-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.bot .gemini-bubble {
    background: #e3f2fd;
}

/* Input bar styles */
.gemini-input-bar {
    position: relative;
    margin-top: 20px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.gemini-input-row {
    display: flex;
    gap: 10px;
}

.gemini-chat-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.gemini-chat-input:focus {
    outline: none;
    border-color: #1976d2;
}

.gemini-send-btn {
    padding: 8px 24px;
    border: none;
    border-radius: 4px;
    background: #1976d2;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.gemini-send-btn:hover {
    background: #1565c0;
}

/* Quick actions styles */
.gemini-quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.gemini-quick-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: #1976d2;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
}

.gemini-quick-label {
    padding: 8px 16px;
    border: none;
    border-radius: 0px;
    background: #2c6a1ad4;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
}

.gemini-quick-btn:hover {
    background: #1565c0;
}

/* Visualization section styles */
.visualizer-section {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    background: #fff;
}

.viz-options {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.viz-options h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.viz-options select {
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
    margin-right: 10px;
    font-size: 14px;
}

.viz-options button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background: #1976d2;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-right: 10px;
}

.viz-options button:hover {
    background: #1565c0;
}

.chart-container {
    height: 400px;
    position: relative;
    padding: 20px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #eee;
}

/* System message styles */
.gemini-system-message {
                background: var(--system-bg);
                color: var(--system-color);
                border-radius: 12px;
                padding: 10px 18px;
                margin: 18px 0 8px 0;
                font-size: 1rem;
                text-align: center;
                border: 1px solid var(--system-border);
}

/* Dark theme styles */
.dark-theme {
    background-color: #1a1a1a;
    color: #ffffff;
}

.dark-theme .gemini-header {
    background: #2d2d2d;
}

.dark-theme .gemini-header h1 {
    color: #64b5f6;
}

.dark-theme .gemini-header p {
    color: #aaa;
}

.dark-theme .gemini-chat-area,
.dark-theme .visualizer-section,
.dark-theme .viz-options,
.dark-theme .chart-container {
    background: #2d2d2d;
    border-color: #404040;
}

.dark-theme .gemini-bubble {
    background: #404040;
    color: #ffffff;
}

.dark-theme .gemini-chat-input,
.dark-theme .viz-options select {
    background: #2d2d2d;
    color: #ffffff;
    border-color: #404040;
}

.dark-theme .gemini-system-message {
    background: #3d3d3d;
    border-color: #505050;
    color: #aaa;
}

/* Responsive styles */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .gemini-header {
        flex-direction: column;
        text-align: center;
    }

    .theme-toggle-btn {
        margin-top: 10px;
    }

    .gemini-quick-actions {
        flex-direction: column;
    }

    .gemini-quick-btn {
        width: 100%;
    }

    .gemini-bubble {
        max-width: 90%;
    }

    .viz-options {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .viz-options select,
    .viz-options button {
        width: 100%;
        margin-right: 0;
    }
}

/* Table List Section */
.table-list-section {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1200px;
    height: 80vh;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.table-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

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

#tableSearch {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 200px;
}

.close-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    background: #f44336;
    color: white;
    cursor: pointer;
}

.table-list-content {
    flex: 1;
    overflow-y: auto;
}

#databaseTables {
    width: 100%;
    border-collapse: collapse;
}

#databaseTables th,
#databaseTables td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

#databaseTables th {
    background: #f5f5f5;
    position: sticky;
    top: 0;
}

#databaseTables tr:hover {
    background: #f8f9fa;
}

/* Dark theme support */
.dark-theme .table-list-section {
    background: #2d2d2d;
    color: #fff;
}

.dark-theme #tableSearch {
    background: #2d2d2d;
    color: #fff;
    border-color: #404040;
}

.dark-theme #databaseTables th {
    background: #404040;
}

.dark-theme #databaseTables td {
    border-color: #404040;
}

.dark-theme #databaseTables tr:hover {
    background: #3d3d3d;
}

/* Quick Actions updated styling */
.gemini-quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0;
    justify-content: center;
}

.gemini-quick-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 20px;
    background: #1976d2;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gemini-quick-label {
    padding: 10px 16px;
    border: none;
    border-radius: 20px;
    background: #2c6a1ad4;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gemini-quick-btn:hover {
    background: #1565c0;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Updated visualization section title */
.viz-options h3 {
    color: #1976d2;
    font-size: 1.2em;
    margin-bottom: 15px;
}

/* Add new inventory visualization button style */
.gemini-quick-btn[onclick*="showInventoryVisualization"] {
    background: #2e7d32;
}

.gemini-quick-btn[onclick*="showInventoryVisualization"]:hover {
    background: #1b5e20;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 14px;
}

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

.data-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

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

.data-table tr:hover {
    background-color: #f0f0f0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 14px;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 2px solid #dee2e6;
}

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

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

.data-table td {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-container {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.table-header {
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.table-controls {
    display: flex;
    gap: 10px;
}

/* Dark theme support */
.dark-theme .data-table {
    background: #2d2d2d;
    color: #fff;
}

.dark-theme .data-table th {
    background-color: #1a1a1a;
    color: #fff;
    border-bottom-color: #404040;
}

.dark-theme .data-table td {
    border-bottom-color: #404040;
}

.dark-theme .data-table tbody tr:nth-child(even) {
    background-color: #333;
}

.dark-theme .data-table tbody tr:hover {
    background-color: #404040;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    padding: 10px;
    gap: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
}


.page-numbers {
    display: flex;
    gap: 5px;
}

.pagination-btn {
    padding: 8px 15px;
    border: 1px solid #dee2e6;
    background: #ffffff;
    cursor: pointer;
    border-radius: 4px;
    color: #007bff;
    font-weight: 500;
    min-width: 40px;
    text-align: center;
}

.pagination-btn.active {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}

.pagination-btn:hover:not(.active):not(:disabled) {
    background: #e9ecef;
}

.pagination-btn:disabled {
    background: #e9ecef;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-btn {
    padding: 5px 10px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    border-radius: 3px;
}

.pagination-btn.active {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}

.pagination-btn:hover:not(.active) {
    background: #e9ecef;
}

.pagination-btn:disabled {
    background: #e9ecef;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}

.pagination-btn:hover:not(.active):not(:disabled) {
    background: #e9ecef;
    border-color: #007bff;
}

.pagination-btn:disabled {
    background: #e9ecef;
    cursor: not-allowed;
    opacity: 0.6;
    color: #6c757d;
}

/* Ensure table list content is properly styled */
.table-list-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}


.pagination-btn {
    padding: 5px 10px;
    margin: 0 2px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #007bff;
    font-weight: bold;
}

.pagination-btn.active {
    color: #0056b3;
    text-decoration: underline;
}

.pagination-btn:hover {
    text-decoration: underline;
}

.pagination-ellipsis {
    margin: 0 5px;
    color: #6c757d;
}

#tableListPagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

#prevPageBtn, #nextPageBtn {
    padding: 5px 10px;
    margin: 0 5px;
    border: 1px solid #007bff;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    border-radius: 3px;
}

#prevPageBtn:disabled, #nextPageBtn:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
}