/*
 * WP Event Creator - Simplified Stylesheet
 * Disegnato per ereditare lo stile del tema attivo di WordPress per input, bottoni e font.
 */

:root {
	--wpec-radius: 8px;
}

/* ==========================================================================
   Struttura Form
   ========================================================================== */
.wpec-form-container {
	max-width: 800px;
	margin: 2rem auto;
	font-family: inherit;
	color: inherit;
}

.wpec-form-header {
	margin-bottom: 2rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
	padding-bottom: 1rem;
}

.wpec-form-header h2 {
	margin: 0 0 0.5rem 0;
	font-size: 1.75rem;
	font-weight: 700;
}

.wpec-form-header p {
	margin: 0;
	font-size: 0.95rem;
	opacity: 0.8;
}

/* ==========================================================================
   Griglie e Colonne (Layout)
   ========================================================================== */
.wpec-row {
	display: flex;
	flex-wrap: wrap;
	margin-right: -10px;
	margin-left: -10px;
}

.wpec-col {
	position: relative;
	width: 100%;
	padding-right: 10px;
	padding-left: 10px;
	box-sizing: border-box;
}

.wpec-col-6 {
	flex: 0 0 50%;
	max-width: 50%;
}

@media (max-width: 768px) {
	.wpec-col-6 {
		flex: 0 0 100%;
		max-width: 100%;
	}
}

/* ==========================================================================
   Campi Form (Ereditano lo stile del tema)
   ========================================================================== */
.wpec-form-group {
	margin-bottom: 1.25rem;
	box-sizing: border-box;
}

.wpec-form-group label {
	display: block;
	margin-bottom: 0.5rem;
	font-weight: 600;
	font-size: 0.9rem;
}

.wpec-form-group label .required {
	color: #ef4444;
	margin-left: 2px;
}

/* Forza la larghezza dei campi al 100%, ereditando bordi e padding del tema */
.wpec-form-group input[type="text"],
.wpec-form-group input[type="date"],
.wpec-form-group input[type="time"],
.wpec-form-group input[type="url"],
.wpec-form-group input[type="number"],
.wpec-form-group select,
.wpec-form-group textarea {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	display: block;
}

.wpec-form-group textarea {
	resize: vertical;
	min-height: 120px;
}

/* ==========================================================================
   Upload Immagine
   ========================================================================== */
.wpec-image-upload-wrapper {
	position: relative;
	border: 2px dashed rgba(0, 0, 0, 0.15);
	border-radius: var(--wpec-radius);
	padding: 2rem;
	text-align: center;
	background: rgba(0, 0, 0, 0.02);
	transition: all 0.2s ease-in-out;
	cursor: pointer;
}

.wpec-image-upload-wrapper:hover {
	border-color: currentColor;
	background: rgba(0, 0, 0, 0.04);
}

.wpec-image-label {
	display: flex;
	flex-direction: column;
	align-items: center;
	cursor: pointer;
	margin-bottom: 0 !important;
}

.wpec-image-label input[type="file"] {
	display: none;
}

.wpec-upload-icon {
	opacity: 0.6;
	margin-bottom: 0.75rem;
}

.wpec-upload-text span {
	font-weight: 600;
	font-size: 0.95rem;
}

.wpec-upload-text p {
	margin: 0.25rem 0 0 0;
	font-size: 0.8rem;
	opacity: 0.6;
}

/* Anteprima Immagine */
.wpec-image-preview-container {
	position: relative;
	max-width: 100%;
	border-radius: var(--wpec-radius);
	overflow: hidden;
}

.wpec-image-preview-container img {
	display: block;
	max-width: 100%;
	max-height: 250px;
	margin: 0 auto;
	object-fit: contain;
}

.wpec-remove-image-btn {
	position: absolute;
	top: 10px;
	right: 10px;
	background: #ef4444;
	color: white;
	border: none;
	border-radius: 50%;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
	transition: background 0.2s;
}

.wpec-remove-image-btn:hover {
	background: #dc2626;
}

/* ==========================================================================
   Messaggi di Stato
   ========================================================================== */
.wpec-form-message {
	padding: 1rem;
	border-radius: var(--wpec-radius);
	margin-bottom: 1.5rem;
	font-size: 0.9rem;
	font-weight: 500;
	line-height: 1.4;
	box-sizing: border-box;
}

.wpec-msg-success {
	background-color: #ecfdf5;
	border: 1px solid #6ee7b7;
	color: #065f46;
}

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



/* ==========================================================================
   Bottoni (Minimali, per non sovrascrivere lo stile del tema)
   ========================================================================== */
.wpec-form-footer {
	text-align: right;
	margin-top: 2rem;
	border-top: 1px solid rgba(0,0,0,0.1);
	padding-top: 1.5rem;
}

@media (max-width: 576px) {
	.wpec-form-footer {
		text-align: center;
	}
	.wpec-btn {
		width: 100%;
	}
}

/* Spinner di caricamento */
.wpec-spinner {
	display: inline-block;
	width: 18px;
	height: 18px;
	margin-left: 8px;
	border: 2px solid rgba(0, 0, 0, 0.2);
	border-radius: 50%;
	border-top-color: currentColor;
	animation: wpec-spin 0.8s ease-in-out infinite;
}

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

/* ==========================================================================
   Griglia Lista Eventi (Eredita layout ma lascia lo stile al tema)
   ========================================================================== */
.wpec-events-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 2rem;
	margin: 2rem auto;
}

.wpec-event-card {
	border-radius: var(--wpec-radius);
	overflow: hidden;
	border: 1px solid rgba(0, 0, 0, 0.1);
	display: flex;
	flex-direction: column;
	height: 100%;
	background: transparent;
	transition: transform 0.2s ease;
}

.wpec-event-card:hover {
	transform: translateY(-2px);
}

.wpec-card-image-wrapper {
	position: relative;
	height: 200px;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.05);
}

.wpec-card-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Badge della Data */
.wpec-date-badge {
	position: absolute;
	top: 15px;
	left: 15px;
	background: rgba(0, 0, 0, 0.8);
	color: #ffffff;
	padding: 6px 10px;
	border-radius: 4px;
	text-align: center;
}

.wpec-badge-day {
	display: block;
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.1;
}

.wpec-badge-month {
	display: block;
	font-size: 0.65rem;
	font-weight: 600;
	letter-spacing: 1px;
	margin-top: 2px;
}

.wpec-card-content {
	padding: 1.25rem;
	flex-grow: 1;
	display: flex;
	flex-direction: column;
}

.wpec-card-title {
	margin: 0 0 0.75rem 0;
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.3;
}

.wpec-card-title a {
	color: inherit;
	text-decoration: none;
}

.wpec-card-meta {
	margin-bottom: 1rem;
}

.wpec-meta-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.85rem;
	opacity: 0.8;
	margin-bottom: 0.5rem;
}

.wpec-meta-item svg {
	flex-shrink: 0;
}

.wpec-card-excerpt {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.4;
	opacity: 0.8;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.wpec-card-footer {
	padding: 1rem 1.25rem 1.25rem 1.25rem;
	border-top: 1px solid rgba(0,0,0,0.08);
}

.wpec-card-link-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: none;
}

.wpec-empty-state {
	text-align: center;
	padding: 3rem 1.5rem;
	border-radius: var(--wpec-radius);
	border: 2px dashed rgba(0,0,0,0.1);
	margin: 2rem auto;
}

/* Checklist di categorie e tag */
.wpec-checkbox-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.25rem;
	margin-top: 0.5rem;
}

.wpec-checkbox-label {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-weight: normal;
	font-size: 0.9rem;
	cursor: pointer;
	margin-bottom: 0 !important;
}

.wpec-checkbox-label input[type="checkbox"] {
	margin: 0;
	cursor: pointer;
}

/* ==========================================================================
   wpForo Dark Theme Compatibility Styles
   ========================================================================== */
#wpforo-wrap .wpec-form-container {
	max-width: 100%;
	padding: 24px;
	background: rgba(255, 255, 255, 0.02);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: var(--wpec-radius);
	box-sizing: border-box;
}

#wpforo-wrap .wpec-form-container label {
	color: #f3f4f6 !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	margin-bottom: 8px !important;
	display: block !important;
}

#wpforo-wrap .wpec-form-container input[type="text"],
#wpforo-wrap .wpec-form-container input[type="date"],
#wpforo-wrap .wpec-form-container input[type="time"],
#wpforo-wrap .wpec-form-container input[type="url"],
#wpforo-wrap .wpec-form-container input[type="number"],
#wpforo-wrap .wpec-form-container select,
#wpforo-wrap .wpec-form-container textarea {
	width: 100% !important;
	max-width: 100% !important;
	background-color: rgba(255, 255, 255, 0.07) !important;
	border: 1px solid rgba(255, 255, 255, 0.15) !important;
	border-radius: 4px !important;
	padding: 10px 12px !important;
	color: #ffffff !important;
	font-size: 14px !important;
	box-sizing: border-box !important;
	height: auto !important;
	transition: border-color 0.2s, background-color 0.2s;
}

#wpforo-wrap .wpec-form-container input:focus,
#wpforo-wrap .wpec-form-container textarea:focus,
#wpforo-wrap .wpec-form-container select:focus {
	border-color: #38bdf8 !important;
	background-color: rgba(255, 255, 255, 0.1) !important;
	outline: none !important;
}

#wpforo-wrap .wpec-form-container ::placeholder {
	color: rgba(255, 255, 255, 0.35) !important;
}

#wpforo-wrap .wpec-form-container .wpec-checkbox-list {
	display: flex !important;
	flex-wrap: wrap !important;
	gap: 10px 20px !important;
	margin-top: 5px !important;
}

#wpforo-wrap .wpec-form-container .wpec-checkbox-label {
	color: #e5e7eb !important;
	font-size: 14px !important;
	cursor: pointer !important;
	display: inline-flex !important;
	align-items: center !important;
	gap: 6px !important;
}

#wpforo-wrap .wpec-form-container .wpec-image-upload-wrapper {
	background: rgba(255, 255, 255, 0.02) !important;
	border: 2px dashed rgba(255, 255, 255, 0.15) !important;
	color: #d1d5db !important;
}

#wpforo-wrap .wpec-form-container .wpec-image-upload-wrapper:hover {
	border-color: #38bdf8 !important;
	background: rgba(255, 255, 255, 0.04) !important;
}

#wpforo-wrap .wpec-form-container .wpec-btn {
	background-color: #1e293b !important;
	color: #ffffff !important;
	border: 1px solid rgba(255, 255, 255, 0.2) !important;
	padding: 10px 24px !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	border-radius: 4px !important;
	cursor: pointer !important;
	transition: all 0.2s ease !important;
	display: inline-block !important;
}

#wpforo-wrap .wpec-form-container .wpec-btn:hover {
	background-color: #38bdf8 !important;
	border-color: #38bdf8 !important;
	color: #0f172a !important;
}

/* ==========================================================================
   Messaggio di successo post-invio (sostituisce il form)
   ========================================================================== */
.wpec-success-container {
	background: #ecfdf5;
	border: 1px solid #10b981;
	border-radius: var(--wpec-radius);
	padding: 1.5rem 2rem;
	margin: 2rem auto;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
	box-sizing: border-box;
}

.wpec-success-message-wrapper {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	flex-wrap: wrap;
}

.wpec-success-text {
	font-size: 1.1rem;
	font-weight: 600;
	color: #065f46;
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.wpec-success-text::before {
	content: "✓";
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	background-color: #10b981;
	color: white;
	border-radius: 50%;
	font-size: 0.85rem;
	font-weight: bold;
}

/* Stile wpForo per il pulsante (stile fallback primario) */
.wpf-button {
	background-color: #1e73be;
	color: #ffffff !important;
	border: none;
	padding: 10px 20px;
	font-size: 0.95rem;
	font-weight: 600;
	border-radius: 3px;
	cursor: pointer;
	transition: background-color 0.15s ease-in-out;
	text-decoration: none;
	display: inline-block;
	line-height: 1.4;
}

.wpf-button:hover {
	background-color: #155a96;
}

/* Integrazione dark mode wpForo per il container di successo */
#wpforo-wrap .wpec-success-container {
	background: rgba(255, 255, 255, 0.02) !important;
	border: 1px solid #10b981 !important;
}

#wpforo-wrap .wpec-success-text {
	color: #34d399 !important;
}

/* ==========================================================================
   Layout e Calendario Mensile per la Pagina Meetings
   ========================================================================== */
.wpec-meetings-layout {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	margin: 2rem 0;
	box-sizing: border-box;
}

.wpec-meetings-sidebar {
	width: 100%;
}

.wpec-meetings-main {
	width: 100%;
	min-width: 0;
}

/* Card del Calendario */
.wpec-calendar-card {
	background: #ffffff;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: var(--wpec-radius);
	padding: 1.25rem;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
	box-sizing: border-box;
	max-width: 340px;
	margin: 0 auto;
}

.wpec-calendar-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1.25rem;
}

.wpec-calendar-header h4 {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
	text-align: center;
	line-height: 1.2;
}

.wpec-calendar-nav {
	background: transparent;
	border: none;
	border-radius: 50%;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: inherit;
	transition: background-color 0.2s, opacity 0.2s;
	opacity: 0.8;
	padding: 0;
	margin: 0;
	user-select: none;
	-webkit-user-select: none;
}

.wpec-calendar-nav:hover {
	background: rgba(0, 0, 0, 0.05);
	opacity: 1;
}

.wpec-calendar-nav svg {
	display: block;
}

/* Griglie e celle del Calendario */
.wpec-calendar-weekdays,
.wpec-calendar-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
	text-align: center;
}

.wpec-calendar-weekdays {
	margin-bottom: 8px;
}

.wpec-cal-weekday {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	opacity: 0.5;
	padding: 4px 0;
}

.wpec-cal-day {
	background: transparent;
	border: none;
	border-radius: 50%;
	aspect-ratio: 1 / 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	font-size: 0.85rem;
	font-weight: 500;
	cursor: default;
	color: inherit;
	position: relative;
	transition: background-color 0.2s, color 0.2s;
	padding: 0;
	margin: 0;
	outline: none;
	user-select: none;
	-webkit-user-select: none;
}

/* Giorni inattivi (del mese precedente/successivo) */
.wpec-cal-inactive {
	opacity: 0.3;
}

/* Hover per giorni cliccabili */
.wpec-cal-has-events {
	cursor: pointer;
	font-weight: 700;
}

.wpec-cal-has-events:hover {
	background-color: rgba(0, 0, 0, 0.04);
}

/* Oggi */
.wpec-cal-today {
	border: 1px solid currentColor;
}

/* Giorno Selezionato */
.wpec-cal-selected,
.wpec-cal-selected:hover {
	background-color: #1e73be !important;
	color: #ffffff !important;
}

/* Dot indicatore dell'evento */
.wpec-cal-dot {
	display: block;
	width: 4px;
	height: 4px;
	background-color: #1e73be;
	border-radius: 50%;
	position: absolute;
	bottom: 4px;
	left: 50%;
	transform: translateX(-50%);
	transition: background-color 0.2s;
}

.wpec-cal-selected .wpec-cal-dot {
	background-color: #ffffff;
}

/* Banner del Filtro */
.wpec-filter-banner {
	background: #f0f9ff;
	border: 1px solid #bae6fd;
	border-radius: var(--wpec-radius);
	padding: 0.75rem 1.25rem;
	margin-bottom: 1.5rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	font-size: 0.9rem;
	color: #0369a1;
	box-shadow: 0 1px 3px rgba(0,0,0,0.05);
	box-sizing: border-box;
}

.wpec-filter-info {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.wpec-filter-info svg {
	flex-shrink: 0;
}

.wpec-clear-filter-btn {
	background: transparent;
	border: none;
	color: #0369a1;
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 4px 8px;
	border-radius: 4px;
	transition: background-color 0.15s;
}

.wpec-clear-filter-btn:hover {
	background-color: rgba(3, 105, 161, 0.08);
}

/* wpForo Dark Theme Integration */
#wpforo-wrap .wpec-calendar-card {
	background: rgba(255, 255, 255, 0.02) !important;
	border: 1px solid rgba(255, 255, 255, 0.06) !important;
	color: #ffffff !important;
}

#wpforo-wrap .wpec-calendar-nav:hover {
	background: rgba(255, 255, 255, 0.08) !important;
}

#wpforo-wrap .wpec-cal-has-events:hover {
	background-color: rgba(255, 255, 255, 0.08) !important;
}

#wpforo-wrap .wpec-cal-selected,
#wpforo-wrap .wpec-cal-selected:hover {
	background-color: #38bdf8 !important;
	color: #0f172a !important;
}

#wpforo-wrap .wpec-cal-dot {
	background-color: #38bdf8 !important;
}

#wpforo-wrap .wpec-cal-selected .wpec-cal-dot {
	background-color: #0f172a !important;
}

#wpforo-wrap .wpec-filter-banner {
	background: rgba(56, 189, 248, 0.08) !important;
	border: 1px solid rgba(56, 189, 248, 0.25) !important;
	color: #38bdf8 !important;
}

#wpforo-wrap .wpec-clear-filter-btn {
	color: #38bdf8 !important;
}

#wpforo-wrap .wpec-clear-filter-btn:hover {
	background-color: rgba(56, 189, 248, 0.15) !important;
}

.wpec-calendar-footer {
	text-align: center;
	margin-top: 12px;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	padding-top: 8px;
}

.wpec-calendar-today-btn {
	display: inline-block;
	font-size: 0.8rem;
	font-weight: 600;
	color: #1e73be;
	cursor: pointer;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	transition: opacity 0.2s;
	user-select: none;
	-webkit-user-select: none;
}

.wpec-calendar-today-btn:hover {
	opacity: 0.8;
}

/* wpForo Dark Mode override for Today button */
#wpforo-wrap .wpec-calendar-footer {
	border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

#wpforo-wrap .wpec-calendar-today-btn {
	color: #38bdf8 !important;
}
