/**
 * Noggle Fallback UI Styling
 * Styles for calendar, loading animation, error messages, and random button overlays
 *
 * NOTE: Calendar uses CSS Grid layout with div elements
 * All calendar styling is done via inline styles in puzzleFallback.js renderMonthCalendar()
 */

/* Button to show/hide the calendar */
#show-calendar-btn {
	display: none;
	background-color: var(--current-day-blue);
	color: var(--surface);
	font-size: 16px;
	padding: 10px 20px;
	border: none;
	border-radius: 4px;
	cursor: pointer;
}

#show-calendar-btn:hover {
	background-color: var(--current-day-blue-dark);
}

.calendar-wrapper {
	width: 100%;
	max-width: 500px;         /* for example */
	margin: 0 auto;           /* horizontally centers this block */
}

/* Calendar container */
#calendar-container {
	margin: 20px auto;
	border: 1px solid var(--gray-300);
	width: 320px;
	padding: 10px;
	border-radius: 4px;
	background-color: var(--gray-50);
}

/* Hide/show with a simple class toggle */
.hidden {
	display: none;
}

/* Calendar header */
#calendar-header {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 10px;
}

#calendar-header button {
	background-color: transparent;
	border: none;
	font-size: 1.5rem;
	cursor: pointer;
	margin: 0 10px;
}

#calendar-title {
	font-weight: bold;
	font-size: 1.2rem;
}

/* Days of the week labels */
#days-of-week {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	text-align: center;
	font-weight: bold;
	margin-bottom: 5px;
}

/* Calendar grid for days - DISABLED: This CSS conflicts with table-based calendar structure in puzzleFallback.js */
	/*
	#calendar-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 5px;
	margin: 0 auto;
	justify-items: center;
	align-items: center;
	}
	*/

/* Individual day cells */
.day {
	width: 40px;
	height: 40px;
	text-align: center;
	line-height: 40px;
	border-radius: 4px;
	background-color: var(--surface);
	cursor: pointer;
	position: relative;
	font-weight: bold;
	margin: 0 auto;
}

.day:hover {
	background-color: var(--gray-100);
}

/* Days from other months should appear grayed out */
.other-month {
	color: var(--gray-400);
}

/* Completed days get a special style */
.completed {
	background-color: var(--highlight-yellow-pale);
	border: 2px solid var(--gold); /* gold-ish border */
	position: relative;
}

.completed:after {
	content: "👑";
	position: absolute;
	top: -8px;
	right: -6px;
	font-size: 0.8rem;
}

/* Current day highlight (if you want that) */
.current-day {
	border: 2px solid var(--current-day-blue);
}

/* ===== Modal Overlays (Random Button, Error Messages) ===== */

/* Full-screen modal overlay container */
.fallback-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	padding: 20px;
	z-index: 9998;
}

/* Random button modal background gradient */
.fallback-modal.random-puzzle {
	background: linear-gradient(135deg, var(--salmon-50), var(--violet-50));
}

/* Error message modal background gradient */
.fallback-modal.error-message {
	background: linear-gradient(135deg, var(--salmon-50), var(--violet-50));
}

/* Card/panel inside the modal */
.fallback-card {
	background: white;
	padding: 40px;
	border-radius: 12px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.1);
	max-width: 500px;
	text-align: center;
}

.fallback-card h2 {
	font-size: 24px;
	margin: 0 0 16px 0;
	color: #1a1a1a;
}

.fallback-card p {
	font-size: 16px;
	color: #666;
	margin: 0 0 30px 0;
	line-height: 1.5;
}

.fallback-card p.subtext {
	font-size: 13px;
	color: #999;
	margin: 20px 0 0 0;
}

/* Primary action button in modal */
.fallback-btn {
	background: linear-gradient(135deg, var(--salmon-500), var(--salmon-600));
	color: white;
	border: none;
	padding: 14px 28px;
	font-size: 16px;
	font-weight: 600;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 2px 8px rgba(255, 68, 48, 0.3);
}

.fallback-btn:hover {
	box-shadow: 0 4px 12px rgba(255, 68, 48, 0.4);
}

/* Button as link (for error modal) */
.fallback-btn-link {
	background: var(--salmon-500);
	color: white;
	border: none;
	padding: 10px 20px;
	font-size: 14px;
	border-radius: 6px;
	cursor: pointer;
	margin-top: 20px;
	display: inline-block;
	text-decoration: none;
	transition: background 0.2s ease;
}

.fallback-btn-link:hover {
	background: var(--salmon-600);
}

/* Error message specific styles */
.fallback-card.error h2 {
	color: var(--salmon-600);
}

.fallback-card.error p {
	font-size: 14px;
	margin: 0;
}
