/* ==========================================================================
   table.css loads on any Envira WP_List_Table Screen:
   - Galleries
   - Albums

   Any styles that will be used by these list tables should be added to this 
   file:
   - Quick Edit
   ========================================================================== */

/* ==========================================================================
   Imports
   ========================================================================== */
@import "vars";
@import "mixins";

body.post-type-envira,
body.post-type-envira_album {
	/* ==========================================================================
	   Post Filters
	   ========================================================================== */
	ul.subsubsub {
		/**
		* Re-establish the left and right margins, so there's spacing between the Admin Menu
		* and the content
		*/
		margin: 0 0 20px 0;
		padding-left: 20px;
	}
	//make our image col smaller
	.column-image{
		width: 85px !important;	
	}
	/* ==========================================================================
	   Post Table Form
	   ========================================================================== */
	form#posts-filter {
		/**
		* Re-establish the left and right margins, so there's spacing between the Admin Menu
		* and the content
		*/
		margin: 0 20px;

		/**
		* Table Navigation (Bulk Actions, Dates, SEO Score dropdowns etc)
		*/
		div.tablenav.top {
			margin: 0 0 8px 0;
		}

		/**
		* Reduce our global custom button sizes so they align with inputs
		*/
		.button {
			height: 28px;
			line-height: 26px;
		}
	}

	/* ==========================================================================
   	Quick Edit
   	========================================================================== */
	#wpbody-content {
		
		td.colspanchange {
			/**
			* Left Col (Title, Slug, Date, Password)
			*/
			fieldset.inline-edit-col-left {
				width: 40%;

				fieldset.inline-edit-date {
					display: none;
				}
				div.inline-edit-group:last-child {
					display: none;
				}
			}

			/**
			* Category Column
			*/ 
			fieldset.inline-edit-col-center.inline-edit-categories {
				display: none;
			}

			/**
			* Right Column (Comments + Status)
			*/
			fieldset.inline-edit-col-right {
				margin: 30px 0 0 0;

				label.inline-edit-status.alignleft {
					width: 100%;
				}
			}
			
			/**
			* Envira Gallery Col
			*/
			fieldset.inline-edit-col-right,
			fieldset.inline-edit-envira-gallery {
				width: 60%; /* Fill the remainder of the width */

				.inline-edit-group {
					clear: none;
					float: left;
					width: 50%;

					/**
					* Label
					*/
					span.title {
						width: 40%;
						padding-right: 0.5em;
					}

					/**
					* Inputs
					*/
					input[type=number] {
						width: 60px;
						line-height: normal;
					}
				}
			}

			/**
			* Submit
			*/
			p.submit.inline-edit-save {
				margin-bottom: 20px;
			}
		}
		
	}
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media screen and (max-width: 940px) {
	body.post-type-envira,
	body.post-type-envira_album {

		/* ==========================================================================
		   Quick Edit
		   ========================================================================== */
		#wpbody-content {
			td.colspanchange {
				fieldset.inline-edit-col-left
				fieldset.inline-edit-col-right,
				fieldset.inline-edit-envira-gallery {
					clear: both;
					width: 100%;

					.inline-edit-group {
						clear: both;
						float: left;
						width: 100%;

						/**
						* Label
						*/
						span.title {
							width: 100%;
						}
					}
				}
			}
			
		}

		/* ==========================================================================
		   Search Box
		   ========================================================================== */
		p.search-box {
			width: 94%;
		}
	}
}

/* ==========================================================================
   Empty State Styles
   ========================================================================== */
.envira-empty-state {
	background: #fff;
	border-radius: 4px;
	margin: 30px 50px 0 50px !important;
	height: 480px;
	box-sizing: border-box;
}

.envira-empty-state-content {
	display: flex;
	align-items: center;
}

.envira-empty-state-left {
	flex: 1;
	max-width: 55%;
	margin-left: 80px;
}

.envira-empty-state-left p,
.envira-empty-state-left h2 {
	margin: 0 !important;
}

.envira-empty-state-right {
	flex: 1;
	max-width: 45%;
	display: flex;
	justify-content: flex-end;
}

.envira-empty-state-left-content {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 48px;
}

.envira-empty-state-greeting {
	font-size: 24px;
	font-weight: 500;
	color: #1e1e1e;
	line-height: 22px;
}

.envira-empty-state-title {
	font-size: 16px;
	font-weight: 600;
	color: #2d3337;
	line-height: 22px;
}

.envira-empty-state-description {
	font-size: 16px;
	color: #2d3337;
	line-height: 22px;
}

.envira-empty-state-actions {
	margin-bottom: 24px;
}

/* Override admin.scss button styles for empty state button */
body.post-type-envira .envira-empty-state-button,
body.post-type-envira_album .envira-empty-state-button {
	font-size: 16px !important;
	font-weight: 600 !important;
	height: 56px !important;
	padding: 16px 20px !important;
	border-radius: 6px !important;
	display: inline-flex !important;
	align-items: center !important;
	gap: 16px !important;
	background-color: #00ad54 !important;
	border-color: #00ad54 !important;
	color: #fff !important;
	-webkit-box-shadow: none !important;
	box-shadow: none !important;
	line-height: normal !important;
}

body.post-type-envira .envira-empty-state-button:hover,
body.post-type-envira_album .envira-empty-state-button:hover {
	background-color: #00ad54 !important;
	border-color: #00ad54 !important;
	color: #fff !important;
}

.envira-button-arrow {
	font-size: 18px;
	line-height: 1;
}

.envira-empty-state-help {
	font-size: 14px;
	color: #2d3337;
	font-weight: 500;
	line-height: 20px;
}

.envira-empty-state-help a {
	color: #00ad54;
	text-decoration: underline;
}

.envira-empty-state-help a:hover {
	color: #01c761;
}

.envira-empty-state-image {
	width: 466px;
	height: 480px;
	display: block;
	object-fit: contain;
	margin-left: auto;
}

/* Responsive styles for empty state */
@media screen and (max-width: 1024px) {
	.envira-empty-state {
		height: auto;
	}
	.envira-empty-state-content {
		flex-direction: column;
		gap: 30px;
	}

	.envira-empty-state-left {
		max-width: 100%;
		text-align: center;
		padding: 30px;
		margin-left: 0;
	}

	.envira-empty-state-right {
		max-width: 100%;
	}

	.envira-empty-state-title {
		font-size: 24px;
	}
}

@media screen and (max-width: 768px) {
	.envira-empty-state-image {
		width: 100%;
	}
}

/* Position empty state correctly when shown */
body.post-type-envira.envira-empty-state-active #wpbody-content,
body.post-type-envira:has(.envira-empty-state) #wpbody-content {
	padding-top: 0;
}

body.post-type-envira.envira-empty-state-active .envira-empty-state,
body.post-type-envira:has(.envira-empty-state) .envira-empty-state {
	margin-left: auto;
	margin-right: auto;
}

/* Hide table, Add New button, and related elements when empty state is shown */
body.post-type-envira:has(.envira-empty-state) .wp-list-table,
body.post-type-envira:has(.envira-empty-state) form#posts-filter,
body.post-type-envira:has(.envira-empty-state) .tablenav,
body.post-type-envira:has(.envira-empty-state) .page-title-action,
body.post-type-envira:has(.envira-empty-state) .wp-header-end,
body.post-type-envira:has(.envira-empty-state) .subsubsub,
body.post-type-envira:has(.envira-empty-state) .wrap .wp-heading-inline + .page-title-action,
body.post-type-envira:has(.envira-empty-state) .wp-heading-inline,
body.post-type-envira:has(.envira-empty-state) h1.wp-heading-inline,
body.post-type-envira:has(.envira-empty-state) .subheading,
body.post-type-envira:has(.envira-empty-state) .subheading h1 {
	display: none !important;
}

/* Fallback for browsers that don't support :has() - use JavaScript detection */
body.post-type-envira.envira-empty-state-active .wp-list-table,
body.post-type-envira.envira-empty-state-active form#posts-filter,
body.post-type-envira.envira-empty-state-active .tablenav,
body.post-type-envira.envira-empty-state-active .page-title-action,
body.post-type-envira.envira-empty-state-active .wp-header-end,
body.post-type-envira.envira-empty-state-active .subsubsub,
body.post-type-envira.envira-empty-state-active .wrap .wp-heading-inline + .page-title-action,
body.post-type-envira.envira-empty-state-active .wp-heading-inline,
body.post-type-envira.envira-empty-state-active h1.wp-heading-inline,
body.post-type-envira.envira-empty-state-active .subheading,
body.post-type-envira.envira-empty-state-active .subheading h1 {
	display: none !important;
}