/* General Reset & Base Styles */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

:root {
	--bg-color-dark: #0d1117;
	--bg-color-medium: #161b22;
	--bg-color-light: #21262d;
	--text-color-primary: #c9d1d9;
	--text-color-secondary: #8b949e;
	--border-color: #30363d;
	--accent-blue: #58a6ff;
	--accent-green: #3fb950;
	--accent-red: #f85149;
	--shadow-dark: rgba(0, 0, 0, 0.4);
	--shadow-light: rgba(0, 0, 0, 0.2);
}

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
		Oxygen, Ubuntu, Cantarell, sans-serif;
	background-color: var(--bg-color-dark);
	color: var(--text-color-primary);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 1.5rem;
	line-height: 1.6;
}

.container {
	width: 100%;
	max-width: 1000px;
	/* Slightly reduced max-width for a more compact feel */
	margin: 0 auto;
}

h1 {
	color: var(--text-color-primary);
	text-align: center;
	font-size: 2.5rem;
	font-weight: 700;
	margin-bottom: 2.5rem;
	background: linear-gradient(135deg, var(--accent-blue) 0%, #a673ff 100%);
	/* Adjusted gradient */
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	text-shadow: 0 0 20px rgba(88, 166, 255, 0.2);
}

h2 {
	color: var(--text-color-primary);
	font-size: 1.8rem;
	font-weight: 600;
	margin-bottom: 1.5rem;
	text-align: center;
	border-bottom: 1px solid var(--border-color);
	padding-bottom: 0.75rem;
}

/* Form Styles */
#uploadForm {
	background-color: var(--bg-color-medium);
	border: 1px solid var(--border-color);
	padding: 2.5rem;
	border-radius: 12px;
	box-shadow: 0 10px 20px var(--shadow-dark);
	margin-bottom: 3rem;
	transition: all 0.2s ease-in-out;
	max-width: 700px;
	/* Slightly reduced max-width */
	margin-left: auto;
	margin-right: auto;
}

#uploadForm:hover {
	transform: translateY(-3px);
	box-shadow: 0 15px 30px var(--shadow-dark);
}

.input-group {
	position: relative;
	margin-bottom: 1.5rem;
}

.input-group .icon {
	position: absolute;
	left: 1rem;
	top: 50%;
	transform: translateY(-50%);
	color: var(--text-color-secondary);
	font-size: 1rem;
}

input[type="password"],
input[type="text"] {
	width: 100%;
	padding: 0.8rem 1rem 0.8rem 2.5rem;
	/* Adjusted padding for icon */
	background-color: var(--bg-color-light);
	border: 1px solid var(--border-color);
	border-radius: 8px;
	color: var(--text-color-primary);
	font-size: 1rem;
	transition: all 0.2s ease;
	outline: none;
}

input[type="password"]:focus,
input[type="text"]:focus {
	border-color: var(--accent-blue);
	box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.3);
	background-color: var(--bg-color-light);
}

input::placeholder {
	color: var(--text-color-secondary);
}

.input-error {
	border-color: var(--accent-red) !important;
	box-shadow: 0 0 0 2px rgba(248, 81, 73, 0.3) !important;
}

/* Drop Zone Styling */
.drop-zone {
	border: 2px dashed var(--border-color);
	border-radius: 8px;
	padding: 2rem;
	text-align: center;
	cursor: pointer;
	transition: all 0.2s ease-in-out;
	margin-bottom: 1.5rem;
	background-color: var(--bg-color-light);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 120px;
	position: relative;
}

.drop-zone:hover {
	border-color: var(--accent-blue);
	background-color: #2b313a;
}

.drop-zone.drag-over {
	border-color: var(--accent-green);
	background-color: #2b313a;
	box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.3);
}

.drop-zone-label {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	cursor: pointer;
	color: var(--text-color-secondary);
}

.drop-zone-label .icon {
	font-size: 2.5rem;
	margin-bottom: 0.75rem;
	color: var(--text-color-secondary);
}

.drop-zone.file-selected .drop-zone-label .icon {
	color: var(--accent-green);
}

.selected-file-name {
	margin-top: 0.5rem;
	font-weight: 500;
	color: var(--text-color-primary);
	word-break: break-all;
}

/* Buttons */
button {
	width: 100%;
	padding: 0.8rem 1.5rem;
	background-color: var(--accent-blue);
	color: white;
	border: none;
	border-radius: 8px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
}

button:hover {
	background-color: #4480d0;
	box-shadow: 0 5px 15px rgba(88, 166, 255, 0.3);
}

button:disabled {
	background-color: #4b5563;
	cursor: not-allowed;
	box-shadow: none;
}

/* Progress & Status */
#progress-container {
	width: 100%;
	background-color: var(--bg-color-light);
	height: 8px;
	border-radius: 4px;
	overflow: hidden;
	margin-bottom: 1.5rem;
	box-shadow: inset 0 1px 3px var(--shadow-dark);
}

#progress-bar {
	height: 100%;
	width: 0%;
	background: linear-gradient(90deg, var(--accent-green), #60d06e);
	transition: width 0.3s ease;
	border-radius: 4px;
}

#status {
	margin-bottom: 1.5rem;
	padding: 0.75rem 1rem;
	border-radius: 8px;
	font-weight: 500;
	display: none;
	text-align: center;
	border: 1px solid transparent;
	color: var(--text-color-primary);
	background-color: var(--bg-color-light);
}

.status-processing {
	border-color: var(--accent-blue);
	color: var(--accent-blue);
}

.status-success {
	border-color: var(--accent-green);
	color: var(--accent-green);
}

.status-error {
	border-color: var(--accent-red);
	color: var(--accent-red);
}

/* Video List */
#videos {
	background-color: var(--bg-color-medium);
	border: 1px solid var(--border-color);
	border-radius: 12px;
	padding: 2.5rem;
	box-shadow: 0 10px 20px var(--shadow-dark);
}

#videoList {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.5rem;
	margin-top: 1.5rem;
}

.video-item {
	background-color: var(--bg-color-light);
	border: 1px solid var(--border-color);
	border-radius: 8px;
	overflow: hidden;
	transition: all 0.2s ease-in-out;
	cursor: pointer;
	position: relative;
	display: flex;
	flex-direction: column;
}

.video-item:hover {
	background-color: #2b313a;
	border-color: var(--accent-blue);
	transform: translateY(-3px);
	box-shadow: 0 8px 16px var(--shadow-dark);
}

.video-thumbnail {
	width: 100%;
	height: 160px;
	background-color: #1a1f26;
	/* Darker background for thumbnails */
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	overflow: hidden;
	border-bottom: 1px solid var(--border-color);
}

.video-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.2s ease;
}

.video-item:hover .video-thumbnail img {
	transform: scale(1.05);
}

.video-thumbnail .placeholder {
	font-size: 3rem;
	color: var(--text-color-secondary);
}

.play-overlay {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(0, 0, 0, 0.7);
	border-radius: 50%;
	width: 50px;
	height: 50px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-size: 1.2rem;
	opacity: 0;
	transition: opacity 0.2s ease;
	backdrop-filter: blur(5px);
}

.video-item:hover .play-overlay {
	opacity: 1;
}

.video-info {
	padding: 1rem;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	/* Allow info to grow */
}

.video-title {
	color: var(--text-color-primary);
	text-decoration: none;
	font-weight: 600;
	font-size: 1rem;
	line-height: 1.4;
	display: block;
	word-break: break-word;
	transition: color 0.2s ease;
	margin-bottom: 0.75rem;
	/* Space before buttons */
}

.video-title:hover {
	color: var(--accent-blue);
}

.no-videos {
	text-align: center;
	color: var(--text-color-secondary);
	font-style: italic;
	padding: 3rem;
	font-size: 1.1rem;
	background-color: var(--bg-color-light);
	border-radius: 8px;
	border: 1px dashed var(--border-color);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
}

.no-videos .fas {
	font-size: 2rem;
	color: var(--text-color-secondary);
}

/* Notifications */
#notification {
	background-color: var(--accent-green);
	color: white;
	padding: 0.8rem 1.2rem;
	border-radius: 8px;
	display: none;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
	position: fixed;
	top: 20px;
	right: 20px;
	z-index: 1000;
	max-width: 350px;
	font-weight: 500;
}

.notification-error {
	background-color: var(--accent-red) !important;
}

.notification-auth-error {
	background-color: var(--accent-red) !important;
	border: 1px solid rgba(248, 81, 73, 0.6) !important;
	animation: shake 0.5s ease-in-out;
}

@keyframes shake {

	0%,
	20%,
	40%,
	60%,
	80%,
	100% {
		transform: translateX(0);
	}

	10%,
	30%,
	50%,
	70%,
	90% {
		transform: translateX(-5px);
	}
}

/* Action Buttons & Modal */
.video-actions {
	display: flex;
	gap: 0.5rem;
	justify-content: flex-end;
	margin-top: auto;
	/* Push buttons to bottom */
}

.action-btn {
	padding: 0.4rem 0.8rem;
	border: none;
	border-radius: 6px;
	font-size: 0.8rem;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
	width: auto;
	text-transform: none;
	letter-spacing: normal;
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
}

.action-btn .fas {
	font-size: 0.9rem;
}

.edit-btn {
	background-color: #4a90e2;
	color: white;
}

.edit-btn:hover {
	background-color: #357bd8;
	box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.delete-btn {
	background-color: #e24a4a;
	color: white;
}

.delete-btn:hover {
	background-color: #d83535;
	box-shadow: 0 2px 8px rgba(226, 74, 74, 0.3);
}

/* Modal Styles */
.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.8);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 2000;
	display: none;
}

.modal-content {
	background-color: var(--bg-color-medium);
	border: 1px solid var(--border-color);
	padding: 2rem;
	border-radius: 12px;
	box-shadow: 0 10px 30px var(--shadow-dark);
	text-align: center;
	max-width: 400px;
	width: 90%;
}

#modalMessage {
	font-size: 1.1rem;
	margin-bottom: 1.5rem;
	color: var(--text-color-primary);
}

#modalInput {
	margin-bottom: 1.5rem;
	padding: 0.75rem 1rem;
	border-radius: 6px;
	border: 1px solid var(--border-color);
	background-color: var(--bg-color-light);
	color: var(--text-color-primary);
	width: calc(100% - 2rem);
	font-size: 1rem;
}

.modal-actions {
	display: flex;
	justify-content: center;
	gap: 1rem;
}

.modal-confirm-btn,
.modal-cancel-btn {
	padding: 0.75rem 1.5rem;
	border: none;
	border-radius: 6px;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	width: auto;
	text-transform: none;
	letter-spacing: normal;
}

.modal-confirm-btn {
	background-color: var(--accent-green);
	color: white;
}

.modal-confirm-btn:hover {
	background-color: #309b3f;
	box-shadow: 0 2px 8px rgba(63, 185, 80, 0.3);
}

.modal-cancel-btn {
	background-color: #6b7280;
	color: white;
}

.modal-cancel-btn:hover {
	background-color: #4b5563;
	box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
	body {
		padding: 1rem;
	}

	h1 {
		font-size: 2rem;
		margin-bottom: 2rem;
	}

	h2 {
		font-size: 1.6rem;
		margin-bottom: 1.2rem;
	}

	#uploadForm,
	#videos {
		padding: 1.5rem;
		border-radius: 10px;
		margin-bottom: 2rem;
	}

	.input-group input {
		padding: 0.7rem 1rem 0.7rem 2.2rem;
		font-size: 0.95rem;
	}

	.input-group .icon {
		left: 0.8rem;
		font-size: 0.9rem;
	}

	.drop-zone {
		padding: 1.5rem;
		min-height: 100px;
	}

	.drop-zone-label .icon {
		font-size: 2rem;
		margin-bottom: 0.5rem;
	}

	button {
		padding: 0.75rem 1.2rem;
		font-size: 0.95rem;
	}

	#videoList {
		grid-template-columns: 1fr;
		gap: 1rem;
	}

	.video-thumbnail {
		height: 180px;
	}

	.video-info {
		padding: 0.8rem;
	}

	.video-title {
		font-size: 0.9rem;
	}

	#notification {
		right: 10px;
		left: 10px;
		max-width: none;
		padding: 0.7rem 1rem;
		font-size: 0.9rem;
	}

	.modal-content {
		padding: 1.5rem;
	}

	.modal-confirm-btn,
	.modal-cancel-btn {
		padding: 0.6rem 1.2rem;
		font-size: 0.85rem;
	}
}

@media (max-width: 480px) {
	h1 {
		font-size: 2rem;
	}

	#uploadForm,
	#videos {
		padding: 1.2rem;
		border-radius: 8px;
	}

	.input-group input {
		padding: 0.6rem 0.8rem 0.6rem 2rem;
		font-size: 0.85rem;
	}

	.input-group .icon {
		left: 0.6rem;
		font-size: 0.8rem;
	}

	button {
		padding: 0.6rem 1rem;
		font-size: 0.85rem;
	}

	.video-thumbnail {
		height: 140px;
	}

	.video-info {
		padding: 0.6rem;
	}

	.video-title {
		font-size: 0.85rem;
	}
}

/* Scrollbar Styles */
::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}

::-webkit-scrollbar-track {
	background: var(--bg-color-medium);
	border-radius: 10px;
}

::-webkit-scrollbar-thumb {
	background: var(--border-color);
	border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
	background: var(--text-color-secondary);
}