/* Parquet Viewer Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--vscode-editor-background);
    color: var(--vscode-editor-foreground);
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 100%;
}

.header {
    background: var(--vscode-titleBar-activeBackground);
    border-bottom: 1px solid var(--vscode-panel-border);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.title {
    font-size: 16px;
    font-weight: 600;
    color: var(--vscode-titleBar-activeForeground);
}

.file-info {
    font-size: 12px;
    color: var(--vscode-descriptionForeground);
}

.limit-warning {
    background: var(--vscode-inputValidation-warningBackground);
    border: 1px solid var(--vscode-inputValidation-warningBorder);
    color: var(--vscode-inputValidation-warningForeground);
    padding: 10px 16px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    line-height: 1.4;
    flex-shrink: 0;
}

.warning-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.controls {
    background: var(--vscode-editor-background);
    border-bottom: 1px solid var(--vscode-panel-border);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    gap: 16px;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 400px;
}

.search-input {
    flex: 1;
    padding: 6px 12px;
    border: 1px solid var(--vscode-input-border);
    border-radius: 4px;
    background: var(--vscode-input-background);
    color: var(--vscode-input-foreground);
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: var(--vscode-focusBorder);
}

.view-controls {
    display: flex;
    gap: 8px;
}

.btn {
    padding: 6px 12px;
    border: 1px solid var(--vscode-button-border);
    border-radius: 4px;
    background: var(--vscode-button-background);
    color: var(--vscode-button-foreground);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.btn:hover {
    background: var(--vscode-button-hoverBackground);
}

.btn:active {
    background: var(--vscode-button-activeBackground);
}

.btn-secondary {
    background: var(--vscode-button-secondaryBackground);
    color: var(--vscode-button-secondaryForeground);
    border-color: var(--vscode-button-secondaryBorder);
}

.btn-secondary:hover {
    background: var(--vscode-button-secondaryHoverBackground);
}

.table-container {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: var(--vscode-descriptionForeground);
    font-size: 14px;
}

.error {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: var(--vscode-errorForeground);
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

.table-wrapper {
    height: 100%;
    overflow: auto;
    position: relative;
}

.parquet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--vscode-editor-background);
}

.parquet-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--vscode-editor-background);
}

.parquet-table th {
    background: var(--vscode-list-hoverBackground);
    border: 1px solid var(--vscode-panel-border);
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--vscode-editor-foreground);
    position: relative;
}

.parquet-table th:hover {
    background: var(--vscode-list-activeSelectionBackground);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.header-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sort-button {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    padding: 2px 4px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: var(--vscode-descriptionForeground);
    cursor: pointer;
    flex-shrink: 0;
}

.sort-button:hover {
    background: var(--vscode-toolbar-hoverBackground);
    color: var(--vscode-editor-foreground);
}

.sort-button:focus-visible {
    outline: 1px solid var(--vscode-focusBorder);
    outline-offset: 1px;
}

.sort-icon {
    font-size: 9px;
    line-height: 1;
    opacity: 0.45;
}

.sort-button[data-sort-direction="asc"] .sort-icon-asc,
.sort-button[data-sort-direction="desc"] .sort-icon-desc {
    opacity: 1;
    color: var(--vscode-editor-foreground);
}

.parquet-table td {
    border: 1px solid var(--vscode-panel-border);
    padding: 6px 12px;
    color: var(--vscode-editor-foreground);
    word-break: break-word;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.parquet-table tbody tr:nth-child(even) {
    background: var(--vscode-list-alternatingBackground);
}

.parquet-table tbody tr:hover {
    background: var(--vscode-list-hoverBackground);
}

.parquet-table tbody tr.highlight {
    background: var(--vscode-textPreformat-background) !important;
}

.raw-data-wrapper {
    height: 100%;
    overflow: auto;
    position: relative;
    padding: 16px;
}

.raw-data {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.4;
    color: var(--vscode-editor-foreground);
    background: var(--vscode-editor-background);
    border: 1px solid var(--vscode-panel-border);
    border-radius: 4px;
    padding: 16px;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
    resize: vertical;
    min-height: 200px;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.raw-data:focus {
    outline: none;
    border-color: var(--vscode-focusBorder);
    box-shadow: 0 0 0 1px var(--vscode-focusBorder);
}

.pagination {
    background: var(--vscode-editor-background);
    border-top: 1px solid var(--vscode-panel-border);
    padding: 12px 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.page-info {
    font-size: 12px;
    color: var(--vscode-descriptionForeground);
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: var(--vscode-menu-background);
    border: 1px solid var(--vscode-menu-border);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    min-width: 180px;
    font-size: 13px;
}

.context-menu-item {
    padding: 8px 12px;
    cursor: pointer;
    color: var(--vscode-menu-foreground);
    transition: background-color 0.1s ease;
}

.context-menu-item:hover {
    background: var(--vscode-menu-selectionBackground);
}

.context-menu-separator {
    height: 1px;
    background: var(--vscode-menu-separatorBackground);
    margin: 4px 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .search-container {
        max-width: none;
    }
    
    .view-controls {
        justify-content: center;
    }
    
    .parquet-table {
        font-size: 12px;
    }
    
    .parquet-table th,
    .parquet-table td {
        padding: 4px 8px;
    }
}

/* Scrollbar styling */
.table-wrapper::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: var(--vscode-scrollbarSlider-background);
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--vscode-scrollbarSlider-activeBackground);
    border-radius: 6px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--vscode-scrollbarSlider-hoverBackground);
}
