@tailwind base;
@tailwind components;
@tailwind utilities;

/* Hiding "Go Back" button to not confuse users and giant svg icon for when no records found */
div[data-target="panel-tools"] a.text-gray-500.text-sm, svg[data-target="table-empty-state-svg"] {
  display: none !important;
}

/* Reduces the padding when no resource is attached on Product Cost Sheet / #show page */
div[data-model-name="Product"] turbo-frame[id^="has_many_field_show"] div.rounded.shadow-panel div.py-24 {
  padding-top: 1rem;
  padding-bottom: 2rem;
}

/* Hide file name on sidebar product photo attachment */
div[data-resource-show-target="photoFileWrapper"] span.text-gray-500.text-sm {
  display: none !important;
}

/* Hide the delete trash can button on product photo attachment on show page */
div[data-model-name="Product"][data-controller="resource-show "] div[data-resource-show-target="photoFileWrapper"] div.flex.space-x-2 {
  display: none !important;
}

/* Styles for Actions to add top borders and padding to separate adding existing or new resources */
div[data-resource-edit-target="castingSelectWrapper"], div[data-resource-edit-target="newCastingBooleanWrapper"],
div[data-resource-edit-target="stoneSelectWrapper"], div[data-resource-edit-target="newStoneBooleanWrapper"],
div[data-resource-edit-target="findingSelectWrapper"], div[data-resource-edit-target="newFindingBooleanWrapper"],
div[data-resource-edit-target="laborSelectWrapper"], div[data-resource-edit-target="newLaborBooleanWrapper"],
div[data-resource-edit-target="miscItemSelectWrapper"], div[data-resource-edit-target="newMiscItemBooleanWrapper"],
div[data-resource-edit-target="quantityNumberWrapper"] {
  border-top: 1px solid #C8CBD0;
}

div[data-resource-edit-target="castingSelectWrapper"],
div[data-resource-edit-target="stoneSelectWrapper"],
div[data-resource-edit-target="findingSelectWrapper"],
div[data-resource-edit-target="laborSelectWrapper"],
div[data-resource-edit-target="miscItemSelectWrapper"],
div[data-resource-edit-target="quantityNumberWrapper"] {
  padding: 15px 0 15px 0;
}

/* Putting max height + scrolling on content of modals for long action forms to add resources to products */
div[data-resource-name="products"] div[data-modal-target="modal"] div.modal-body div.px-6.text-base.text-gray-500 {
  overflow: auto;
  max-height: 70vh;
}

/* Hides arrows on number inputs */
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
/* Firefox */
input[type=number] {
  -moz-appearance: textfield;
}

/* Makes the first item on the left hand menu ("Products") formatted and aligned */
.avo-sidebar > div > div > div > a:first-of-type svg {
  height: 20px;
  min-width: 20px;
}

.avo-sidebar > div > div > div > a:first-of-type {
  margin-left: 1rem;
  padding: 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
@tailwind base;
@tailwind components;
@tailwind utilities;

/* TODO: can this be removed? Don't use this, use application.tailwind.css instead */
/* Not properly building each time! So confused! */

/* Hiding show and edit buttons on ALL resources globally */
a[data-target="control:view"], a[data-target="control:edit"] {
  display: none !important;
}

/* But then show the Edit buttons ONLY on the Product has_many resource components so user can edit quantity */
/* Using Avo 3.x resource naming convention: Avo::Resources::ModelName becomes data-resource-name="model_name" */
turbo-frame[id^="has_many_field_show_product_castings"] a[data-target="control:edit"],
turbo-frame[id^="has_many_field_show_product_stones"] a[data-target="control:edit"],
turbo-frame[id^="has_many_field_show_product_findings"] a[data-target="control:edit"],
turbo-frame[id^="has_many_field_show_product_labors"] a[data-target="control:edit"],
turbo-frame[id^="has_many_field_show_product_misc_items"] a[data-target="control:edit"] {
  display: flex !important;
}


/* max height on sidebar for product cost sheet */
.resource-sidebar-component img {
  max-height: 28rem;
}

/* Hides search on individual resources; keeps global search */
div.flex.flex-col.xs\:flex-row.xs\:justify-between.space-y-2.xs\:space-y-0.py-4:has(div.resource-search) {
  display: none !important;
}

/* adds padding to the associated Collections when editing a Product */
div[data-model-name="Product"] turbo-frame#has_many_field_show_collections {
  padding: 1rem 1.2rem;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
