/* ====== Base (Desktop) ====== */
body {
	font-family: Arial, sans-serif;
	max-width: 900px;
	margin: 40px auto;
	padding: 20px;
	background: #fefefe;
	color: #333;
	font-size: 18px;
	line-height: 1.6;
}

h1 {
	text-align: center;
	font-size: 40px;
	margin-bottom: 30px;
}

.notice {
	font-size: 16px;
	color: #555;
	margin-bottom: 20px;
	padding: 12px;
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 8px;
}

#stats {
	background: #f0f8ff;
	padding: 16px;
	border-radius: 8px;
	border: 1px solid #ccc;
	margin-bottom: 20px;
	font-size: 17px;
}

.calendar-container {
	margin-top: 20px;
}

.weekdays {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	text-align: center;
	font-weight: bold;
	margin-bottom: 6px;
	font-size: 18px;
}

.calendar-header {
	grid-column: span 7;
	text-align: center;
	margin-bottom: 20px;
	font-size: 28px;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 20px;
}

.nav-btn {
	font-size: 28px;
	background: none;
	border: none;
	cursor: pointer;
	color: #0f2ee0;
}
.nav-btn:hover { color: #0891e0; }

.month-label {
	font-weight: bold;
	font-size: 28px;
}

.calendar {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 6px;
}

.day {
	border: 1px solid #ddd;
	padding: 14px;
	min-height: 80px;
	cursor: pointer;
	position: relative;
	border-radius: 8px;
	font-size: 16px;
	display: flex;
	align-items: flex-start;
	justify-content: flex-end;
}
.day:hover { background: #f5f5f5; }

.today { border: 2px solid #000; }
.period { background: #ffb3ba; }
.fertile { background: #baffc9; }
.ovulation { background: #bae1ff; font-weight: bold; }
.predicted { background: #dab6fc; }

.day span {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 26px;
}

/* ====== Actions buttons (bottom bar style) ====== */
.actions {
	margin-top: 20px;
	display: flex;
	gap: 10px;
}

.actions button {
	flex: 1;
	box-sizing: border-box;
	white-space: nowrap;     
	text-overflow: ellipsis;
	overflow: hidden;
	padding: 1em;
	cursor: pointer;
	border: none;
	background: #4CAF50;
	color: white;
	border-radius: 10px;
	transition: background 0.2s;
	font-size: clamp(14px, 2vw, 20px);
}
.actions button:hover { background: #45a049; }

/* ====== Popup ====== */
.popup {
	position: fixed;
	top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	background: white;
	padding: 20px;
	border: 1px solid #ccc;
	border-radius: 10px;
	box-shadow: 0 6px 16px rgba(0,0,0,0.25);
	z-index: 1000;
	display: none;
	max-width: 400px;
	font-size: 20px;
	text-align: center;
}
.popup h3 {
	margin-top: 0;
	font-size: 24px;
}
.popup button {
	margin: 8px 0;
	width: 100%;
	padding: 12px;
	border-radius: 8px;
	border: none;
	cursor: pointer;
	font-size: clamp(14px, 2vw, 18px);
	background: linear-gradient(135deg, #bae1ff, #89c2f0);
	color: #023e8a;
	font-weight: bold;
	white-space: nowrap;
	text-overflow: ellipsis;
	overflow: hidden;
	transition: background 0.2s, transform 0.1s;
}
.popup button:hover {
	background: linear-gradient(135deg, #89c2f0, #0077b6);
	transform: scale(1.03);
}

.overlay {
	position: fixed;
	top:0; left:0; right:0; bottom:0;
	background: rgba(0,0,0,0.4);
	display: none;
	z-index: 999;
}

#goBackBtn {
	padding: 10px 16px;
	font-size: 16px;
	background: #ff7f50;
	color: white;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	margin: 20px auto 40px; /* space above and below */
	display: block; /* center it */
	transition: background 0.2s ease, transform 0.1s ease;
}

#goBackBtn:hover {
	background: #ff6347;
	transform: scale(1.03);
}

/* ====== Mobile (<= 1080px) ====== */
@media (max-width: 1080px) {
	body {
		max-width: 100%;
		margin: 0;
		padding: 14px;
		font-size: 16px;
	}

	h1 {
		font-size: 32px;
		margin-bottom: 20px;
	}

	.notice {
		font-size: 15px;
		padding: 12px;
		margin-bottom: 18px;
	}

	#stats {
		font-size: 15px;
		padding: 14px;
		margin-bottom: 18px;
	}

	.weekdays {
		font-size: 16px;
	}

	.calendar-header {
		font-size: 32px;
		gap: 14px;
		margin-bottom: 18px;
	}
	.nav-btn { font-size: 34px; }
	.month-label { font-size: 32px; }

	.calendar {
		gap: 5px;
	}

	.day {
		min-height: 30px;
		font-size: 20px;
		padding: 10px;
	}
	.day span { font-size: 20px; }

	.actions button {
		font-size: clamp(14px, 4vw, 18px);
		padding: 10px;
		border-radius: 10;
	}

	.popup {
		max-width: 95%;
		padding: 18px;
		font-size: 14px;
		border-radius: 12px;
	}
	.popup h3 {
		font-size: 18px;
		margin-bottom: 14px;
	}
	.popup button {
		font-size: clamp(14px, 4vw, 16px);
		padding: 10px;
		margin: 10px 0;
	}
}
