/**
 * Admin CSS
 *
 * This file is used to add styles to the admin pages of each custom post type.
 *
 * @link       https://www.wpdispensary.com
 * @since      1.0.0
 *
 * @package    WP_Dispensary
 * @subpackage WP_Dispensary/admin/css
 */

/** Metaboxes */

div#wp_dispensary_product_prices .inside,
div#wp_dispensary_product_details .inside,
div#wp_dispensary_compound_details .inside,
div#wp_dispensary_grower_details .inside {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

div#wp_dispensary_product_details .inside .flowers-fields,
div#wp_dispensary_product_details .inside .concentrates-fields,
div#wp_dispensary_product_details .inside .edibles-fields,
div#wp_dispensary_product_details .inside .prerolls-fields,
div#wp_dispensary_product_details .inside .topicals-fields,
div#wp_dispensary_product_details .inside .growers-fields,
div#wp_dispensary_product_details .inside .tinctures-fields {
  flex-basis: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

div#wp_dispensary_product_prices .inside div.input-field,
div#wp_dispensary_product_details .inside div.input-field,
div#wp_dispensary_compound_details .inside div.input-field,
div#wp_dispensary_grower_details .inside div.input-field {
  margin-bottom: 12px;
  flex: 1;
}

div#wp_dispensary_product_prices .inside div.input-field.flower-price,
div#wp_dispensary_compound_details .inside div.input-field {
  flex: 1;
}

div#wp_dispensary_grower_details .inside div.input-field {
  flex: 1;
}

/** Metaboxes `select` width */

select#selected_flowers,
select#selected_concentrates,
select#selected_edibles,
select#selected_prerolls,
select#selected_topicals,
select#selected_growers,
select#selected_gear,
select#selected_tinctures {
  width: 100%;
}

/** Dashboard icons */

#dashboard_right_now .products-count a::before,
#dashboard_right_now .products-count span::before,
#dashboard_right_now .coupons-count a::before,
#dashboard_right_now .coupons-count span::before,
#dashboard_right_now .wpd_orders-count a::before,
#dashboard_right_now .wpd_orders-count span::before {
  background: url(../images/glance-icon.png) no-repeat 2px 0px;
  content: '';
  height: 20px;
  padding-right: 25px;
}

.toplevel_page_wpdispensary #adminmenu div.wp-menu-image::before {
  background: url(../images/menu-icon.png) no-repeat 2px 0px;
  content: '';
  height: 36px;
  padding-right: 36px;
}

.menu-top .toplevel_page_wpd-settings .wp-menu-image.dashicons-before {
  background: url(../images/menu-icon.png) no-repeat center center;
  opacity: 0.6;
}

#toplevel_page_wpd-settings:hover .wp-menu-image.dashicons-before,
.current.menu-top .toplevel_page_wpd-settings .wp-menu-image.dashicons-before {
  background: url(../images/menu-icon.png) no-repeat center center;
  opacity: 1;
}

/** WPD Settings */

body.toplevel_page_wpd-settings .nav-tab {
  background: transparent;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #fff;
  color: #7e8993;
}

body.toplevel_page_wpd-settings .nav-tab-active,
body.toplevel_page_wpd-settings .nav-tab-active:focus,
body.toplevel_page_wpd-settings .nav-tab-active:focus:active,
body.toplevel_page_wpd-settings .nav-tab-active:hover {
  background: #fff;
  border-bottom: 1px solid #fff;
  border-top: 1px solid #ccc;
  border-left: 1px solid #ccc;
  border-right: 1px solid #ccc;
  color: #000;
}

/**
 * Featured image in menu items list
 */
th#featured_thumb {
  width: 40px;
  text-align: center;
}

.manage-column.column-featured_thumb {
  text-align: center;
}

#featured_thumb span.wpd-admin-screen-featured-image-title,
.wpd-admin-screen-featured-image-title {
  display: none;
}

/**
 * Settings page
 */
.wpd-settings-wrap img {
  width: 300px;
  max-width: 300px;
}

.wpd-settings-separator {
  background: #ccc;
  border: 0;
  color: #ccc;
  height: 1px;
  position: absolute;
  left: 0;
  width: 100%;
  max-width: 100%;
}

.metabox-holder .group form h2:first-of-type {
  display: none;
}

.metabox-holder .group .form-table h1 {
  font-weight: 600;
  font-size: 18px;
  padding: 0;
}

.metabox-holder .group .form-table h1::after {
  content: '';
  display: block;
  clear: both;
  width: 24px;
  height: 3px;
  background: #ccc;
  margin-top: 0px;
}

.wrap.wpd-settings-wrap {
  position: relative;
}

.wrap.wpd-settings-wrap h1.settings-logo {
  position: relative;
}

.wrap.wpd-settings-wrap span.wpd-settings-version {
  color: #aaa;
  font-size: 50%;
  margin-left: 10px;
  position: absolute;
  top: 23px;
}

.metabox-holder .group form select {
  min-width: 25em;
}

.group .form-table input.color-picker {
  max-width: 100px;
}

@media screen and (max-width: 782px) {
  .pricebox input[type=number] {
    height: auto;
  }
}

/* Widget styles
-------------------------------------------------------------- */

div.widget[id*=_wp_dispensary_] .widget-top,
div.widget[id*=_wp_dispensary_] .widget-top:hover {
  border-color: #76bd43;
}

div.widget[id*=_wp_dispensary_] .widget-title,
div.widget[id*=_wp_dispensary_] .widget-title h3 {
  background: #76bd43;
  color: #fff;
}

div.widget[id*=_wp_dispensary_] .widget-title .in-widget-title {
  color: rgba(255,255,255,0.6);
}

div.widget[id*=_wp_dispensary_] .widget-action {
  color: #fff;
}

/* View All screen (mobile table layout)
-------------------------------------------------------------- */

@media screen and (max-width: 782px) {
  .wp-list-table tr.type-products:not(.inline-edit-row):not(.no-items) td:not(.check-column) {
    display: table-cell;
  }

  .wp-list-table tr:not(.inline-edit-row):not(.no-items) td.featured_thumb:not(.column-primary)::before {
    display: none;
  }
}

/** Admin post type screens
-------------------------------------------------------------- */

body.post-type-products,
body.post-type-wpd_orders,
body.post-type-coupons,
body.taxonomy-locations,
body.taxonomy-vendors,
body.taxonomy-wpd_categories,
body.taxonomy-strain_types,
body.taxonomy-shelf_types,
body.toplevel_page_wpd-settings,
.wp-dispensary_page_wpd-inventory {
  background: #fff;
}

body.post-type-products table.posts,
body.post-type-wpd_orders table.posts,
body.post-type-coupons table.posts,
body.taxonomy-locations table.posts,
body.taxonomy-vendors table.posts,
body.taxonomy-wpd_categories table.posts,
body.taxonomy-strain_types table.posts,
body.taxonomy-shelf_types table.posts {
  margin-top: 12px;
}

body.post-type-products table thead,
body.post-type-products table tfoot,
body.post-type-wpd_orders table thead,
body.post-type-wpd_orders table tfoot,
body.post-type-coupons table thead,
body.post-type-coupons table tfoot,
body.taxonomy-locations table thead,
body.taxonomy-locations table tfoot,
body.taxonomy-vendors table thead,
body.taxonomy-vendors table tfoot,
body.taxonomy-wpd_categories table thead,
body.taxonomy-wpd_categories table tfoot,
body.taxonomy-strain_types table thead,
body.taxonomy-strain_types table tfoot,
body.taxonomy-shelf_types table thead,
body.taxonomy-shelf_types table tfoot {
  background: #f7f7f7;
}

body.post-type-products .alternate,
body.post-type-products .striped>tbody>:nth-child(odd),
body.post-type-products ul.striped>:nth-child(odd),
body.post-type-wpd_orders .alternate,
body.post-type-wpd_orders .striped>tbody>:nth-child(odd),
body.post-type-wpd_orders ul.striped>:nth-child(odd),
body.post-type-coupons .alternate,
body.post-type-coupons .striped>tbody>:nth-child(odd),
body.post-type-coupons ul.striped>:nth-child(odd),
body.taxonomy-locations .alternate,
body.taxonomy-locations .striped>tbody>:nth-child(odd),
body.taxonomy-locations ul.striped>:nth-child(odd),
body.taxonomy-vendors .alternate,
body.taxonomy-vendors .striped>tbody>:nth-child(odd),
body.taxonomy-vendors ul.striped>:nth-child(odd),
body.taxonomy-wpd_categories .alternate,
body.taxonomy-wpd_categories .striped>tbody>:nth-child(odd),
body.taxonomy-wpd_categories ul.striped>:nth-child(odd),
body.taxonomy-strain_types .alternate,
body.taxonomy-strain_types .striped>tbody>:nth-child(odd),
body.taxonomy-strain_types ul.striped>:nth-child(odd),
body.taxonomy-shelf_types .alternate,
body.taxonomy-shelf_types .striped>tbody>:nth-child(odd),
body.taxonomy-shelf_types ul.striped>:nth-child(odd) {
  background: #fff;
}

tr.type-products td, tr.type-flowers th,
tr.type-wpd_orders td, tr.type-wpd_orders th,
tr.type-coupons td, tr.type-coupons th {
  border-bottom: 1px solid #ddd;
}

body.post-type-products .search-box input[type="search"],
body.post-type-wpd_orders .search-box input[type="search"],
body.post-type-coupons .search-box input[type="search"],
body.taxonomy-locations .search-box input[type="search"],
body.taxonomy-vendors .search-box input[type="search"],
body.taxonomy-wpd_categories .search-box input[type="search"],
body.taxonomy-strain_types .search-box input[type="search"],
body.taxonomy-shelf_types .search-box input[type="search"] {
  min-height: 26px;
  line-height: 1.92;
}

ul#adminmenu a.toplevel_page_wpd-settings.wp-has-current-submenu::after {
  border-right-color: #fff;
}

/** Admin toolbar menu items
-------------------------------------------------------------- */

body.wp-admin #wp-admin-bar-wp_dispensary a::before {
  content: '';
  background: url(../images/menu-icon.png) no-repeat center center !important;
  width: 32px;
  height: 32px;
  padding: 0 !important;
  display: block;
  margin-right: 0 !important;
}

body.wp-admin #wp-admin-bar-wp_dispensary .ab-sub-wrapper a::before {
  display: none !important;
}
