html {
	scrollbar-gutter: stable;
}

/* --- 90s Unified Theme --- */
:root {
	--bg-color: blanchedalmond;
	--text-color: darkslategray;
	--link-color: blue;
	--link-hover: red;
	--border-color: #999;
	--panel-bg: #fff;
	--shadow: 4px 4px 0px rgba(0, 0, 0, 0.2);
}

* {
	box-sizing: border-box;
}

body {
	background-color: var(--bg-color);
	font-family: "Times New Roman", Times, serif; /* Classic 90s feel */
	line-height: 1.4;
	color: var(--text-color);
	margin: 0;
	padding: 20px 10px;
}

#wrapper {
	max-width: 650px;
	margin: 0 auto;
	background: #efefef;
	border: 2px solid #fff;
	border-right-color: #888;
	border-bottom-color: #888;
	padding: 20px;
	box-shadow: var(--shadow);
}

h1,
h2 {
	text-align: center;
	text-transform: uppercase;
	letter-spacing: 1px;
}

/* --- Navigation --- */
.navbar ul {
	list-style: none;
	padding: 0;
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	border-top: 1px solid var(--border-color);
	border-bottom: 1px solid var(--border-color);
	margin-bottom: 20px;
}

.navbar a {
	display: block;
	padding: 10px 15px;
	color: var(--link-color);
	font-weight: bold;
	text-decoration: underline;
}

.navbar a:hover {
	color: var(--link-hover);
}
.navbar a.active {
	color: black;
	text-decoration: none;
}

/* --- Form Aesthetics --- */
form {
	background: var(--panel-bg);
	border: 2px solid #888;
	border-right-color: #fff;
	border-bottom-color: #fff;
	padding: 20px;
	margin-bottom: 20px;
}

.form-group {
	margin-bottom: 15px;
	display: flex;
	flex-direction: column;
}

label {
	font-weight: bold;
	margin-bottom: 5px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
	width: 100%;
	padding: 8px;
	border: 2px solid #888;
	border-top-color: #333;
	border-left-color: #333;
	background: #fff;
	font-family: sans-serif;
	font-size: 1rem;
}

/* --- Buttons --- */
.actions {
	display: flex;
	gap: 10px;
	margin-top: 20px;
}

button {
	padding: 8px 20px;
	font-weight: bold;
	cursor: pointer;
	background: #ccc;
	border: 2px solid #fff;
	border-right-color: #444;
	border-bottom-color: #444;
}

button:active {
	border: 2px solid #444;
	border-right-color: #fff;
	border-bottom-color: #fff;
}

.btn-secondary {
	background: #ddd;
	font-size: 0.8rem;
}

/* --- Mobile Logic --- */
@media (max-width: 480px) {
	.actions {
		flex-direction: column;
	}
	#wrapper {
		padding: 10px;
	}
}

/* --- Special UI Elements --- */
.hidden {
	display: none;
}

fieldset {
	border: 1px solid #999;
	margin-bottom: 15px;
}

.radio-label {
	display: block;
	font-weight: normal;
	padding: 5px 0;
}

.error-text {
	color: red;
	font-weight: bold;
}

.success-box {
	background: #fff;
	border: 2px solid green;
	padding: 15px;
}

/* Spinner */
#loader {
	text-align: center;
	padding: 20px;
}
.spinner {
	width: 40px;
	height: 40px;
	border: 4px solid blue;
	border-bottom-color: transparent;
	border-radius: 50%;
	display: inline-block;
	animation: rotation 1s linear infinite;
}
@keyframes rotation {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

/* --- 90s Toast Notification --- */
#toast {
	position: fixed;
	bottom: -100px; /* Start off-screen */
	left: 50%;
	transform: translateX(-50%);
	background: #ccc;
	color: #000;
	padding: 10px 20px;
	font-family: "Courier New", Courier, monospace;
	font-weight: bold;
	border: 3px solid #fff;
	border-right-color: #444;
	border-bottom-color: #444;
	box-shadow: 5px 5px 0px rgba(0, 0, 0, 0.2);
	z-index: 9999;
	transition: bottom 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	text-align: center;
	min-width: 250px;
}

#toast.show {
	bottom: 30px; /* Slide up */
}

/* Success vs Error colors the 90s way */
#toast.success {
	border-left-color: #fff;
}
#toast.error {
	color: #a00;
	border: 3px solid red;
}

/* No new CSS needed if you are using the previous block, 
   but ensure .hidden is respected! */
#cancel-edit-button {
	margin-left: 10px;
}

.badge,
.summary-status-tag {
	background: #333;
	color: #fff;
	padding: 5px 10px;
	font-size: 0.8rem;
	margin-bottom: 15px;
	display: inline-block;
}

/* Add to style.css */
label.required::after {
	content: " *";
	color: #ff0000;
	font-weight: bold;
}

/* Real-time validation colors */
input:focus:invalid {
	background-color: #fff0f0; /* Light red tint when focused and wrong */
	border-color: #a00;
}

input:focus:valid {
	background-color: #f0fff0; /* Light green tint when focused and right */
	border-color: #00a;
}

/* Validation Message Styling */
.field-error {
	color: #a00;
	font-size: 0.8rem;
	font-weight: bold;
	margin-top: 5px;
	display: block;
	font-family: "Courier New", Courier, monospace;
}

.input-error {
	border: 2px solid red !important;
	background-color: #fff0f0 !important;
}

button:active {
	border: 2px solid #444;
	border-right-color: #fff;
	border-bottom-color: #fff;
	transform: translate(
		1px,
		1px
	); /* Moves it slightly down/right when clicked */
}

button,
.btn-secondary,
a[href^="tel"],
a[href^="mailto"] {
	color: inherit; /* Forces the button to use the color we defined */
	text-decoration: none;
}

/* 2. Button Group Layout */
.button-group {
	display: flex;
	gap: 10px;
	align-items: center;
	justify-content: flex-start; /* Keeps them left-aligned but on one line */
	margin-top: 20px;
}

/* 3. Make the Cancel button look like a real peer to Submit */
#cancel-edit-button {
	margin-left: 0; /* Remove that old margin-left offset */
	padding: 8px 15px;
	height: 100%; /* Match height of Submit */
}

/* 4. Responsive stacking for tiny screens */
@media (max-width: 400px) {
	.button-group {
		flex-direction: column;
		align-items: stretch; /* Buttons will take full width when stacked */
	}

	#cancel-edit-button {
		text-align: center;
	}
}

/* 5. Force the Submit button text to be black (overriding mobile defaults) */
button[type="submit"] {
	color: #000;
}

.summary-guest-item {
	padding: 10px;
	border-bottom: 1px dashed #999;
	margin-bottom: 10px;
}

.summary-guest-item:last-child {
	border-bottom: none;
}

.summary-status-tag {
	font-size: 0.8rem;
	padding: 2px 5px;
	background: #333;
	color: #fff;
	text-transform: uppercase;
	margin-left: 10px;
}

.summary-contact-info {
	padding-top: 10px;
	border-top: 2px solid #333;
	font-size: 0.9rem;
}

.dietary-note {
	display: block;
	font-size: 0.85rem;
	color: #555;
	font-style: italic;
	margin-top: 4px;
}

/* --- Multi-Guest RSVP Styling --- */

.guest-entry {
	border: 2px solid #888;
	border-right-color: #fff; /* Reverse bevel for an "inset" look */
	border-bottom-color: #fff;
	padding: 20px;
	margin-bottom: 25px;
	background: #ffffff;
	position: relative;
	box-shadow: inset 2px 2px 0px rgba(0, 0, 0, 0.1);
}

.remove-guest-btn {
	position: absolute;
	right: 8px;
	top: 8px;
	color: #a00;
	border: 2px solid #fff;
	border-right-color: #444;
	border-bottom-color: #444;
	background: #ddd;
	padding: 2px 8px;
	font-size: 12px;
	cursor: pointer;
	font-weight: bold;
}

.remove-guest-btn:hover {
	background: #ff0000;
	color: #fff;
}

/* Logic: Don't show remove button for the first guest */
.guest-entry:first-child .remove-guest-btn {
	display: none;
}

.guest-controls {
	margin: 20px 0;
	padding: 15px 0;
	border-top: 2px dashed #999;
}

#add-guest-btn {
	width: 100%;
	text-transform: uppercase;
	letter-spacing: 1px;
}

.contact-section {
	margin-top: 30px;
	padding-top: 20px;
	border-top: 3px double #333; /* Classic 90s double line */
}

.guest-attendance {
	margin: 15px 0;
	padding: 10px;
	border: 1px solid #ccc;
}

.invalid-group {
	border: 2px solid red !important;
	font-weight: bold !important;
	color: red !important;
}

/* Make sure the radio buttons feel "90s large" */
.radio-label input {
	margin-right: 8px;
	transform: scale(1.1);
}

#submit-rsvp-button {
	background: #4caf50;
	color: white !important;
	border: 2px solid #fff;
	border-right-color: #444;
	border-bottom-color: #444;
}
