/* ==========================================================================
   UBI Data Visualizer Studio - Spreadsheet Grid CSS
   ========================================================================== */

.grid-container {
  width: 100%;
  height: 100%;
  overflow: auto;
  position: relative;
  background: var(--bg-primary);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  font-family: var(--font-mono);
  table-layout: fixed;
}

.data-table th, .data-table td {
  padding: 6px 10px;
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Header Row */
.data-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 600;
  z-index: 10;
  border-bottom: 1px solid var(--border-color);
  user-select: none;
}

.th-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.th-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.th-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.th-type {
  font-size: 10px;
  padding: 1px 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  color: var(--text-muted);
}

.th-role-select {
  font-size: 10px;
  padding: 2px 4px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  color: var(--text-secondary);
  cursor: pointer;
  width: 100%;
}

/* Row Numbers Column */
.th-row-num, .td-row-num {
  width: 46px;
  min-width: 46px;
  max-width: 46px;
  text-align: center;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 11px;
  position: sticky;
  left: 0;
  z-index: 5;
  user-select: none;
}

.data-table thead th.th-row-num {
  z-index: 15;
}

/* Table Cells */
.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.data-table td {
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: text;
}

.data-table td.cell-numeric {
  text-align: right;
}

.data-table td.cell-editing {
  padding: 0;
  background: var(--bg-primary);
}

.cell-editor-input {
  width: 100%;
  height: 100%;
  padding: 6px 10px;
  border: 2px solid var(--accent-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: inherit;
  outline: none;
}

.row-actions-btn {
  opacity: 0;
  transition: opacity var(--transition-fast);
  background: none;
  border: none;
  color: var(--accent-danger);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 12px;
}

.data-table tr:hover .row-actions-btn {
  opacity: 1;
}

/* Drop Zone for File Import */
.dropzone-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 101, 189, 0.25);
  backdrop-filter: blur(4px);
  border: 2px dashed var(--accent-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 500;
  color: white;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.dropzone-overlay.dragover {
  opacity: 1;
  pointer-events: auto;
}
