/* Modal system used by the create-project and create-gallery dialogs */

.modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1000;
}

.modal.active {
	display: block;
}

.modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(2px);
}

.modal-content {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: var(--bg-dark);
	border: 1px solid var(--gray-700);
	border-radius: 8px;
	width: 90%;
	max-width: 520px;
	max-height: 90vh;
	overflow-y: auto;
	overflow-x: hidden;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
	scrollbar-width: thin;
	scrollbar-color: rgba(128,128,128,0.35) transparent;
}

.modal-content::-webkit-scrollbar { width: 6px; }
.modal-content::-webkit-scrollbar-track { background: transparent; }
.modal-content::-webkit-scrollbar-thumb { background: rgba(128,128,128,0.35); border-radius: 3px; }
.modal-content::-webkit-scrollbar-thumb:hover { background: rgba(128,128,128,0.5); }

.modal .modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.25rem 1.5rem;
	border-bottom: 1px solid var(--gray-700);
}

.modal .modal-header h2 {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 500;
	color: var(--text-primary);
}

.modal .modal-close {
	background: none;
	border: none;
	font-size: 1.75rem;
	line-height: 1;
	color: var(--gray-400);
	cursor: pointer;
	padding: 0;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.modal .modal-close:hover {
	color: var(--text-primary);
}

#create-project-form,
#create-gallery-form,
#edit-gallery-form {
	padding: 1.5rem;
}

.modal-form-group {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-bottom: 1.25rem;
}

.modal-form-group:last-of-type {
	margin-bottom: 0;
}

.modal-form-group label {
	display: block;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--text-primary);
	margin-bottom: 0;
}

.optional {
	font-weight: 400;
	color: var(--gray-400);
}

.form-input,
.form-textarea,
.form-select {
	width: 100%;
	padding: 0.625rem 0.75rem;
	background: var(--bg-darker);
	border: 1px solid var(--gray-700);
	border-radius: 6px;
	color: var(--text-primary);
	font-size: 0.875rem;
	font-family: inherit;
}

.form-select {
	width: auto;
	max-width: 100%;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
	outline: none;
	border-color: var(--gray-600);
}

.form-input::placeholder,
.form-textarea::placeholder {
	color: var(--gray-500);
}

.form-input.error,
.form-textarea.error {
	border-color: #ef4444;
}

.form-error {
	display: none;
	font-size: 0.8125rem;
	color: #ef4444;
	margin-top: 0.375rem;
}

.form-error.visible {
	display: block;
}

.form-textarea {
	resize: vertical;
	min-height: 80px;
}

.privacy-options {
	display: flex;
	gap: 1rem;
}

.modal .modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 0.75rem;
	margin-top: 1.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--gray-700);
}
