/* Moja Galerija - front-end panel stilovi (minimalistički / moderno) */

.mg-panel {
	--mg-ink: #111111;
	--mg-gray: #6e6e6e;
	--mg-line: #e6e6e6;
	--mg-accent: #a8431e;
	--mg-bg-soft: #f7f7f7;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
	color: var(--mg-ink);
	max-width: 1100px;
	margin: 0 auto;
	padding: 20px 0 60px;
}

.mg-panel h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 6px; }
.mg-panel h3 { font-size: 18px; font-weight: 700; margin: 0 0 16px; }

.mg-panel-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 30px;
	padding-bottom: 20px;
	border-bottom: 2px solid var(--mg-ink);
}

.mg-panel-section {
	margin-bottom: 44px;
	padding-bottom: 30px;
	border-bottom: 1px solid var(--mg-line);
}
.mg-panel-section:last-child { border-bottom: none; }

.mg-form { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.mg-field { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }
.mg-field label { font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--mg-gray); font-weight: 700; }
.mg-field input, .mg-field select {
	border: 1px solid #ccc;
	padding: 11px 12px;
	font-size: 15px;
	border-radius: 3px;
	min-width: 220px;
}
.mg-field input:focus, .mg-field select:focus { outline: 2px solid var(--mg-ink); border-color: var(--mg-ink); }

.mg-btn {
	background: var(--mg-ink);
	color: #fff;
	border: none;
	padding: 12px 26px;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	border-radius: 3px;
	cursor: pointer;
	text-decoration: none;
	display: inline-block;
}
.mg-btn:hover { opacity: 0.88; }
.mg-btn-accent { background: var(--mg-accent); }
.mg-btn-outline { background: transparent; color: var(--mg-ink); border: 1px solid var(--mg-ink); }
.mg-btn-danger { background: transparent; color: #b3261e; border: 1px solid #b3261e; }
.mg-btn-small { padding: 8px 16px; font-size: 12px; }
.mg-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.mg-form-msg { margin-left: 10px; font-size: 14px; }
.mg-form-msg.mg-ok { color: #2f7a3d; }
.mg-form-msg.mg-err { color: #b3261e; }

.mg-table { width: 100%; border-collapse: collapse; }
.mg-table th, .mg-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--mg-line); font-size: 14px; vertical-align: middle; }
.mg-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--mg-gray); }

.mg-status { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; background: var(--mg-bg-soft); }
.mg-status-u_pripremi { background: #fdecd2; color: #8a5a00; }
.mg-status-aktivna { background: #ddeeff; color: #0b5394; }
.mg-status-album_poslat { background: #dcf3df; color: #1c6b2e; }

.mg-hint { color: var(--mg-gray); font-size: 13px; }
.mg-empty { color: var(--mg-gray); }

.mg-upload-row td, .mg-edit-row td { background: var(--mg-bg-soft); }
.mg-edit-row .mg-form { padding: 6px 2px; }
[data-mg-uploader] input[type="file"] { margin-bottom: 14px; }
.mg-upload-progress { font-size: 13px; color: var(--mg-gray); margin-bottom: 10px; min-height: 18px; }

.mg-thumbs, .mg-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.mg-thumb img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 3px; }

.mg-selection-counter { display: flex; align-items: center; gap: 14px; font-size: 15px; font-weight: 600; }
.mg-selection-counter span { font-size: 22px; font-weight: 800; color: var(--mg-accent); }

.mg-gallery-item { position: relative; cursor: pointer; border-radius: 4px; overflow: hidden; aspect-ratio: 3/4; border: 3px solid transparent; transition: border-color 0.15s; }
.mg-gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mg-gallery-item .mg-check {
	position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%;
	background: rgba(255,255,255,0.85); color: var(--mg-ink); display: flex; align-items: center; justify-content: center;
	font-size: 14px; opacity: 0; transform: scale(0.7); transition: all 0.15s;
}
.mg-gallery-item.mg-selected { border-color: var(--mg-accent); }
.mg-gallery-item.mg-selected .mg-check { opacity: 1; transform: scale(1); background: var(--mg-accent); color: #fff; }

.mg-vote-btn {
	position: absolute; top: 8px; left: 8px; width: 30px; height: 30px; border-radius: 50%;
	background: rgba(17,17,17,0.45); color: rgba(255,255,255,0.85); border: none; cursor: pointer;
	font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center;
	transition: all 0.15s;
}
.mg-vote-btn:hover { background: rgba(17,17,17,0.7); }
.mg-vote-btn.mg-voted { background: #f0b429; color: #111; }
.mg-vote-btn.mg-vote-disabled { opacity: 0.35; cursor: not-allowed; }
.mg-vote-btn.mg-vote-disabled:hover { background: rgba(17,17,17,0.45); }

.mg-field-checkbox { min-width: 0; flex-basis: 100%; }
.mg-checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; text-transform: none; letter-spacing: normal; font-weight: 500; color: var(--mg-ink); cursor: pointer; }
.mg-checkbox-label input[type="checkbox"] { width: 16px; height: 16px; margin: 0; }

.mg-finder { position: relative; max-width: 480px; }
.mg-finder input[type="text"] { width: 100%; border: 1px solid #ccc; padding: 12px 14px; font-size: 15px; border-radius: 3px; }
.mg-finder input[type="text"]:focus { outline: 2px solid var(--mg-ink); border-color: var(--mg-ink); }
.mg-finder-results {
	position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; background: #fff;
	border: 1px solid var(--mg-line); border-radius: 4px; box-shadow: 0 8px 24px rgba(0,0,0,0.08);
	max-height: 320px; overflow-y: auto;
}
.mg-finder-item {
	display: block; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid var(--mg-line);
	padding: 12px 14px; font-size: 14px; cursor: pointer; font-family: inherit;
}
.mg-finder-item:last-child { border-bottom: none; }
.mg-finder-item:hover { background: var(--mg-bg-soft); }
.mg-finder-empty { padding: 12px 14px; font-size: 13px; color: var(--mg-gray); }

.mg-send-bar { margin-top: 26px; display: flex; align-items: center; gap: 14px; }

.mg-preview-modal {
	position: fixed; inset: 0; background: rgba(17,17,17,0.7); z-index: 9999;
	display: flex; align-items: center; justify-content: center; padding: 24px;
}
.mg-preview-modal[hidden] { display: none; }
.mg-preview-inner { background: #fff; max-width: 700px; width: 100%; max-height: 80vh; border-radius: 6px; padding: 24px; overflow-y: auto; }
.mg-preview-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.mg-btn-close { background: none; border: none; font-size: 26px; cursor: pointer; line-height: 1; }
.mg-preview-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.mg-preview-thumbs img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 3px; }

.mg-success { background: #dcf3df; color: #1c6b2e; padding: 14px 18px; border-radius: 4px; font-weight: 600; }

.mg-auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.mg-auth-grid > div:first-child { border-right: 1px solid var(--mg-line); padding-right: 50px; }
.mg-auth-grid input[type="text"],
.mg-auth-grid input[type="email"],
.mg-auth-grid input[type="password"] { width: 100%; border: 1px solid #ccc; padding: 11px 12px; font-size: 15px; border-radius: 3px; margin-bottom: 4px; }
.mg-auth-grid label { display: block; font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--mg-gray); font-weight: 700; margin-bottom: 6px; }
.mg-auth-grid p.login-remember,
.mg-auth-grid p.login-submit { margin-top: 14px; }

@media (max-width: 640px) {
	.mg-form { flex-direction: column; align-items: stretch; }
	.mg-field, .mg-field input, .mg-field select { min-width: 0; width: 100%; }
	.mg-table { display: block; overflow-x: auto; }
}

@media (max-width: 720px) {
	.mg-auth-grid { grid-template-columns: 1fr; }
	.mg-auth-grid > div:first-child { border-right: none; padding-right: 0; border-bottom: 1px solid var(--mg-line); padding-bottom: 30px; margin-bottom: 10px; }
}
