/**
 * CreateTableModal styles
 */

.Overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.Modal {
  background: var(--theme-color-bg-2);
  border-radius: 8px;
  width: 640px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.Header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--theme-color-border-default);
}

.Content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.Section {
  margin-bottom: 20px;

  &:last-child {
    margin-bottom: 0;
  }
}

.Input {
  width: 100%;
  padding: 8px 12px;
  margin-top: 8px;
  background: var(--theme-color-bg-3);
  border: 1px solid var(--theme-color-border-default);
  border-radius: 4px;
  color: var(--theme-color-fg-default);
  font-size: 13px;

  &::placeholder {
    color: var(--theme-color-fg-default-shy);
  }

  &:focus {
    outline: none;
    border-color: var(--theme-color-primary);
  }
}

.ColumnsTable {
  margin-top: 12px;
  border: 1px solid var(--theme-color-border-default);
  border-radius: 4px;
  overflow: hidden;
}

.ColumnRow {
  display: grid;
  grid-template-columns: 2fr 1.2fr 0.8fr 1.5fr 40px;
  gap: 8px;
  padding: 8px 12px;
  background: var(--theme-color-bg-3);
  border-bottom: 1px solid var(--theme-color-border-default);
  align-items: center;

  &:first-child {
    background: var(--theme-color-bg-2);
    font-size: 11px;
    color: var(--theme-color-fg-default-shy);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  &:last-child {
    border-bottom: none;
  }

  &[data-system='true'] {
    background: var(--theme-color-bg-2);
    opacity: 0.7;
  }
}

.ColName,
.ColType,
.ColRequired,
.ColDefault,
.ColActions {
  display: flex;
  align-items: center;
}

.ColRequired {
  justify-content: center;
}

.ColActions {
  justify-content: flex-end;
}

.ColumnInput {
  width: 100%;
  padding: 6px 8px;
  background: var(--theme-color-bg-2);
  border: 1px solid var(--theme-color-border-default);
  border-radius: 3px;
  color: var(--theme-color-fg-default);
  font-size: 12px;

  &::placeholder {
    color: var(--theme-color-fg-default-shy);
  }

  &:focus {
    outline: none;
    border-color: var(--theme-color-primary);
  }
}

.TypeSelect {
  width: 100%;
  padding: 6px 8px;
  background: var(--theme-color-bg-2);
  border: 1px solid var(--theme-color-border-default);
  border-radius: 3px;
  color: var(--theme-color-fg-default);
  font-size: 12px;
  cursor: pointer;

  &:focus {
    outline: none;
    border-color: var(--theme-color-primary);
  }
}

.Error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--theme-color-danger-transparent);
  border-radius: 4px;
  color: var(--theme-color-danger);
  margin-top: 12px;
}

.Footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--theme-color-border-default);
}
