/**
 * CJ's Brew & BBQ - Sausage Scaler
 * Version: 2.4.0 - Consolidated with brand-colors.css, unified red theme
 * Uses .cj-* class structure
 * UPDATED: Jan 8, 2026 - Changed to red buttons, 6px border-radius
 */

@import url('brand-colors.css');

/* Removed duplicate :root variables - now using brand-colors.css */

.cj-tool {
	font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, Inter, Arial, sans-serif;
	color: var(--cjbb-text);
	max-width: 1600px;
	margin: 0 auto;
	padding: 0 1rem;
}

.cj-head h2 {
	font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.4rem);
	margin: .25rem 0;
	text-align: center;
}

.cj-sub {
	color: var(--cjbb-text-muted);
	margin: 0 0 1.5rem;
	text-align: center;
	font-size: 1.05rem;
}

.cj-grid {
	display: grid;
	gap: 1.25rem;
	grid-template-columns: 1fr;
}

@media(min-width: 1200px) {
	.cj-grid {
		grid-template-columns: 480px 1fr;
	}
}

.cj-card {
	background: var(--cj-card);
	border: 1px solid var(--cjbb-border);
	border-radius: 16px;
	padding: 24px;
	box-shadow: var(--cj-shadow);
}

.cj-card h3 {
	margin: 0 0 1.25rem 0;
	font-size: 1.3rem;
	color: var(--cjbb-text);
}

.cj-field {
	margin: 1.25rem 0;
}

.cj-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.5rem;
	color: var(--cjbb-text);
	font-size: 0.9rem;
}

.cj-input {
	width: 100%;
	border: 1px solid var(--cjbb-border);
	border-radius: 10px;
	padding: 0.65rem 0.75rem;
	font-size: 1rem;
	transition: all 0.2s;
	background: white;
	font-family: inherit;
	box-sizing: border-box;
}

.cj-input:focus {
	outline: none;
	border-color: var(--cjbb-primary);
	box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

select.cj-input {
	appearance: none;
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
	background-position: right 0.75rem center;
	background-repeat: no-repeat;
	background-size: 1.5em 1.5em;
	padding-right: 3rem;
	cursor: pointer;
}

.cj-field-inline {
	display: flex;
	gap: 0.75rem;
	align-items: center;
	margin: 0.5rem 0;
}

.cj-field-inline label {
	flex: 0 0 auto;
	min-width: 140px;
	margin-bottom: 0;
}

.cj-field-inline .cj-input {
	flex: 1;
}

.cj-ratio-slider-container {
	margin: 1.5rem 0;
	padding: 1.25rem;
	background: linear-gradient(135deg, #fff5f0 0%, #ffe8d9 100%);
	border: 2px solid var(--cjbb-primary);
	border-radius: 12px;
}

.cj-ratio-slider-label {
	font-weight: 600;
	margin-bottom: 0.75rem;
	display: block;
	color: var(--cjbb-text);
	font-size: 0.9rem;
}

.cj-ratio-slider {
	width: 100%;
	height: 8px;
	border-radius: 4px;
	background: linear-gradient(to right, #f97316 0%, #ea580c 100%);
	outline: none;
	-webkit-appearance: none;
	appearance: none;
	margin: 1rem 0;
	cursor: pointer;
}

.cj-ratio-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: white;
	border: 3px solid var(--cjbb-primary);
	cursor: pointer;
	box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.cj-ratio-slider::-moz-range-thumb {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: white;
	border: 3px solid var(--cjbb-primary);
	cursor: pointer;
	box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.cj-ratio-display {
	text-align: center;
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--cj-secondary);
	margin-top: 0.5rem;
}

.cj-ratio-labels {
	display: flex;
	justify-content: space-between;
	font-size: 0.85rem;
	color: var(--cjbb-text-muted);
	margin-top: 0.5rem;
}

/* TABLE STYLES */

.cj-table-wrap {
	overflow-x: auto;
	margin: 1rem 0;
	border: 1px solid var(--cjbb-border);
	border-radius: 12px;
}

.cj-table {
	width: 100%;
	border-collapse: collapse;
	min-width: 700px;
}

.cj-table thead {
	background: #f9fafb;
}

.cj-table th {
	padding: 0.75rem;
	text-align: left;
	font-weight: 600;
	color: var(--cjbb-text);
	border-bottom: 2px solid var(--cjbb-border);
	font-size: 0.9rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.cj-table td {
	padding: 0.5rem 0.75rem;
	border-bottom: 1px solid #f3f4f6;
}

.cj-table tbody tr:hover {
	background: #fafafa;
}

.cj-table input, .cj-table select {
	width: 100%;
	padding: 0.4rem 0.5rem;
	border: 1px solid var(--cjbb-border);
	border-radius: 6px;
	font-size: 0.95rem;
	box-sizing: border-box;
}

.cj-table input:focus, .cj-table select:focus {
	outline: none;
	border-color: var(--cjbb-primary);
}

.cj-table th:nth-child(1), .cj-table td:nth-child(1) { width: 35%; }
.cj-table th:nth-child(2), .cj-table td:nth-child(2) { width: 10%; }
.cj-table th:nth-child(3), .cj-table td:nth-child(3) { width: 18%; }
.cj-table th:nth-child(4), .cj-table td:nth-child(4) { 
	width: 20%; 
	font-weight: 700; 
	color: #dc2626;
	font-size: 1.05rem;
}
.cj-table th:nth-child(5), .cj-table td:nth-child(5) { 
	width: 17%; 
	text-align: center; 
}

/* CATEGORY SECTIONS */

.cj-category-section {
	margin: 1.5rem 0;
	padding: 1rem;
	background: #f9fafb;
	border-radius: 12px;
	border-left: 4px solid var(--cjbb-primary);
}

.cj-category-title {
	font-weight: 700;
	color: var(--cj-secondary);
	margin-bottom: 0.75rem;
	font-size: 1.1rem;
}

.cj-meat-auto-note {
	font-size: 0.85rem;
	color: #92400e;
	background: #fffbeb;
	padding: 0.5rem 0.75rem;
	border-radius: 6px;
	margin: 0.5rem 0;
	border: 1px solid #fbbf24;
}

/* BUTTONS - Now using unified brand-colors.css */

.cj-btn {
	display: block;
	width: 100%;
	padding: 10.4px 20px;
	font-family: var(--cjbb-font-buttons);
	font-size: 15.2px;
	font-weight: 600;
	text-align: center;
	border: none;
	border-radius: var(--cjbb-border-radius); /* 6px instead of pill (999px) */
	cursor: pointer;
	transition: all 0.3s ease;
	background-color: transparent;
	color: var(--cjbb-text);
	margin-top: 1rem;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cj-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.cj-btn:active {
	transform: translateY(0);
}

.cj-secondary {
	background-color: var(--cjbb-secondary);
	color: var(--cjbb-text);
}

.cj-secondary:hover {
	background-color: #e9ecef;
}

.cj-btn-remove {
	background-color: var(--cjbb-danger);
	color: white;
	padding: 4px 8px;
	border-radius: 50%;
	font-size: 16px;
	font-weight: 700;
	border: none;
	cursor: pointer;
	transition: all 0.3s ease;
}

.cj-btn-remove:hover {
	background-color: #c0392b;
	transform: scale(1.1);
}

.cj-remove {
	background-color: var(--cjbb-danger);
	color: white;
	border: none;
	border-radius: var(--cjbb-border-radius);
	padding: 0.35rem 0.75rem;
	cursor: pointer;
	font-size: 0.85rem;
	font-weight: 600;
	transition: all 0.3s ease;
}

.cj-remove:hover {
	background-color: #c0392b;
	transform: translateY(-1px);
}

.cj-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1rem;
}

/* SUMMARY/RESULTS */

.cj-summary {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 1rem;
	padding: 1rem;
	background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
	border: 2px solid var(--cjbb-primary);
	border-radius: 12px;
	margin: 1.5rem 0;
}

.cj-summary-item {
	text-align: center;
}

.cj-summary-label {
	font-size: 0.85rem;
	color: #92400e;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.cj-summary-value {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--cjbb-text);
	margin-top: 0.25rem;
}

.cj-summary-subtitle {
	font-size: 0.8rem;
	color: var(--cjbb-text-muted);
	margin-top: 0.25rem;
}

/* HIDE CLASS */

.cj-hide {
	display: none !important;
}

/* ==========================================
   v2.3.0 ADDITIONS
   3-Column Summary, Smaller Buttons, Preload Notice
   ========================================== */

/* 3-COLUMN SUMMARY CARD */
.cj-summary-3col {
	grid-template-columns: repeat(3, 1fr);
}

/* 3-COLUMN ACTIONS */
.cj-actions-3col {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0.5rem;
	margin-top: 1rem;
}

/* SMALLER BUTTONS */
.cj-btn-sm {
	padding: 8px 16px;
	font-size: 13.6px;
	margin-top: 0;
}

.cj-btn-primary {
	background-color: var(--cjbb-primary); /* #E63946 red */
	color: white;
}

.cj-btn-primary:hover {
	background-color: var(--cjbb-accent); /* #d42835 darker red */
	box-shadow: 0 4px 12px rgba(230, 57, 70, 0.3);
}

.cj-btn-secondary {
	background-color: var(--cjbb-secondary);
	color: var(--cjbb-text);
}

.cj-btn-secondary:hover {
	background-color: #e9ecef;
}

/* DELETE BUTTON (TRASH ICON) */
.cj-btn-delete-sm {
	background-color: var(--cjbb-danger);
	color: white;
	border: none;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	font-size: 18px;
	cursor: pointer;
	transition: all 0.3s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	margin: 0;
}

.cj-btn-delete-sm:hover {
	background-color: #c0392b;
	transform: scale(1.1) rotate(15deg);
	box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* PRELOAD NOTICE */
.cj-preload-notice {
	background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
	border: 2px solid #10b981;
	border-radius: 8px;
	padding: 0.75rem 1rem;
	margin: 1rem 0;
	text-align: center;
	color: #065f46;
	font-size: 0.95rem;
}

.cj-preload-notice strong {
	color: #047857;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
	.cj-tool {
		padding: 0 0.5rem;
	}

	.cj-card {
		padding: 12px;
	}

	.cj-head h2 {
		font-size: 1.5rem;
	}

	.cj-sub {
		font-size: 0.95rem;
	}

	.cj-field-inline {
		flex-direction: column;
		align-items: stretch;
	}
	
	.cj-field-inline label {
		min-width: auto;
	}
	
	.cj-field-inline .cj-input {
		max-width: none;
	}

	.cj-table-wrap {
		margin: 0.75rem 0;
		border: none;
		border-radius: 0;
	}

	.cj-table {
		min-width: 100%;
		font-size: 0.9rem;
	}

	.cj-table thead {
		display: none;
	}

	.cj-table tbody {
		display: block;
	}

	.cj-table tr {
		display: flex;
		flex-direction: column;
		margin-bottom: 0.75rem;
		border: 2px solid var(--cjbb-border);
		border-radius: 12px;
		padding: 0;
		background: white;
		box-shadow: 0 2px 4px rgba(0,0,0,0.05);
		overflow: hidden;
	}

	.cj-table td {
		display: block;
		padding: 0;
		border: none;
		width: 100%;
	}

	.cj-table td:nth-child(1) {
		background: linear-gradient(135deg, #fff5f0 0%, #ffe8d9 100%);
		border-bottom: 2px solid var(--cjbb-border);
		padding: 0.85rem;
		width: 100%;
	}

	.cj-table td:nth-child(1) input {
		font-weight: 600;
		font-size: 1.05rem;
		border: 2px solid #f97316;
		background: white;
		padding: 0.65rem;
		width: 100%;
		color: var(--cjbb-text);
		border-radius: 8px;
		box-shadow: 0 1px 2px rgba(0,0,0,0.05);
		transition: all 0.2s;
	}

	.cj-table td:nth-child(1) input:focus {
		outline: none;
		border-color: #ea580c;
		box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
	}

	.cj-table td:nth-child(2),
	.cj-table td:nth-child(3) {
		display: inline-block;
		vertical-align: top;
		box-sizing: border-box;
		padding: 0.85rem;
	}

	.cj-table td:nth-child(2) {
		width: 60%;
		padding-right: 0.5rem;
		border-right: none;
	}

	.cj-table td:nth-child(3) {
		width: 40%;
		padding-left: 0.5rem;
	}

	.cj-table td:nth-child(2):before {
		content: "Amount";
		display: block;
		font-size: 0.7rem;
		font-weight: 600;
		color: var(--cjbb-text-muted);
		text-transform: uppercase;
		margin-bottom: 0.5rem;
		letter-spacing: 0.5px;
	}

	.cj-table td:nth-child(3):before {
		content: "Unit";
		display: block;
		font-size: 0.7rem;
		font-weight: 600;
		color: var(--cjbb-text-muted);
		text-transform: uppercase;
		margin-bottom: 0.5rem;
		letter-spacing: 0.5px;
	}

	.cj-table td:nth-child(2) input,
	.cj-table td:nth-child(3) select {
		width: 100%;
		font-size: 1.05rem;
		padding: 0.5rem;
		box-sizing: border-box;
	}

	.cj-table td:nth-child(4) {
		background: #fef3c7;
		padding: 0.85rem;
		text-align: center;
		border-top: 2px solid var(--cjbb-border);
		border-bottom: 2px solid var(--cjbb-border);
		width: 100%;
	}

	.cj-table td:nth-child(4):before {
		content: attr(data-label);
		display: block;
		font-size: 0.75rem;
		font-weight: 600;
		color: #92400e;
		text-transform: uppercase;
		margin-bottom: 0.4rem;
		letter-spacing: 0.5px;
		white-space: nowrap;
	}

	.cj-table .cj-scaled-amount {
		font-weight: 700 !important;
		color: #dc2626 !important;
		font-size: 1.3rem !important;
		display: block;
		word-break: break-word;
	}

	.cj-table td:nth-child(5) {
		padding: 0.85rem;
		text-align: center;
		width: 100%;
	}

	.cj-remove {
		width: 100%;
		padding: 0.75rem;
		font-size: 0.95rem;
		border-radius: 8px;
		display: block;
	}

	.cj-summary {
		grid-template-columns: 1fr 1fr;
		gap: 0.75rem;
		padding: 0.75rem;
	}
	
	/* Mobile: 3-col becomes 1-col */
	.cj-summary-3col {
		grid-template-columns: 1fr;
	}
	
	.cj-actions-3col {
		grid-template-columns: 1fr;
	}

	.cj-summary-label {
		font-size: 0.75rem;
	}

	.cj-summary-value {
		font-size: 1.2rem;
	}

	.cj-summary-subtitle {
		font-size: 0.7rem;
	}

	.cj-ratio-slider-container {
		padding: 1rem;
	}

	.cj-ratio-display {
		font-size: 1.3rem;
	}

	.cj-actions {
		flex-direction: column;
	}

	.cj-btn {
		width: 100%;
		justify-content: center;
		padding: 0.75rem 1.25rem;
	}

	.cj-category-section {
		padding: 0.75rem;
		margin: 1rem 0;
		border-radius: 12px;
	}

	.cj-category-title {
		font-size: 1.05rem;
	}

	.cj-meat-auto-note {
		font-size: 0.8rem;
		padding: 0.5rem;
	}
}