/* Rubmaster admin styles
 * Owned & created by Gerald Woodgate, Golden Apple Corps Ltd.
 */

.rubmaster-brand { margin-bottom: 4px; }
.rubmaster-brand h1 .dashicons { font-size: 28px; width: 28px; height: 28px; vertical-align: text-bottom; color: #b5651d; }
.rubmaster-credit { margin: 2px 0 16px; color: #646970; font-size: 12px; }
.rubmaster-credit a { color: #b5651d; }

.rubmaster-grid {
	display: grid;
	grid-template-columns: minmax(320px, 1fr) minmax(360px, 1.4fr);
	gap: 20px;
	align-items: start;
}
@media (max-width: 1100px) { .rubmaster-grid { grid-template-columns: 1fr; } }

.rubmaster-card {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	padding: 18px 20px;
	box-shadow: 0 1px 1px rgba(0,0,0,.04);
}
.rubmaster-card-wide { grid-column: 1 / -1; }
@media (max-width: 1100px) { .rubmaster-card-wide { grid-column: auto; } }
.rubmaster-card h2 { margin-top: 0; }

.rubmaster-form label { display: block; margin-bottom: 4px; }
.rubmaster-field { margin: 0 0 14px; }
.rubmaster-form input[type="text"],
.rubmaster-form input[type="number"],
.rubmaster-form input.rubmaster-choice { max-width: 100%; }
.rubmaster-form input.regular-text { display: block; width: 100%; box-sizing: border-box; }

/* Hybrid combobox (type to filter, or open the dropdown to browse) */
.rubmaster-combo { position: relative; }
.rubmaster-combo input.rubmaster-choice { width: 100%; box-sizing: border-box; padding-right: 28px; }
.rubmaster-combo-arrow { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid #888; pointer-events: none; }
.rubmaster-combo.is-open .rubmaster-combo-arrow { transform: translateY(-50%) rotate(180deg); }
.rubmaster-combo-list { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin: 3px 0 0; padding: 4px 0; max-height: 260px; overflow-y: auto; list-style: none; background: #fff; border: 1px solid #c9c9c9; border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,0.12); }
.rubmaster-combo-list[hidden] { display: none; }
.rubmaster-combo-header { padding: 7px 12px 2px; font-weight: 700; font-size: 12px; color: #555; }
.rubmaster-combo-option { padding: 6px 14px; cursor: pointer; font-size: 14px; }
.rubmaster-combo-option:hover, .rubmaster-combo-option.is-active { background: #f0ece4; }
.rubmaster-combo-empty { padding: 8px 14px; color: #999; font-style: italic; }

.rubmaster-actions { margin-top: 14px; }
.rubmaster-actions .button { margin-right: 8px; }

.rubmaster-message { margin-top: 12px; padding: 0; font-weight: 600; }
.rubmaster-message.is-success { color: #007017; }
.rubmaster-message.is-error { color: #b32d2e; }

.rubmaster-table { margin-top: 8px; }
.rubmaster-col-actions { width: 150px; }
.rubmaster-col-actions .button { margin-right: 6px; }
.button-link-delete { color: #b32d2e; }

/* Ingredient editor */
.rubmaster-ingredients { margin: 8px 0; }
.rubmaster-ingredient-row {
	display: grid;
	grid-template-columns: 1fr 110px 150px 40px;
	gap: 8px;
	margin-bottom: 8px;
	align-items: center;
}
@media (max-width: 600px) {
	.rubmaster-ingredient-row { grid-template-columns: 1fr 1fr; }
}
.rubmaster-ingredient-row input,
.rubmaster-ingredient-row select { width: 100%; max-width: 100%; margin: 0; }
.rubmaster-remove { color: #b32d2e; font-size: 16px; line-height: 1; }

/* Calculator results */
.rubmaster-placeholder { color: #646970; }
.rubmaster-summary { font-size: 14px; }

.rubmaster-result-card {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	background: #f6f7f7;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 12px 16px;
}
.rubmaster-result-label { font-weight: 600; color: #1d2327; }
.rubmaster-result-value { font-size: 18px; font-weight: 700; color: #1d2327; white-space: nowrap; }

.rubmaster-salt-card {
	background: linear-gradient(135deg, #2323ff, #1b1bc2);
	border: none;
	margin: 8px 0 18px;
	padding: 16px 20px;
}
.rubmaster-salt-card .rubmaster-result-label { color: #fff; font-size: 15px; }
.rubmaster-salt-card .rubmaster-result-value { color: #fff; font-size: 24px; }

.rubmaster-result-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 12px;
	margin-top: 8px;
}
.rubmaster-result-card.is-salt { border-color: #b5651d; box-shadow: inset 3px 0 0 #b5651d; }
.rubmaster-result-card.is-salt-faded { opacity: 0.45; }

/* Grid cards stack the spice name above its amount, so long names (e.g.
   "16 Mesh Cracked Black Pepper") don't squash or stretch the value. */
.rubmaster-result-grid .rubmaster-result-card { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 4px; }
.rubmaster-result-grid .rubmaster-result-label { font-size: 13px; line-height: 1.3; }
.rubmaster-result-grid .rubmaster-result-value { white-space: normal; }

.rubmaster-rub-desc {
	margin: 0 0 14px;
	font-style: italic;
	color: #50575e;
	max-width: 70ch;
}

/* Vertical ingredient list in the rubs table */
.rubmaster-ing-list { margin: 0; padding: 0; list-style: none; }
.rubmaster-ing-list li { padding: 2px 0; border-bottom: 1px solid #f0f0f1; }
.rubmaster-ing-list li:last-child { border-bottom: 0; }

/* Description char counter */
.rubmaster-charcount { display: block; margin-top: 2px; font-size: 11px; color: #8c8f94; }

/* Description shown under the rub name in the rubs list */
.rubmaster-table-desc { margin-top: 4px; font-style: italic; font-size: 12px; color: #646970; }

/* Rub Volume cut groups */
.rubmaster-cut-group { margin: 18px 0 6px; padding-bottom: 4px; border-bottom: 2px solid #b5651d; }
.rubmaster-cut-group:first-child { margin-top: 0; }

/* Calculator case banner (under / exact / over the cut budget) */
.rubmaster-case { padding: 9px 13px; border-radius: 6px; font-size: 13px; margin: 4px 0 14px; background: #f6f7f7; border: 1px solid #e0e0e0; color: #3c434a; }
.rubmaster-case.is-under, .rubmaster-case.is-exact { background: #edf7ed; border-color: #cfe8cf; color: #1e4620; }
.rubmaster-case.is-over { background: #fcf3e6; border-color: #f0d9b5; color: #7a4f12; }

/* Centered version footer */
.rubmaster-footer {
	text-align: center;
	font-size: 11px;
	color: #8c8f94;
	margin: 28px 0 8px;
}
.rubmaster-frontend .rubmaster-footer { margin-top: 24px; }

.rubmaster-total { margin-top: 16px; font-weight: 600; }

/* Front-end (shortcode) container */
.rubmaster-frontend { max-width: 1000px; margin: 0 auto; }
.rubmaster-frontend * { box-sizing: border-box; }
.rubmaster-frontend input[type="number"],
.rubmaster-frontend input[type="text"] { padding: 6px 8px; width: 100%; max-width: 320px; }
.rubmaster-frontend .rubmaster-card h2 { margin-top: 0; }
