/* Modern File Upload Modal Styles */

/* Modal Container */
.g3-file-upload-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 9999;
	display: none;
}

.g3-file-upload-modal.g3-modal-active {
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Modal Backdrop */
.g3-modal-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(255, 255, 255, 0.8);
}

/* Modal Content */
.g3-modal-content {
	position: relative;
	background: white;
	border-radius: 12px;
	box-shadow:
		0 20px 25px -5px rgba(0, 0, 0, 0.2),
		0 10px 10px -5px rgba(0, 0, 0, 0.1);
	max-width: 600px;
	width: 90%;
	max-height: 90vh;
	overflow: hidden;
}

/* Modal Header */
.g3-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.5rem;
	border-bottom: 1px solid #e5e7eb;
	background: #f9fafb;
}

.g3-modal-title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 600;
	color: #0144b5;
}

.g3-modal-close {
	background: none;
	border: none;
	padding: 0.5rem;
	border-radius: 6px;
	cursor: pointer;
	color: #0144b5;
	transition: all 0.2s ease;
}

.g3-modal-close:hover {
	background-color: #e5e7eb;
	color: #013ba0;
}

/* Modal Body */
.g3-modal-body {
	padding: 1.5rem;
	max-height: calc(90vh - 140px);
	overflow-y: auto;
}

/* Form Elements */
.g3-form-group {
	margin-bottom: 1.5rem;
}

.g3-form-label {
	display: block;
	font-weight: 500;
	color: #374151;
	margin-bottom: 0.5rem;
}

.g3-required-asterisk {
	color: #ef4444;
	margin-right: 0.25rem;
}

.g3-form-help {
	display: block;
	font-size: 0.875rem;
	color: #6b7280;
	margin-bottom: 0.5rem;
}

.g3-form-control {
	width: 100%;
	padding: 0.75rem;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 1rem;
	transition:
		border-color 0.2s ease,
		box-shadow 0.2s ease;
}

.g3-form-control:focus {
	outline: none;
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.g3-form-control:disabled {
	background-color: #f3f4f6;
	color: #9ca3af;
	cursor: not-allowed;
}

.g3-invalid-feedback {
	display: none;
	color: #ef4444;
	font-size: 0.875rem;
	margin-top: 0.25rem;
}

.g3-form-control.g3-invalid + .g3-invalid-feedback {
	display: block;
}

/* Upload Area */
.g3-upload-area {
	position: relative;
	border: 2px dashed #d1d5db;
	border-radius: 8px;
	padding: 2rem;
	text-align: center;
	transition: all 0.3s ease;
	cursor: pointer;
	background: #fafafa;
}

.g3-upload-area:hover {
	border-color: #9ca3af;
	background: #f9fafb;
}

.g3-upload-area.g3-upload-hover {
	border-color: #3b82f6;
	background: #eff6ff;
}

.g3-upload-area.g3-upload-selected {
	border-color: #10b981;
	background: #f0fdf4;
}

.g3-file-input {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

/* Upload States */
.g3-upload-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
}

.g3-upload-icon svg,
.g3-success-icon svg,
.g3-error-icon svg {
	color: #6b7280;
}

.g3-upload-title {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 600;
	color: #374151;
}

.g3-upload-subtitle {
	margin: 0;
	color: #6b7280;
}

.g3-upload-formats,
.g3-upload-size {
	margin: 0;
	font-size: 0.875rem;
	color: #9ca3af;
}

/* Selected File State */
.g3-selected-file {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1rem;
	background: white;
	border-radius: 8px;
	border: 1px solid #e5e7eb;
	width: 100%;
	max-width: 400px;
}

.g3-selected-icon svg {
	color: #3b82f6;
	flex-shrink: 0;
}

.g3-selected-info {
	flex: 1;
	min-width: 0;
}

.g3-selected-name {
	margin: 0;
	font-weight: 500;
	color: #374151;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.g3-selected-size {
	margin: 0;
	font-size: 0.875rem;
	color: #6b7280;
}

.g3-selected-remove {
	background: none;
	border: none;
	padding: 0.5rem;
	border-radius: 4px;
	cursor: pointer;
	color: #6b7280;
	transition: all 0.2s ease;
}

.g3-selected-remove:hover {
	background-color: #fee2e2;
	color: #ef4444;
}

.g3-selected-message {
	margin: 0;
	color: #10b981;
	font-weight: 500;
}

/* Processing State */
.g3-processing-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid #e5e7eb;
	border-top: 3px solid #3b82f6;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

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

.g3-processing-title {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 600;
	color: #374151;
}

.g3-processing-subtitle {
	margin: 0;
	color: #6b7280;
}

/* Progress Bar */
.g3-progress-container {
	display: flex;
	align-items: center;
	gap: 1rem;
	width: 100%;
	max-width: 300px;
}

.g3-progress-bar {
	flex: 1;
	height: 8px;
	background-color: #e5e7eb;
	border-radius: 4px;
	overflow: hidden;
}

.g3-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, #3b82f6, #1d4ed8);
	border-radius: 4px;
	transition: width 0.3s ease;
	width: 0%;
}

.g3-progress-text {
	font-size: 0.875rem;
	font-weight: 500;
	color: #374151;
	min-width: 40px;
}

/* Success/Error States */
.g3-success-title {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 600;
	color: #10b981;
}

.g3-success-subtitle {
	margin: 0;
	color: #6b7280;
}

.g3-error-title {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 600;
	color: #ef4444;
}

.g3-error-subtitle {
	margin: 0;
	color: #6b7280;
}

.g3-error-retry {
	background: #ef4444;
	color: white;
	border: none;
	padding: 0.75rem 1.5rem;
	border-radius: 6px;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.g3-error-retry:hover {
	background: #dc2626;
}

/* Modal Footer */
.g3-modal-footer {
	display: flex;
	justify-content: flex-end;
	gap: 1rem;
	padding: 1.5rem;
	border-top: 1px solid #e5e7eb;
	background: #f9fafb;
}

/* Buttons */
.g3-btn {
	padding: 0.75rem 1.5rem;
	border-radius: 6px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
	border: none;
	font-size: 1rem;
}

.g3-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.g3-btn-secondary {
	background: #f3f4f6;
	color: #374151;
}

.g3-btn-secondary:hover:not(:disabled) {
	background: #e5e7eb;
}

.g3-btn-primary {
	background: #3b82f6;
	color: white;
}

.g3-btn-primary:hover:not(:disabled) {
	background: #2563eb;
}

/* Responsive Design */
@media (max-width: 640px) {
	.g3-modal-content {
		width: 95%;
		margin: 1rem;
	}

	.g3-modal-header,
	.g3-modal-body,
	.g3-modal-footer {
		padding: 1rem;
	}

	.g3-upload-area {
		padding: 1.5rem;
	}

	.g3-selected-file {
		flex-direction: column;
		text-align: center;
	}

	.g3-progress-container {
		flex-direction: column;
		text-align: center;
	}
}

/* Accessibility */
.g3-file-upload-modal:focus-within .g3-modal-content {
	outline: 2px solid #3b82f6;
	outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
	.g3-modal-content {
		border: 2px solid #000;
	}

	.g3-upload-area {
		border-color: #000;
	}
}
