/**
 * Enhanced CSS for LearnDash Drag and Drop Upload
 * Includes styling for the new uploaded files list feature
 */

/* Original styles */
.drop_file_zone_essay .ld-button{
	background-color: #0984e3 !important;
}

/* ========================================
   NEW: Uploaded Files List Styles
   ======================================== */

.uploaded-files-list {
	margin-top: 15px;
	padding: 15px;
	background-color: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 6px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.uploaded-files-header {
	margin-bottom: 12px;
	padding-bottom: 8px;
	border-bottom: 2px solid #0984e3;
	color: #2c3e50;
	font-size: 14px;
}

.uploaded-files-header strong {
	color: #0984e3;
}

.uploaded-file-item {
	display: flex;
	align-items: center;
	padding: 10px 12px;
	margin-bottom: 8px;
	background-color: #ffffff;
	border: 1px solid #e1e8ed;
	border-radius: 4px;
	transition: all 0.2s ease;
	gap: 10px;
}

.uploaded-file-item:hover {
	background-color: #f1f5f9;
	border-color: #0984e3;
	box-shadow: 0 2px 4px rgba(9, 132, 227, 0.1);
}

.uploaded-file-item:last-child {
	margin-bottom: 0;
}

.uploaded-file-item .file-number {
	flex-shrink: 0;
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #0984e3;
	color: #ffffff;
	border-radius: 50%;
	font-size: 12px;
	font-weight: bold;
}

.uploaded-file-item .file-name {
	flex-grow: 1;
	color: #2c3e50;
	font-size: 14px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	padding: 0 10px;
}

.uploaded-file-item .remove-file-btn {
	flex-shrink: 0;
	padding: 6px 12px;
	background-color: #e74c3c;
	color: #ffffff;
	border: none;
	border-radius: 4px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	gap: 4px;
}

.uploaded-file-item .remove-file-btn:hover {
	background-color: #c0392b;
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
}

.uploaded-file-item .remove-file-btn:active {
	transform: translateY(0);
	box-shadow: none;
}

.uploaded-file-item .remove-file-btn .remove-icon {
	font-size: 18px;
	font-weight: bold;
	line-height: 1;
}

/* Upload message styling enhancements */
.uploadEssayMessage {
	margin-top: 10px;
	padding: 10px 15px;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 500;
}

.uploadEssayMessage_success {
	background-color: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.uploadEssayMessage_fail {
	background-color: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

/* Drop zone enhancement when files are uploaded */
.drop_file_zone_essay.has-files {
	border-color: #27ae60;
	background-color: #eafaf1;
}

.drop_file_zone_essay.has-files .drag_upload_file_essay p {
	color: #27ae60;
}

/* Mobile responsive adjustments */
@media screen and (max-width: 768px) {
	.uploaded-file-item {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}

	.uploaded-file-item .file-name {
		padding: 0;
		white-space: normal;
		word-break: break-word;
	}

	.uploaded-file-item .remove-file-btn {
		width: 100%;
		justify-content: center;
	}
}

/* Animation for new file items */
@keyframes slideIn {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.uploaded-file-item {
	animation: slideIn 0.3s ease;
}

/* Empty state (when all files are removed) */
.uploaded-files-list:empty {
	display: none;
}

/* Loading state improvements */
#ldaau_loader_[id] {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
}

/* Better visual hierarchy for the drop zone */
.drop_file_zone_essay {
	position: relative;
	transition: all 0.3s ease;
}

.drop_file_zone_essay:hover {
	border-color: #0984e3;
	background-color: #f0f7ff;
}

/* File count badge (optional enhancement) */
.file-count-badge {
	position: absolute;
	top: -10px;
	right: -10px;
	background-color: #27ae60;
	color: white;
	border-radius: 50%;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: bold;
	box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Drag and drop active state */
.drop_file_zone_essay.drag-over {
	border-color: #27ae60;
	background-color: #eafaf1;
	transform: scale(1.02);
}

/* Accessibility improvements */
.remove-file-btn:focus {
	outline: 2px solid #0984e3;
	outline-offset: 2px;
}

/* Print styles (hide remove buttons when printing) */
@media print {
	.remove-file-btn {
		display: none;
	}
	
	.uploaded-file-item {
		border: 1px solid #333;
	}
}
