/*
 * Minimal, mobile-first styling for [ojji_gallery_upload] -- plain classes,
 * no framework assumptions (same approach as gallery.css). A theme can
 * restyle on top of these .ojji-gallery-upload__* classes if it wants to.
 */

.ojji-gallery-upload {
	max-width: 640px;
	margin: 0 auto;
	padding: 1.5rem;
	font-size: 16px; /* prevents iOS Safari auto-zoom on focus */
}

.ojji-gallery-upload__intro {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.25rem;
}

.ojji-gallery-upload__logout {
	font-size: 0.85em;
	white-space: nowrap;
}

.ojji-gallery-upload__notice {
	padding: 0.75rem 1rem;
	border-radius: 8px;
	margin-bottom: 1.25rem;
	font-size: 0.95em;
}

.ojji-gallery-upload__notice--success {
	background: #e6f4ea;
	color: #1e4620;
}

.ojji-gallery-upload__notice--error {
	background: #fbe7e7;
	color: #611a1a;
}

.ojji-gallery-upload__form {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.ojji-gallery-upload__field {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.ojji-gallery-upload__field label {
	font-weight: 600;
}

.ojji-gallery-upload__field select,
.ojji-gallery-upload__field input[type='file'] {
	width: 100%;
	padding: 0.75rem;
	font-size: 1em;
	border: 1px solid #ccc;
	border-radius: 8px;
	background: #fff;
}

/* The dropzone: JS adds this class and a hint paragraph on top of the
   plain field wrapper -- without JS it's just a normal file field. */
.ojji-gallery-upload__dropzone {
	padding: 1.25rem;
	border: 2px dashed #ccc;
	border-radius: 12px;
	background: #fafafa;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.ojji-gallery-upload__dropzone.is-dragover {
	border-color: #14202e;
	background: #f0f0f1;
}

.ojji-gallery-upload__drop-hint {
	margin: 0 0 0.6rem;
	font-size: 0.9em;
	color: #666;
}

.ojji-gallery-upload__grid {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 1.5rem;
}

.ojji-gallery-upload__grid-empty {
	font-size: 0.9em;
	color: #666;
}

.ojji-gallery-upload__thumb {
	position: relative;
	width: 100px;
	height: 100px;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	overflow: hidden;
	background: #f0f0f1;
	transition: opacity 0.15s ease;
}

.ojji-gallery-upload__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ojji-gallery-upload__thumb.is-uploading img {
	opacity: 0.5;
}

.ojji-gallery-upload__thumb.is-uploading::after {
	content: '';
	position: absolute;
	inset: 0;
	border: 3px solid rgba(0, 0, 0, 0.15);
	border-top-color: rgba(0, 0, 0, 0.5);
	border-radius: 50%;
	width: 24px;
	height: 24px;
	margin: auto;
	animation: ojji-gallery-upload-spin 0.7s linear infinite;
}

@keyframes ojji-gallery-upload-spin {
	to {
		transform: rotate(360deg);
	}
}

.ojji-gallery-upload__thumb.is-removing {
	opacity: 0.3;
	pointer-events: none;
}

.ojji-gallery-upload__thumb-remove {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 22px;
	height: 22px;
	line-height: 20px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.65);
	color: #fff;
	font-size: 16px;
	cursor: pointer;
}

.ojji-gallery-upload__submit {
	padding: 0.9rem 1.5rem;
	font-size: 1.05em;
	font-weight: 600;
	border: 0;
	border-radius: 999px;
	background: #14202e;
	color: #fff;
	cursor: pointer;
}

.ojji-gallery-upload__submit:active {
	opacity: 0.85;
}

.ojji-gallery-upload__submit:disabled {
	opacity: 0.6;
	cursor: wait;
}

.ojji-gallery-upload--login .ojji-gallery-upload__intro {
	justify-content: flex-start;
}

.ojji-gallery-upload--login form p {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	margin-bottom: 1rem;
}

.ojji-gallery-upload--login form input[type='text'],
.ojji-gallery-upload--login form input[type='password'] {
	padding: 0.75rem;
	font-size: 1em;
	border: 1px solid #ccc;
	border-radius: 8px;
}

.ojji-gallery-upload--login form .login-submit input {
	padding: 0.9rem 1.5rem;
	font-size: 1.05em;
	font-weight: 600;
	border: 0;
	border-radius: 999px;
	background: #14202e;
	color: #fff;
	cursor: pointer;
}
