﻿@import "/UI/Core/Styles/Theme.scss";

C4Panel {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	justify-content: center;
	align-items: center;
	pointer-events: none;
	background-color: transparent;
	z-index: 300;

	&.hidden {
		display: none;
	}

	&.visible {
		display: flex;
		pointer-events: all;
	}

	.panel {
		background-color: #3a423a;
		padding: 16px;
		flex-direction: column;
		gap: 10px;
		width: 280px;
		border: 4px solid #252b25;
		border-radius: 3px;
		box-shadow: 0 10px 40px #000000cc;
	}
	// Timer display section
	.timer-section {
		height: 90px;
		background-color: #111;
		border: 3px solid #333;
		border-radius: 2px;
		justify-content: center;
		align-items: center;
		position: relative;
	}
	// Grid layout for timer digits
	.timer-grid {
		flex-direction: row;
		justify-content: center;
		align-items: center;
	}

	.digit-cell {
		width: 50px;
		height: 70px;
		position: relative;
		justify-content: center;
		align-items: center;
	}

	.colon-cell {
		width: 20px;
		height: 70px;
		position: relative;
		justify-content: center;
		align-items: center;
	}

	.digit-ghost {
		position: absolute;
		font-family: $font-family-world-c4;
		font-size: $type-size-world-c4-digits;
		font-weight: 700;
		color: #330000;
	}

	.digit {
		position: absolute;
		font-family: $font-family-world-c4;
		font-size: $type-size-world-c4-digits;
		font-weight: bold;
		color: #ff0000;
		text-shadow: 0 0 15px #ff0000, 0 0 30px #ff000088, 0 0 30px #ff0000;
	}

	.colon {
		font-family: $font-family-world-c4;
		font-size: $type-size-world-c4-digits;
		font-weight: 700;
		color: #ff0000;
		text-shadow: 0 0 15px #ff0000, 0 0 30px #ff000088, 0 0 30px #ff0000;
	}

	.status {
		position: absolute;
		bottom: 4px;
		right: 4px;
		color: #ff0000;
		font-size: 12px;
		font-weight: 600;
		background-color: #320000cc;
		padding: 2px 6px;
		border-radius: 2px;
	}
	// Slider section
	.slider-section {
		flex-direction: column;
		gap: 4px;
		padding: 0 4px;
	}

	.slider-container {
		position: relative;
		height: 30px;
		justify-content: center;
		align-items: center;
		padding: 0 15px;
	}
	// Extended visual track behind the slider
	.slider-track {
		position: absolute;
		left: 0;
		right: 0;
		top: 50%;
		margin-top: -6px;
		height: 8px;
		background-color: #222;
		border: 2px solid #444;
		border-radius: 4px;
	}

	.slider-container UISlider,
	.slider-container .ui-slider {
		width: 100%;
		height: 36px;
		position: relative;
		z-index: 1;

		.inner {
			height: 1%;
			justify-content: center;
		}

		.track {
			height: 6px;
			background-color: transparent;
			border-radius: 0;
			position: relative;
			width: 100%;
		}

		.track-active {
			display: none;
		}

		.thumb {
			width: 18px;
			height: 36px;
			background-color: #d8d0c0;
			border-top: 2px solid #f0e8d8;
			border-left: 2px solid #f0e8d8;
			border-right: 2px solid #666;
			border-bottom: 2px solid #666;
			border-radius: 2px;
			position: absolute;
			top: -15px;
			margin-left: -9px;
			box-shadow: 2px 2px 4px #00000088;
		}
	}
	// Wire warning text
	.wire-warning {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: center;
		align-items: center;
		gap: 0px;
		padding: 4px 8px;

		.warning-text {
			font-size: 15px;
			color: #b8d4b8;
		}

		.danger-count {
			font-size: 15px;
			color: #ff8888;
			font-weight: 700;
		}
	}

	.instruction {
		color: #b8d4b8;
		font-size: 16px;
		text-align: center;
		margin-bottom: 4px;
	}
	// Wire buttons for disarm
	.wires {
		flex-direction: column;
		gap: 6px;
		padding: 4px 0;
	}

	.wire {
		height: 18px;
		cursor: pointer;
		justify-content: center;
		align-items: center;
		border-radius: 4px;
		box-shadow: 0 2px 4px #00000055;
		transition: filter 0.1s;

		label {
			color: white;

			font-weight: 700;
			font-size: 13px;
			margin-bottom: 2px;
			//text-shadow: 1px 1px 2px #00000088;
		}

		&:hover {
			filter: brightness(1.2);
		}

		&.red {
			background-color: #cc3333;
		}

		&.yellow {
			background-color: #cccc33;

			label {
				color: #333;
				text-shadow: 0 0 0 transparent;
			}
		}

		&.blue {
			background-color: #3355cc;
		}

		&.white {
			background-color: #cccccc;

			label {
				color: #333;
				text-shadow: 0 0 0 transparent;
			}
		}

		&.green {
			background-color: #33aa33;
		}

		&.orange {
			background-color: #cc7733;
		}
	}
	// Button section
	.button-section {
		flex-direction: column;
		gap: 10px;
		margin-top: 11px;
		align-items: center;
	}

	.buttons {
		justify-content: center;
		padding: 0px;
	}

	.button-row {
		flex-direction: row;
		gap: 10px;
		justify-content: center;
	}

	.button {
		width: 95px;
		height: 60px;
		flex-shrink: 0;
		flex-grow: 0;
		background-color: #d8d0c0;
		justify-content: center;
		align-items: center;
		cursor: pointer;
		text-align: center;
		padding: 4px;
		border-top: 5px solid #f0e8d8;
		border-left: 5px solid #f0e8d8;
		border-right: 5px solid #777;
		border-bottom: 5px solid #777;
		border-radius: 2px;
		box-shadow: 2px 2px 6px #00000066;

		label {
			color: #333;
			font-family: $font-family-ui;
			font-size: 16px;
			font-weight: bold;
		}

		&:hover {
			background-color: #c1baad;
		}

		&:active {
			border-top: 3px solid #777;
			border-left: 3px solid #777;
			border-right: 3px solid #f0e8d8;
			border-bottom: 3px solid #f0e8d8;
			box-shadow: 0 0 0 transparent;
		}

		&.arm {
			background-color: #cc3333;
			border-top: 5px solid tomato;
			border-left: 5px solid tomato;
			border-right: 5px solid darkred;
			border-bottom: 5px solid darkred;

			&:hover {
				background-color: #b52d2d;
			}

			label {
				color: white;
			}
		}

		&.destroy label {
			color: #ba5b00;
		}
	}
}
