/**
 * Admin styles for Gozer
 *
 * @package Gozer
 * @since   1.0.0
 */

/* ==========================================================================
   Brand color variable
   ========================================================================== */

:root {
	--gozer-brand: #2271b1;
}

/* ==========================================================================
   Two column grid layout
   ========================================================================== */

.gozer-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	margin: 20px 0;
}

.gozer-column {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

/* Responsive: single column on smaller screens */
@media (max-width: 1280px) {
	.gozer-grid {
		grid-template-columns: 1fr;
	}
}

/* ==========================================================================
   Section styling
   ========================================================================== */

.gozer-section {
	background: #fff;
	border: 1px solid #c3c4c7;
	padding: 20px;
	margin-bottom: 20px;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.gozer-section h2 {
	margin: 0 0 5px;
	padding: 0 0 10px;
	border-bottom: 1px solid #dcdcde;
	font-size: 16px;
	font-weight: 600;
}

.gozer-section > .description {
	margin: 0 0 15px;
	color: #646970;
}

/* ==========================================================================
   Option rows with hover effect
   ========================================================================== */

.gozer-option {
	display: block;
	padding: 12px 10px;
	margin: 0 -10px;
	border-bottom: 1px solid #f0f0f1;
	cursor: pointer;
}

.gozer-option:hover {
	background-color: #f6f7f7;
}

.gozer-option:last-of-type {
	border-bottom: none;
}

.gozer-option input[type="checkbox"] {
	margin-right: 10px;
	vertical-align: middle;
}

.gozer-option strong {
	vertical-align: middle;
}

.gozer-option .description {
	display: block;
	margin: 5px 0 0 26px;
	color: #646970;
	font-size: 13px;
}

/* ==========================================================================
   Default value indicator
   ========================================================================== */

.gozer-default {
	display: block;
	margin: 8px 0 0 26px;
	padding: 4px 8px;
	background: #f6f7f7;
	border-radius: 3px;
	font-size: 12px;
	color: #50575e;
	font-style: italic;
}

.gozer-default strong {
	color: #1d2327;
	font-weight: 600;
}

/* Warning style */
.gozer-warning {
	border-left: 3px solid #d63638;
}

/* ==========================================================================
   Redirect options
   ========================================================================== */

.gozer-redirect-options label {
	display: block;
	padding: 10px 0;
	border-bottom: 1px solid #f0f0f1;
}

.gozer-redirect-options label:last-child {
	border-bottom: none;
}

.gozer-redirect-options .description {
	display: block;
	margin: 5px 0 0 24px;
	color: #646970;
	font-size: 13px;
}

/* ==========================================================================
   Custom exceptions fields - 3 column grid
   ========================================================================== */

.gozer-custom-fields {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
}

@media (max-width: 1280px) {
	.gozer-custom-fields {
		grid-template-columns: 1fr;
	}
}

.gozer-field label {
	display: block;
	margin-bottom: 8px;
}

.gozer-field textarea {
	font-family: Consolas, Monaco, monospace;
	font-size: 13px;
	line-height: 1.6;
}

/* ==========================================================================
   Form table adjustments
   ========================================================================== */

.gozer-section .form-table {
	margin: 0;
}

.gozer-section .form-table th {
	padding: 15px 10px 15px 0;
	font-weight: 600;
	width: 200px;
}

.gozer-section .form-table td {
	padding: 15px 0;
}

/* ==========================================================================
   Token generator
   ========================================================================== */

.gozer-token-generator {
	margin: 15px 0;
	padding: 15px;
	background: #f6f7f7;
	border-radius: 4px;
}

.gozer-token-form {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.gozer-token-form label {
	font-weight: 500;
}

.gozer-token-form select,
.gozer-token-form input[type="text"] {
	margin-right: 10px;
}

.gozer-token-form input[type="text"] {
	min-width: 200px;
}

/* ==========================================================================
   Tokens table - Improved layout
   ========================================================================== */

.gozer-tokens-table {
	margin-top: 15px;
	table-layout: fixed;
}

/* Column widths */
.gozer-tokens-table .gozer-col-link {
	width: 45%;
}

.gozer-tokens-table .gozer-col-note {
	width: 20%;
}

.gozer-tokens-table .gozer-col-expires {
	width: 12%;
}

.gozer-tokens-table .gozer-col-actions {
	width: 23%;
}

/* Token URL styling - allow wrapping */
.gozer-tokens-table .gozer-token-url {
	font-size: 12px;
	display: block;
	word-break: break-all;
	white-space: normal;
	background: #f6f7f7;
	padding: 6px 8px;
	border-radius: 3px;
}

/* Actions column buttons */
.gozer-tokens-table .gozer-col-actions .button {
	margin-right: 5px;
}

.gozer-tokens-table .gozer-col-actions .button:last-child {
	margin-right: 0;
}

.gozer-no-tokens {
	color: #646970;
	font-style: italic;
	margin: 15px 0;
}

/* ==========================================================================
   Promotional notice - Plugin install boxes (rotative banner)
   ========================================================================== */

.gozer-promo-notice {
	background: #f6f7f7;
	border: 1px solid #c3c4c7;
	padding: 20px;
	margin-top: 10px;
}

.gozer-promo-notice > h4 {
	margin: 0 0 20px;
	font-size: 15px;
	font-weight: 600;
	color: #1d2327;
}

.gozer-promo-columns {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 25px;
}

.gozer-promo-column {
	background: #fff;
	border: 1px solid #dcdcde;
	padding: 20px;
	display: flex;
	flex-direction: column;
}

.gozer-promo-column > .dashicons {
	font-size: 28px;
	width: 28px;
	height: 28px;
	color: var(--gozer-brand, #2271b1);
	margin-bottom: 12px;
}

.gozer-promo-column h5 {
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
	line-height: 1.4;
}

.gozer-promo-column p {
	margin: 0 0 15px;
	color: #50575e;
	font-size: 13px;
	line-height: 1.5;
	flex-grow: 1;
}

.gozer-promo-notice .gozer-promo-column .button {
	align-self: flex-start;
	margin-top: auto;
	white-space: normal;
	height: auto;
	min-height: auto;
	line-height: 1.4;
	padding: 6px 12px;
	text-align: center;
}

/* Responsive: 2 columns on medium screens */
@media screen and (max-width: 1200px) {
	.gozer-promo-columns {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* Responsive: 1 column on mobile */
@media screen and (max-width: 782px) {
	.gozer-promo-columns {
		grid-template-columns: 1fr;
	}
}

/* ==========================================================================
   Responsive adjustments
   ========================================================================== */

@media (max-width: 782px) {
	.gozer-token-form {
		flex-direction: column;
		align-items: stretch;
	}

	.gozer-token-form input[type="text"] {
		min-width: 0;
		width: 100%;
	}

	/* Tokens table responsive */
	.gozer-tokens-table .gozer-col-link {
		width: 40%;
	}

	.gozer-tokens-table .gozer-col-note {
		width: 18%;
	}

	.gozer-tokens-table .gozer-col-expires {
		width: 15%;
	}

	.gozer-tokens-table .gozer-col-actions {
		width: 27%;
	}

	.gozer-tokens-table .gozer-col-actions .button {
		display: block;
		margin-bottom: 5px;
		margin-right: 0;
		width: 100%;
		text-align: center;
	}

	.gozer-tokens-table .gozer-col-actions .button:last-child {
		margin-bottom: 0;
	}

	/* Form table */
	.gozer-section .form-table th {
		width: auto;
		padding-bottom: 5px;
	}

	.gozer-section .form-table td {
		padding-top: 0;
	}
}

/* Very small screens - stack table */
@media (max-width: 600px) {
	.gozer-tokens-table,
	.gozer-tokens-table thead,
	.gozer-tokens-table tbody,
	.gozer-tokens-table th,
	.gozer-tokens-table td,
	.gozer-tokens-table tr {
		display: block;
	}

	.gozer-tokens-table thead tr {
		position: absolute;
		top: -9999px;
		left: -9999px;
	}

	.gozer-tokens-table tr {
		border: 1px solid #c3c4c7;
		margin-bottom: 10px;
		background: #fff;
	}

	.gozer-tokens-table td {
		border: none;
		border-bottom: 1px solid #f0f0f1;
		position: relative;
		padding: 10px;
		width: auto !important;
	}

	.gozer-tokens-table td:last-child {
		border-bottom: none;
	}

	.gozer-tokens-table td::before {
		content: attr(data-label);
		font-weight: 600;
		display: block;
		margin-bottom: 5px;
		color: #1d2327;
	}

	.gozer-tokens-table .gozer-col-actions .button {
		display: inline-block;
		width: auto;
		margin-right: 5px;
	}
}