/* 
================================
    LEDLAB ALLOCATIONS STYLES
================================
*/

/* Base styles */
body {
	font-family: "Roboto", sans-serif;
	font-size: 16px;
	color: #f5f5f5;
	background-color: #1a202d;
	margin: 0;
	padding: 0;
	height: 100vh;
	overflow: hidden;
}

.app-container {
	display: flex;
	flex-direction: column;
	height: 100vh;
}

.app-header {
	display: flex;
	align-items: center;
	padding: 5px 5px;
	background-color: #171b21;
	border-bottom: 2px solid #e13c77;
	position: relative; /* For the centered message */
}

/* Left section for title */
.header-left {
	flex: 0 0 auto;
}

/* Center section for message */
.header-center {
	flex: 1 1 auto;
	text-align: center;
}

/* Right section for stats */
.header-right {
	flex: 0 0 auto;
	margin-left: 5px; /* Small gap between center and right */
}

.app-header h1 {
	margin: 0;
	font-size: 24px;
	color: #e13c77;
	flex-shrink: 0; /* Prevent the title from shrinking */
}

#header-message {
	position: absolute;
	left: 45.5%;
	transform: translateX(-50%);
	margin: 0;
	font-size: 14px;
	font-family: "Courier New", Courier, monospace;
	color: #f5f5f5;
	white-space: nowrap;
	border: 0px solid #e13c77;
	border-radius: 5px;
	padding: 5px;
	background-color: #05000b27;
	z-index: 1; /* Ensure it's above other elements */
}

.stats-container {
	display: flex;
	gap: 15px; /* Small 5px gap between stats tags */
	margin-left: auto; /* Push the entire container to the right */
	margin-right: 10px; /* 5px from the right edge */
}

.stats-tag {
	font-size: 14px;
	color: #ffffff;
	border: 0px solid #e13c77;
	border-radius: 5px;
	padding: 3px;
	background-color: #05000b27;
	white-space: nowrap;
	font-family: "Courier New", Courier, monospace;
}

/* Search container */
.search-container {
	display: flex;
	align-items: center;
	padding: 10px;
	background-color: #1e243000;
	border-bottom: 0px solid #3a4050;
}

.search-bar {
	width: 250px;
	padding: 10px;
	border: 1px solid #e13c77;
	border-radius: 5px;
	font-size: 16px;
	color: #f5f5f5;
	background-color: #171b21;
	outline: none;
	transition: all 0.3s ease;
}

.search-bar:focus {
	box-shadow: 0 0 5px rgba(225, 60, 119, 0.5);
}

/* Buttons */
.add-button {
	display: flex;
	align-items: center;
	gap: 8px;
	height: 40px;
	margin-left: 10px;
	padding: 0 15px;
	border: none;
	border-radius: 5px;
	font-size: 16px;
	font-weight: 500;
	color: #f5f5f5;
	background-color: #e13c77;
	cursor: pointer;
	outline: none;
	transition: all 0.3s ease;
}

.add-button:hover {
	background-color: #c62c67;
	transform: translateY(-2px);
}

.credit-container {
	flex: 1;
	display: flex;
	justify-content: center;
}

.credit-button {
	display: flex;
	align-items: center;
	gap: 5px;
	height: 25px;
	padding: 0 10px;
	border: 2px solid #e13c77;
	border-radius: 5px;
	font-size: 12px;
	color: #f5f5f5;
	background-color: #171b21; /* base */
	cursor: pointer;
	outline: none;
	transition: all 0.3s ease;
	position: relative;
	/* avoid overriding background-color */
	background-image: linear-gradient(
		135deg,
		#171b21 0%,
		#171b21 45%,
		#2a2f36 50%,
		#171b21 55%,
		#171b21 100%
	);
	background-size: 200% 100%;
	animation: shimmer 4s ease 0s infinite;
}

.credit-button:hover {
	background-image: linear-gradient(45deg, #a2265c, #ff69b4, #822265);
	background-size: 300% 300%;
	border: 2px solid #c23ae7;
	color: #ffffff;
	animation: gradient 3s ease infinite;
}

@keyframes gradient {
	0% {
		background-position: 0% 50%;
	}
	50% {
		background-position: 100% 50%;
	}
	100% {
		background-position: 0% 50%;
	}
}

@keyframes shimmer {
	0% {
		background-position: 120% 0%;
	}
	100% {
		background-position: -20% 0%;
	}
}

.year-buttons {
	display: flex;
	align-items: center;
	margin-left: auto;
}

.clear-button {
	width: 40px;
	height: 40px;
	margin-left: 10px;
	border-radius: 5px;
	font-size: 16px;
	color: #f5f5f5;
	background-color: #192c3e;
	border: 1px solid #e13c77;
	cursor: pointer;
	transition: all 0.3s ease;
}

.clear-button:hover {
	background-color: #253a4e;
}

.filter-button {
	height: 40px;
	margin-left: 5px;
	padding: 0 10px;
	border: none;
	border-radius: 5px;
	font-size: 16px;
	color: #f5f5f5;
	background-color: #e13c77;
	cursor: pointer;
	outline: none;
	transition: all 0.3s ease;
}

.grid-filter-button {
	height: 40px;
	margin-left: 5px;
	padding: 0 10px;
	border: 2px solid #e13c77;
	border-radius: 5px;
	font-size: 16px;
	color: #f5f5f5;
	background-color: #180017;
	cursor: pointer;
	outline: none;
	transition: all 0.3s ease;
}

.filter-button:hover {
	transform: scale(1.05);
	background-color: #c62c67;
}

/* AG Grid styles */
#myGrid {
	flex: 1;
	width: 100%;
	height: calc(100vh - 120px);
}

.ag-theme-quartz-dark {
	--ag-foreground-color: #f5f5f5;
	--ag-background-color: #2a313d;
	--ag-header-background-color: #1e2430;
	--ag-odd-row-background-color: rgba(0, 0, 0, 0.1);
	--ag-header-column-separator-color: #3d4654;
	--ag-border-color: #3d4654;
	--ag-row-border-color: #3d4654;
	--ag-row-hover-color: rgba(225, 60, 119, 0.2);
	--ag-selected-row-background-color: rgba(225, 60, 119, 0.3);
	--ag-font-size: 14px;
	--ag-font-family: "Roboto", sans-serif;
	--ag-cell-horizontal-padding: 12px;
}

.ag-theme-quartz-dark .ag-header-cell {
	font-weight: bold;
}

.ag-theme-quartz-dark .ag-row {
	border-bottom: 1px solid var(--ag-border-color);
}

/* Modal styles */
.modal-hidden {
	display: none;
}

.modal-container {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.7);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 1000;
	opacity: 1;
	transition: opacity 0.3s ease;
}

.modal-content {
	background-color: #15172b;
	border-radius: 10px;
	padding: 20px;
	width: 80%;
	max-width: 800px;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
	position: relative;
	opacity: 0;
	transform: scale(0.9);
	transition:
		opacity 0.3s ease,
		transform 0.3s ease;
	animation: modalContentFadeIn 0.3s ease forwards;
}

@keyframes modalContentFadeIn {
	to {
		opacity: 1;
		transform: scale(1);
	}
}

/* Form styles */
.form-container {
	padding: 20px;
}

.form-title {
	color: #e13c77;
	font-size: 24px;
	margin-bottom: 20px;
	text-align: center;
}

.form-subtitle {
	color: #f5f5f5;
	font-size: 16px;
	margin-bottom: 30px;
	text-align: center;
}

.form-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px;
}

.input-container {
	position: relative;
	margin-bottom: 20px;
}

.input-field {
	width: 100%;
	padding: 12px 15px;
	background-color: #303245;
	border: none;
	border-radius: 8px;
	color: #f5f5f5;
	font-size: 16px;
	outline: none;
	transition: all 0.3s ease;
}

.input-field:focus {
	box-shadow: 0 0 5px rgba(225, 60, 119, 0.5);
}

.input-label {
	position: absolute;
	top: -10px;
	left: 10px;
	background-color: #15172b;
	padding: 0 5px;
	font-size: 14px;
	color: #8f8f9d;
	transition: all 0.3s ease;
}

.input-field:focus + .input-label,
.input-field:not(:placeholder-shown) + .input-label {
	color: #e13c77;
}

.form-buttons {
	display: flex;
	justify-content: space-between;
	margin-top: 20px;
}

.btn {
	padding: 10px 20px;
	border: none;
	border-radius: 5px;
	font-size: 16px;
	cursor: pointer;
	transition: all 0.3s ease;
}

.btn-primary {
	background-color: #e13c77;
	color: #f5f5f5;
}

.btn-primary:hover {
	background-color: #c62c67;
}

.btn-secondary {
	background-color: #303245;
	color: #f5f5f5;
}

.btn-secondary:hover {
	background-color: #3e4056;
}

.btn-danger {
	background-color: #d9534f;
	color: #f5f5f5;
}

.btn-danger:hover {
	background-color: #c9302c;
}

/* Status indicators */
.status-not-started {
	color: #f5f5f5;
	background-color: #6c757d;
	padding: 4px 8px;
	border-radius: 4px;
	display: inline-block;
}

.status-in-progress {
	color: #fff;
	background-color: #007bff;
	padding: 4px 8px;
	border-radius: 4px;
	display: inline-block;
}

.status-completed {
	color: #fff;
	background-color: #28a745;
	padding: 4px 8px;
	border-radius: 4px;
	display: inline-block;
}

.status-test-completed {
	color: #fff;
	background-color: #17a2b8;
	padding: 4px 8px;
	border-radius: 4px;
	display: inline-block;
}

.status-cancelled {
	color: #fff;
	background-color: #dc3545;
	padding: 4px 8px;
	border-radius: 4px;
	display: inline-block;
}

/* Action buttons */
.btn-edit,
.btn-delete {
	background: none;
	border: none;
	color: #e13c77;
	cursor: pointer;
	font-size: 16px;
	margin: 0 5px;
	padding: 5px;
	transition: transform 0.2s;
}

.btn-edit:hover,
.btn-delete:hover {
	transform: scale(1.2);
}

.btn-delete {
	color: #dc3545;
}

/* Make sure the grid takes up available space */
#myGrid {
	height: calc(100vh - 180px);
	width: 100%;
	margin-top: 10px;
}

/* Loading Spinner */
.loading-spinner {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(26, 32, 45, 0.9);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 2000;
	transition: opacity 0.5s;
}

.loading-spinner.fade-out {
	opacity: 0;
}

.spinner-container {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.spinner-svg {
	width: 60px;
	height: 60px;
	animation: spin 1s linear infinite;
}

.spinner-circle {
	stroke-dasharray: 80, 200;
	stroke-dashoffset: 0;
	transform-origin: center;
	animation: dash 1.5s ease-in-out infinite;
}

.spinner-container p {
	margin-top: 15px;
	color: #f5f5f5;
	font-size: 18px;
	font-weight: 500;
	padding: 8px 16px;
	background-color: rgba(0, 0, 0, 0.3);
	border-radius: 20px;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

@keyframes dash {
	0% {
		stroke-dasharray: 1, 200;
		stroke-dashoffset: 0;
	}
	50% {
		stroke-dasharray: 89, 200;
		stroke-dashoffset: -35;
	}
	100% {
		stroke-dasharray: 89, 200;
		stroke-dashoffset: -124;
	}
}

/* Modal animations */
.modal-bg-fade-out {
	background-color: rgba(0, 0, 0, 0);
}

/* Comments column styling */
.ag-cell.comments-column {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	cursor: pointer;
	position: relative;
}

/* Edit hover preview */
.edit-hover-preview {
	position: absolute;
	width: 450px;
	max-height: 300px;
	background-color: #2a313d;
	border: 2px solid #e13c77;
	border-radius: 4px;
	padding: 15px;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.7);
	z-index: 9999;
	overflow-y: auto;
	white-space: pre-wrap;
	line-height: 1.5;
	font-size: 14px;
	color: #f5f5f5;
	pointer-events: none;
	word-break: break-word;
}

/* Edit modal popup */
.edit-modal {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(0.9);
	width: 600px;
	max-width: 80vw;
	min-height: 200px;
	max-height: 80vh;
	background-color: #2a313d;
	border: 2px solid #e13c77;
	border-radius: 8px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
	z-index: 2000;
	padding: 40px 25px 25px;
	overflow-y: auto;
	opacity: 0;
	transition:
		opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
		transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
		border 0.3s ease,
		box-shadow 0.3s ease;
}

.edit-modal.closing {
	animation: modal-close 0.25s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes modal-open {
	0% {
		opacity: 0;
		transform: translate(-50%, -50%) scale(0.9);
	}
	100% {
		opacity: 1;
		transform: translate(-50%, -50%) scale(1);
	}
}

@keyframes modal-close {
	0% {
		opacity: 1;
		transform: translate(-50%, -50%) scale(1);
	}
	100% {
		opacity: 0;
		transform: translate(-50%, -50%) scale(0.9);
	}
}

.edit-modal-content {
	font-size: 16px;
	line-height: 1.6;
	color: #f5f5f5;
	white-space: pre-wrap;
	word-wrap: break-word;
	user-select: text;
	-webkit-user-select: text;
	-moz-user-select: text;
	-ms-user-select: text;
}

.edit-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.6);
	z-index: 1999;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.edit-overlay.closing {
	animation: overlay-fade-out 0.25s ease forwards;
}

@keyframes overlay-fade-in {
	0% {
		opacity: 0;
	}
	100% {
		opacity: 1;
	}
}

@keyframes overlay-fade-out {
	0% {
		opacity: 1;
	}
	100% {
		opacity: 0;
	}
}

.edit-copy-button {
	position: absolute;
	top: 10px;
	right: 10px;
	background: #e13c77;
	color: white;
	border: none;
	border-radius: 4px;
	padding: 5px 10px;
	font-size: 14px;
	cursor: pointer;
	opacity: 0.9;
	transition: all 0.2s ease;
	z-index: 2001;
	transform: translateY(0);
	animation: button-drop 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) backwards;
	animation-delay: 0.15s;
}

.edit-copy-button:hover {
	opacity: 1;
	transform: scale(1.05);
}

.edit-close-button {
	position: absolute;
	top: 10px;
	right: 70px;
	background: #303245;
	color: white;
	border: none;
	border-radius: 4px;
	padding: 5px 10px;
	font-size: 14px;
	cursor: pointer;
	opacity: 0.9;
	transition: all 0.2s ease;
	z-index: 2001;
	transform: translateY(0);
	animation: button-drop 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) backwards;
	animation-delay: 0.1s;
}

.edit-close-button:hover {
	opacity: 1;
	transform: scale(1.05);
}

@keyframes button-drop {
	0% {
		opacity: 0;
		transform: translateY(-20px);
	}
	100% {
		opacity: 0.9;
		transform: translateY(0);
	}
}
