/*
 * Adventi – Advent Calendar & Lead Generator Plugin
 * Frontend Stylesheet
 *
 * Author: Adventi
 * Version: 1.0.0
 * License: GPL-2.0+
 *
 * --------------------------------------------------------------
 * TABLE OF CONTENTS
 * --------------------------------------------------------------
 *  1. Variables & Palettes
 *  2. Plugin Wrapper
 *  3. Modal Layout
 *  4. Registration Form
 *  5. Calendar Grid
 *  6. Day Buttons
 *  7. Gift Modal
 *  8. custom Palette Handling
 *  9. Snow Effect
 * 10. Responsive
 * --------------------------------------------------------------
 */

/*--------------------------------------------------------------
1. VARIABLES & PALETTES
--------------------------------------------------------------*/

/* DEFAULT palette (classic) */
.adventi-plugin.palette-classic {
	--adventi-primary: #690700;
	--adventi-secondary: #125b23;
	--adventi-tertiary: #ffffff;

	--adventi-text: #fff;
	--adventi-dark-text: #690700;
	--unlocked-bg: url(../img/unlocked-classic-bg.png);
}

/* BLUE FROST + DOGGO_CLAUS shared */
.adventi-plugin.palette-doggo_claus,
.adventi-plugin.palette-snow_blue {
	--adventi-primary: #5173af;
	--adventi-secondary: #2b3d7e;
	--adventi-tertiary: #7acbe8;

	--adventi-dark-text: #5173af;
	--adventi-text: #140e87;
	--unlocked-bg: url(../img/unlocked-cold-bg.png);
}

/* DOGGO override */
.adventi-plugin.palette-doggo_claus {
	--unlocked-bg: url(../img/unlocked-doggo-bg.png);
}

/* WARM COOKIES */
.adventi-plugin.palette-cozy_xmas {
	--adventi-primary: #fff;
	--adventi-secondary: #ba803d;
	--adventi-tertiary: #556f59;

	--adventi-text: #6e0806;
	--adventi-dark-text: #e1f5f8;
	--unlocked-bg: url(../img/unlocked-cozy-bg.png);
}


/*--------------------------------------------------------------
1. SNOW EFFECT (placed early because it's global)
--------------------------------------------------------------*/
#adventi-snow {
	position: fixed;
	pointer-events: none;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	z-index: 999999;
}

.adventi-snowflake {
	position: absolute;
	top: -10px;
	color: white;
	font-size: 8px;
	opacity: 0.8;
	animation: adventiFall linear infinite;
}

@keyframes adventiFall {
	0% {
		transform: translateY(0) rotate(0deg);
	}

	100% {
		transform: translateY(110vh) rotate(360deg);
	}
}

/*--------------------------------------------------------------
2. PLUGIN WRAPPER
--------------------------------------------------------------*/
.adventi-plugin {
	width: 100vw;
	height: 100vh;
	position: fixed;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.65);
	z-index: 999999;

	opacity: 0;
	pointer-events: none;
	transition: opacity 0.4s ease;

	--font-title: 'Abril Fatface', serif;
	--font-second-title: 'Lobster', sans-serif;
	--font-body: 'Google Sans Flex', sans-serif;
	--font-script: 'Playwrite CZ', sans-serif;
}

.adventi-plugin.visible {
	opacity: 1;
	pointer-events: all;
}



/*--------------------------------------------------------------
3. MODAL LAYOUT
--------------------------------------------------------------*/

.adventi-plugin.palette-classic .adventi-modal.closed .adventi-modal__content .adventi-modal-registration .invitation,
.adventi-plugin.palette-classic .adventi-modal.closed .adventi-modal__inner .adventi-modal__top .card-title {
	color: var(--adventi-dark-text);
}

.adventi-modal {
	position: relative;
	background-image: url(../img/adventi-bg.jpg);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	padding: 60px 40px;
	max-width: 1100px;
	width: 100%;
	margin: 0 auto;
}

.adventi-modal.unlocked {
	position: relative;
	background-image: var(--unlocked-bg);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	padding: 60px 40px;
	max-width: 1100px;
	width: 100%;
	margin: 0 auto;
}


.adventi-modal__top p {
	color: var(--adventi-text);
	font-family: var(--font-second-title);
	text-align: center;
	font-size: 65px;
	margin: 0;
}

.adventi-modal .developed-by {
	color: var(--adventi-text);
	font-size: 18px;
	font-weight: 700;
	text-decoration: none;
	margin-left: 25px;
}

.adventi-modal.unlocked .developed-by {
	margin-left: 0px;
}

.adventi-modal .developed-by:hover {
	text-decoration: underline;
}

.adventi-modal .invitation {
	color: var(--adventi-text);
	font-family: var(--font-second-title);
	font-size: 35px;

}

.adventi-modal__close {
	font-family: var(--font-second-title);
	position: absolute;
	right: 40px;
	top: 40px;
	font-weight: 700;
	color: var(--adventi-secondary);
	cursor: pointer;
	font-size: 35px;
}

/* Classic override */
.adventi-plugin.palette-classic .adventi-modal__close {
	color: #fff;
}

/* Closed (before unlocking) */
.adventi-modal.closed .card-title,
.adventi-modal.closed .invitation,
.adventi-modal.closed .developed-by,
.adventi-modal.closed .adventi-modal__close {
	color: #a50401;
}


/* FLEX container of modal */
.adventi-modal__content {
	max-width: 1100px;
	width: 100%;
	display: flex;
	flex-flow: row wrap;
	justify-content: space-between;
	align-items: stretch;
}

.adventi-modal.unlocked .adventi-modal__content {
	align-items: center;
}

.adventi-day__button[data-has-image="1"] {
	background-size: cover;
	background-position: center;
	color: transparent;
}

.adventi-day__button[data-has-image="1"] .adventi-day__number {
	display: none !important;
}

/*--------------------------------------------------------------
4. REGISTRATION FORM
--------------------------------------------------------------*/
.adventi-modal-registration {
	display: flex;
	flex-direction: column;
	flex: 0 0 40%;
	justify-content: center;
}

.adventi-modal-registration h2 {
	font-family: var(--font-body);
}

.adventi-modal-registration input,
.adventi-modal-registration button {
	height: 20px;
	border: none;
	width: 90%;
	margin: 5px 0;
	padding: 15px;
}

.adventi-modal-registration input[type="checkbox"] {
	width: fit-content;
}

.adventi-modal-registration #terms-text {
	margin: 0;
	font-size: 14px;
	text-shadow: none;
}

.adventi-modal-registration button {
	width: 95%;
	height: auto;
	text-transform: uppercase;
	background-color: #7ea75c;
	letter-spacing: 2px;
	font-weight: 600;
	color: #fff;
	cursor: pointer;
}

.adventi-modal-registration .accept-terms {
	display: flex;
	align-items: center;
}

.adventi-modal-registration .accept-terms #terms-text {
	margin-left: 10px;
}

/*--------------------------------------------------------------
5. CALENDAR GRID
--------------------------------------------------------------*/
.adventi-calendar-container {
	flex: 0 0 55%;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	max-width: 100%;
	margin: 20px auto;
}

.adventi-calendar-container.locked .adventi-day__button {
	filter: brightness(0.4);
	cursor: not-allowed;
	pointer-events: auto;
}

.adventi-calendar-container.locked .adventi-day__number {
	opacity: 0.7;
}

/*--------------------------------------------------------------
6. DAY BUTTONS
--------------------------------------------------------------*/
.adventi-day {
	position: relative;
}

.adventi-day__button {
	width: 100%;
	min-height: 82px;
	height: 100%;
	padding: 24px 0;
	border: none;
	background: var(--adventi-tertiary);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	color: var(--adventi-dark-text);
	font-size: 1.6rem;
	font-weight: 700;
	cursor: pointer;
	transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.adventi-day__button:hover {
	filter: brightness(50%);
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.adventi-day:nth-child(3n + 2) .adventi-day__button {
	background: var(--adventi-secondary);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

.adventi-day:nth-child(3n + 3) .adventi-day__button {
	background: var(--adventi-primary);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	color: var(--adventi-text);
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Snow blue override */
.adventi-plugin.palette-snow_blue .adventi-day:nth-child(3n + 3) .adventi-day__button {
	color: #fff;
}

.adventi-day.future-day {
	opacity: 0.55;
}

.adventi-day.future-day button:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
	opacity: 0.55;
}

/*--------------------------------------------------------------
7. GIFT MODAL
--------------------------------------------------------------*/
.adventi-gift-modal {
	flex: 1 0 45%;
	text-align: center;
	color: var(--adventi-text);
}

.adventi-gift-modal.hidden {
	display: none;
}

.adventi-gift-modal__content {
	width: 100%;
}

.adventi-gift-day {
	font-family: var(--font-second-title);
	font-weight: 600;
	font-size: 45px;
	margin: 0;
}

.adventi-gift-description {
	font-family: var(--font-body);
}

.adventi-gift-code {
	font-family: var(--font-body);
	font-weight: 700;
	letter-spacing: 1px;
	padding: 10px 30px;
	background-color: #fff;
	color: #000;
	border: 2px #000 dashed;
	width: fit-content;
	margin: 0 auto;
}

.adventi-gift-url {
	display: block;
	font-weight: 700;
	margin-top: 15px;
}

/*--------------------------------------------------------------
8. RESPONSIVE
--------------------------------------------------------------*/
@media (max-width: 767px) {
	.adventi-plugin {
		max-width: calc(100vw - 40px);
		width: 100%;
		padding: 0 20px;
	}

	.adventi-modal {
		padding: 40px 20px;
	}

	.adventi-calendar-container {
		gap: 5px;
		width: 100%;
	}

	.adventi-modal .card-title {
		font-size: 38px;
		margin-top: 40px;
	}

	.adventi-modal__content {
		flex-direction: column;
	}

	.adventi-modal.closed .developed-by {
		margin-left: 0px;
	}
	.adventi-modal.closed .invitation {
		margin: 8px 0px;
	}

	.adventi-calendar-container {
		flex: 1 0 100%;
		margin: 10px 0;
	}

	.adventi-day__button {
		padding: 10px 0;
		min-height: 22px;
	}

	.adventi-day__number {
		font-size: 1.2rem;
	}
}