/**
 * VotePress Frontend Stylesheet
 */

.vote-press-container {
	margin: 2rem 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	color: #1e293b;
}

/* Header & Toolbar */
.vote-press-header {
	margin-bottom: 1.5rem;
}

.vote-press-countdown {
	margin-bottom: 1rem;
	padding: 0.75rem 1rem;
	background: #eff6ff;
	border-left: 4px solid #2563eb;
	border-radius: 4px;
	color: #1e40af;
	font-size: 0.95rem;
}

.vote-press-alert {
	padding: 0.75rem 1rem;
	border-radius: 4px;
	margin-bottom: 1rem;
}

.vote-press-alert-info {
	background: #f1f5f9;
	color: #475569;
	border-left: 4px solid #94a3b8;
}

.vote-press-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 1rem;
}

.vote-press-toolbar-left {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.vp-submit-limit-text {
	font-size: 0.85rem;
	color: #64748b;
	font-weight: 500;
}

.vote-press-filters {
	display: flex;
	gap: 0.5rem;
	margin-left: auto;
}

/* Green Submit Button */
.vote-press-container .vp-btn-submit-green {
	background: #10b981 !important;
	color: #ffffff !important;
	border-color: #059669 !important;
	font-weight: 600;
	box-shadow: 0 1px 2px rgba(16, 185, 129, 0.2);
}

.vote-press-container .vp-btn-submit-green:hover:not(:disabled),
.vote-press-container .vp-btn-submit-green:focus {
	background: #059669 !important;
	border-color: #047857 !important;
	color: #ffffff !important;
}

/* Base Buttons */
.vote-press-container .vp-btn,
.vp-modal .vp-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.5rem 1rem;
	font-size: 0.875rem;
	font-weight: 500;
	border-radius: 6px;
	border: 1px solid #cbd5e1 !important;
	background: #ffffff !important;
	color: #334155 !important;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.15s ease-in-out;
}

.vote-press-container .vp-btn:hover:not(:disabled),
.vote-press-container .vp-btn:focus,
.vp-modal .vp-btn:hover:not(:disabled),
.vp-modal .vp-btn:focus {
	background: #f1f5f9 !important;
	border-color: #94a3b8 !important;
	color: #0f172a !important;
}

.vote-press-container .vp-filter-btn.active,
.vote-press-container .vp-filter-btn.active:hover,
.vote-press-container .vp-filter-btn.active:focus {
	background: #2563eb !important;
	color: #ffffff !important;
	border-color: #2563eb !important;
}

.vote-press-container .vp-btn-primary,
.vp-modal .vp-btn-primary {
	background: #2563eb !important;
	color: #ffffff !important;
	border-color: #2563eb !important;
}

.vote-press-container .vp-btn-primary:hover:not(:disabled),
.vote-press-container .vp-btn-primary:focus,
.vp-modal .vp-btn-primary:hover:not(:disabled),
.vp-modal .vp-btn-primary:focus {
	background: #1d4ed8 !important;
	border-color: #1d4ed8 !important;
	color: #ffffff !important;
}

.vote-press-container .vp-btn-vote {
	background: #fff1f2 !important;
	color: #e11d48 !important;
	border-color: #fecdd3 !important;
	font-weight: 600;
}

.vote-press-container .vp-btn-vote:hover:not(:disabled),
.vote-press-container .vp-btn-vote:focus {
	background: #ffe4e6 !important;
	border-color: #fda4af !important;
	color: #be123c !important;
}

.vote-press-container .vp-btn-vote.voted,
.vote-press-container .vp-btn-vote.voted:hover {
	background: #e11d48 !important;
	color: #ffffff !important;
	border-color: #e11d48 !important;
	cursor: default;
}

/* Grid Layout */
.vote-press-grid {
	display: grid;
	gap: 1.5rem;
}

.vote-press-grid.vp-cols-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.vote-press-grid.vp-cols-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.vote-press-grid.vp-cols-4 { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }

/* Card */
.vp-card {
	background: #ffffff;
	border-radius: 8px;
	border: 1px solid #e2e8f0;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	display: flex;
	flex-direction: column;
}

.vp-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.vp-card-media {
	position: relative;
	width: 100%;
	padding-top: 75%; /* 4:3 aspect ratio */
	background: #0f172a;
	overflow: hidden;
	cursor: pointer;
}

.vp-card-media img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.vp-card:hover .vp-card-media img {
	transform: scale(1.03);
}

.vp-badge-pick {
	position: absolute;
	top: 10px;
	left: 10px;
	background: rgba(234, 179, 8, 0.95);
	color: #ffffff;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 0.75rem;
	font-weight: 600;
	box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.vp-zoom-btn {
	position: absolute;
	bottom: 10px;
	right: 10px;
	background: rgba(0,0,0,0.6);
	color: #fff;
	border: none;
	border-radius: 50%;
	width: 32px;
	height: 32px;
	cursor: pointer;
	font-size: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.vp-card-media:hover .vp-zoom-btn {
	opacity: 1;
}

.vp-card-body {
	padding: 1rem;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

.vp-card-title {
	margin: 0 0 0.25rem 0;
	font-size: 1.05rem;
	font-weight: 600;
	color: #0f172a;
}

.vp-card-author {
	margin: 0 0 1rem 0;
	font-size: 0.85rem;
	color: #64748b;
}

.vp-card-footer {
	margin-top: auto;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

/* Sharing Dropdown */
.vp-share-group {
	position: relative;
}

.vp-share-btn {
	background: none;
	border: none;
	font-size: 1.1rem;
	cursor: pointer;
	padding: 4px;
	color: #64748b;
}

.vp-share-btn:hover {
	color: #0f172a;
}

.vp-share-dropdown {
	position: absolute;
	right: 0;
	bottom: 120%;
	background: #ffffff;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
	padding: 6px 0;
	min-width: 140px;
	z-index: 50;
}

.vp-share-link {
	display: block;
	width: 100%;
	padding: 6px 12px;
	font-size: 0.8rem;
	color: #334155;
	text-decoration: none;
	text-align: left;
	background: none;
	border: none;
	cursor: pointer;
}

.vp-share-link:hover {
	background: #f1f5f9;
	color: #0f172a;
}

/* Pagination */
.vote-press-pagination {
	text-align: center;
	margin-top: 2rem;
}

/* Modals & Lightbox */
.vp-modal, .vp-lightbox {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.vp-modal-backdrop, .vp-lightbox-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(15, 23, 42, 0.8);
	backdrop-filter: blur(4px);
}

.vp-modal-dialog {
	position: relative;
	background: #ffffff;
	border-radius: 8px;
	width: 90%;
	max-width: 520px;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
	z-index: 1;
}

.vp-modal-header {
	padding: 1rem 1.25rem;
	border-bottom: 1px solid #e2e8f0;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.vp-modal-header h3 {
	margin: 0;
	font-size: 1.2rem;
}

.vp-modal-close, .vp-lightbox-close {
	background: none;
	border: none;
	font-size: 1.5rem;
	cursor: pointer;
	color: #64748b;
}

.vp-submit-form {
	padding: 1.25rem;
}

.vp-form-group {
	margin-bottom: 1rem;
}

.vp-form-group label {
	display: block;
	font-size: 0.85rem;
	font-weight: 600;
	margin-bottom: 0.25rem;
}

.vp-input {
	width: 100%;
	padding: 0.5rem 0.75rem;
	border: 1px solid #cbd5e1;
	border-radius: 4px;
	font-size: 0.9rem;
	box-sizing: border-box;
}

.vp-image-preview img {
	max-width: 100%;
	max-height: 200px;
	margin-top: 0.5rem;
	border-radius: 4px;
	object-fit: cover;
}

.vp-form-help {
	font-size: 0.75rem;
	color: #64748b;
	margin-top: 0.25rem;
	display: block;
}

.vp-form-message {
	margin-top: 1rem;
	padding: 0.75rem;
	border-radius: 4px;
	font-size: 0.85rem;
}

.vp-msg-success {
	background: #ecfdf5;
	color: #065f46;
	border: 1px solid #a7f3d0;
}

.vp-msg-error {
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

/* Lightbox Content */
.vp-lightbox-content {
	position: relative;
	z-index: 1;
	max-width: 90vw;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.vp-lightbox-img-wrapper img {
	max-width: 85vw;
	max-height: 75vh;
	object-fit: contain;
	border-radius: 6px;
}

.vp-lightbox-close {
	position: absolute;
	top: -35px;
	right: 0;
	color: #ffffff;
	font-size: 2rem;
}

.vp-lightbox-info {
	background: rgba(15, 23, 42, 0.85);
	backdrop-filter: blur(8px);
	padding: 0.5rem 1rem;
	border-radius: 8px;
	margin-top: 0.5rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.25rem;
	width: 100%;
	max-width: 85vw;
	box-sizing: border-box;
	color: #ffffff;
}

.vp-lightbox-meta {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	flex-grow: 1;
	font-size: 0.9rem;
}

.vp-lightbox-title {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 600;
	color: #ffffff;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.vp-lightbox-sep {
	color: #94a3b8;
}

.vp-lightbox-author {
	margin: 0;
	font-size: 0.85rem;
	color: #cbd5e1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.vp-lightbox-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-shrink: 0;
}

.vp-btn-lightbox-action {
	background: rgba(255, 255, 255, 0.15) !important;
	border: 1px solid rgba(255, 255, 255, 0.25) !important;
	color: #ffffff !important;
	padding: 0.35rem 0.65rem !important;
	font-size: 0.8rem !important;
	border-radius: 6px;
	cursor: pointer;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	transition: all 0.15s ease;
}

.vp-btn-lightbox-action:hover,
.vp-btn-lightbox-action:focus {
	background: rgba(255, 255, 255, 0.25) !important;
	border-color: rgba(255, 255, 255, 0.4) !important;
	color: #ffffff !important;
}

.vp-lightbox-share-dropdown {
	position: absolute;
	right: 0;
	bottom: 125%;
	background: #ffffff;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
	padding: 4px 0;
	min-width: 140px;
	z-index: 100;
}

.vp-lightbox-share-dropdown .vp-share-link {
	color: #1e293b !important;
}

.vp-lightbox-share-dropdown .vp-share-link:hover {
	background: #f1f5f9;
}

@media (max-width: 640px) {
	.vp-lightbox-info {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.5rem;
	}
	.vp-lightbox-meta {
		flex-wrap: wrap;
	}
	.vp-lightbox-actions {
		width: 100%;
		justify-content: flex-end;
	}
}

/* Loading spinner */
.vote-press-loading {
	text-align: center;
	padding: 2rem;
	color: #64748b;
	grid-column: 1 / -1;
}

.vp-spinner {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 3px solid #cbd5e1;
	border-radius: 50%;
	border-top-color: #2563eb;
	animation: vp-spin 0.8s linear infinite;
}

/* Dynamic Photo Slots & Form Section */
.vp-photos-slots {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-bottom: 1.25rem;
}

.vp-photo-slot {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	padding: 1rem;
	transition: all 0.2s ease;
}

.vp-photo-slot.vp-photo-slot-added {
	border-color: #93c5fd;
	background: #f0f7ff;
	animation: vp-slot-appear 0.25s ease-out;
}

@keyframes vp-slot-appear {
	from { opacity: 0; transform: translateY(-6px); }
	to { opacity: 1; transform: translateY(0); }
}

.vp-slot-header {
	margin-bottom: 0.75rem;
	color: #1e40af;
	font-size: 0.95rem;
}

.vp-form-section-title {
	margin: 1.5rem 0 1rem 0;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid #e2e8f0;
}

.vp-form-section-title h4 {
	margin: 0;
	font-size: 1rem;
	color: #0f172a;
}

@keyframes vp-spin {
	to { transform: rotate(360deg); }
}
