:root {
	--primary: #6B9FFF; /* Lighter blue for dark theme */
	--primary-dark: #5B8FEF;
	--text: #E8E4ED; /* Light text for dark background */
	--text-light: #B8B0C4; /* Lighter grey for secondary text */
	--border: #3d2f52; /* Muted purple border */
	--bg: #1a0f2e; /* Deep purple-blue from gig photo */
	--card-bg: #2a1f3d; /* Dark purple for main card container */
	--modal-bg: #FFFFFF; /* White for modals only */
	--event-card-bg: #261a3a; /* Dark purple, close to background */
	--error: #EF4444;
	--success: #10B981;
	--radius: 12px;
	--shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
	--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	background: var(--bg);
	color: var(--text);
	line-height: 1.6;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.container {
	width: 100%;
	max-width: 600px;
}

.card {
	background: var(--card-bg);
	border-radius: var(--radius);
	padding: 40px;
	box-shadow: var(--shadow-lg);
	position: relative;
}

.logo {
	text-align: center;
	margin-bottom: 20px;
}

h1 {
	text-align: center;
	font-size: 28px;
	font-weight: 700;
	margin-bottom: 30px;
	color: var(--text);
}

h1.hide-on-calendar {
	display: none;
}

h2 {
	font-size: 22px;
	font-weight: 600;
	margin-bottom: 20px;
	color: var(--text);
}

.screen {
	display: none;
}

.screen.active {
	display: block;
	animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

p {
	text-align: center;
	color: var(--text-light);
	margin-bottom: 20px;
	font-size: 15px;
}

form {
	display: flex;
	flex-direction: column;
	gap: 15px;
}

input[type="email"],
input[type="text"],
input[type="datetime-local"],
input[type="date"],
input[type="time"],
input[type="url"],
textarea {
	width: 100%;
	padding: 10px 14px;
	border: 2px solid var(--border);
	border-radius: var(--radius);
	font-size: 16px;
	transition: border-color 0.2s, box-shadow 0.2s;
	background: var(--modal-bg);
	color: #1F2937;
	font-family: inherit;
}

/* Dark theme for search input in calendar view */
#event-search {
	background: var(--event-card-bg);
	color: var(--text);
	border: 1px solid rgba(61, 47, 82, 0.4);
}

#event-search::placeholder {
	color: var(--text-light);
}

#event-search:focus {
	border-color: var(--border);
	outline: none;
}

input[type="date"] {
	cursor: pointer;
	position: relative;
}

input[type="date"]::-webkit-calendar-picker-indicator {
	cursor: pointer;
	opacity: 0.6;
	transition: opacity 0.2s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
	opacity: 1;
}

textarea {
	resize: vertical;
	min-height: 60px;
}

input:focus,
textarea:focus {
	outline: none;
	border-color: var(--primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input[type="text"]#pin-input {
	text-align: center;
	letter-spacing: 0.3em;
	font-size: 24px;
	font-weight: 600;
}

label {
	font-size: 14px;
	font-weight: 500;
	color: var(--text);
	margin-top: 5px;
}

.radio-group {
	display: flex;
	gap: 15px;
	margin-bottom: 15px;
}

.radio-label {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	padding: 10px 16px;
	border: 2px solid var(--border);
	border-radius: var(--radius);
	transition: all 0.2s;
	flex: 1;
	justify-content: center;
	font-weight: 500;
	margin: 0;
}

.radio-label:hover {
	border-color: var(--primary);
	background: rgba(37, 99, 235, 0.05);
}

.radio-label input[type="radio"] {
	width: 18px;
	height: 18px;
	cursor: pointer;
	accent-color: var(--primary);
}

.radio-label input[type="radio"]:checked + span {
	color: var(--primary);
}

.radio-label:has(input[type="radio"]:checked) {
	border-color: var(--primary);
	background: rgba(37, 99, 235, 0.1);
}

.checkbox-label {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	padding: 12px 16px;
	border: 2px solid var(--border);
	border-radius: var(--radius);
	transition: all 0.2s;
	margin: 0 0 15px 0;
	font-weight: 500;
}

.checkbox-label:hover {
	border-color: rgba(139, 92, 246, 0.5);
	background: rgba(139, 92, 246, 0.05);
}

.checkbox-label input[type="checkbox"] {
	width: 20px;
	height: 20px;
	cursor: pointer;
	accent-color: rgb(139, 92, 246);
}

.checkbox-label:has(input[type="checkbox"]:checked) {
	border-color: rgb(139, 92, 246);
	background: rgba(139, 92, 246, 0.1);
	color: rgb(139, 92, 246);
}

button {
	width: 100%;
	padding: 14px 20px;
	background: var(--primary);
	color: white;
	border: none;
	border-radius: var(--radius);
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s, transform 0.1s;
	position: relative;
}

button:hover {
	background: var(--primary-dark);
}

button:active {
	transform: scale(0.98);
}

button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

button.secondary {
	background: var(--border);
	color: var(--text);
}

button.secondary:hover {
	background: #D1D5DB;
}

button.danger {
	background: white;
	color: var(--error);
	border: 2px solid var(--error);
}

button.danger:hover {
	background: var(--error);
	color: white;
}

button.small {
	padding: 8px 16px;
	font-size: 14px;
	width: auto;
}

button.link-button {
	background: none;
	color: var(--primary);
	margin-top: 10px;
	font-size: 14px;
}

button.link-button:hover {
	background: var(--bg);
}

button.primary {
	background: var(--primary);
	color: white;
}

/* Calendar specific styles */
.calendar-header {
	margin-bottom: 20px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--border);
}

.user-info {
	flex: 1;
	margin: 0;
	text-align: left;
}

.user-email {
	margin: 0 0 4px 0;
	font-size: 14px;
	line-height: 1.2;
}

.user-email strong {
	font-size: 24px;
	color: var(--text);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.user-email small {
	color: var(--text-light);
}

.profile-action-button {
	background: none;
	color: #6B7280;
	font-size: 12px;
	margin-top: 4px;
	padding: 0;
	border: none;
	width: auto;
	text-align: left;
	cursor: pointer;
	font-weight: normal;
}

.edit-name-button {
	display: inline-block;
	background: none;
	border: none;
	color: #6B7280;
	cursor: pointer;
	padding: 4px;
	vertical-align: middle;
	margin-left: 4px;
}

.add-button {
	position: fixed;
	bottom: 30px;
	left: 50%;
	transform: translateX(-50%);
	width: 60px;
	height: 60px;
	padding: 0;
	background: var(--primary);
	color: white;
	border: none;
	border-radius: 50%;
	font-size: 32px;
	font-weight: 300;
	cursor: pointer;
	transition: all 0.2s;
	display: none;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
	z-index: 100;
}

.add-button:hover {
	background: var(--primary-dark);
	transform: translateX(-50%) scale(1.1);
	box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.add-button:active {
	transform: translateX(-50%) scale(0.95);
}

.calendar-content {
	min-height: 150px;
}

#events-list {
	margin-bottom: 20px;
}

.event-card {
	background: var(--event-card-bg);
	border: 2px solid var(--border);
	border-radius: var(--radius);
	padding: 10px 14px;
	margin-bottom: 8px;
	transition: transform 0.2s, box-shadow 0.2s;
	position: relative;
	display: flex;
	gap: 10px;
	align-items: center;
	justify-content: space-between;
}

.event-card.private {
	background: #352848; /* Slightly lighter dark purple for private events */
	border-color: #5a4570; /* Medium purple border */
}

.event-card.conflict {
	border-left: 4px solid #EC4899;
}

.event-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow);
}

.event-card-content {
	flex: 1;
	cursor: pointer;
	min-width: 0;
	overflow: hidden;
}

.heart-button {
	padding: 8px;
	background: none;
	border: 2px solid var(--border);
	border-radius: 50%;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s;
	flex-shrink: 0;
	color: var(--text-light);
}

.heart-button:hover {
	background: #FFE082;
	border-color: #FFE082;
	color: white;
	transform: scale(1.1);
}

.heart-button.hearted {
	background: #F59E0B;
	border-color: #F59E0B;
	color: white;
}

.heart-button svg {
	width: 20px;
	height: 20px;
}

.event-card h3 {
	font-size: 16px;
	font-weight: 600;
	margin-bottom: 4px;
	color: var(--text);
	display: flex;
	align-items: center;
	gap: 8px;
}

.event-description {
	color: var(--text-light);
	font-size: 13px;
	margin-bottom: 6px;
	text-align: left;
	word-wrap: break-word;
	word-break: break-word;
	overflow-wrap: break-word;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.event-time {
	display: flex;
	align-items: centre;
	gap: 10px;
	font-size: 13px;
	color: var(--text);
	margin-bottom: 4px;
	text-align: left;
}

.event-meta {
	font-size: 12px;
	color: var(--text-light);
	text-align: left;
}

.empty-state {
	text-align: centre;
	color: var(--text-light);
	padding: 40px 20px;
	font-size: 16px;
}

/* Modal styles */
.modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.75);
	z-index: 1000;
	align-items: center;
	justify-content: center;
}

.modal.active {
	display: flex;
}

/* Prevent background scroll when any modal is open */
body:has(.modal.active) {
	overflow: hidden;
}

.modal-content {
	background: var(--modal-bg);
	border-radius: var(--radius);
	padding: 0;
	max-width: 500px;
	width: 90%;
	max-height: 85vh;
	overflow-y: auto;
	box-shadow: var(--shadow-lg);
}

.modal-content > *:not(h2):not(form) {
	padding: 0 20px;
}

.modal-content form {
	padding: 20px;
}

.modal-content h2 {
	background: var(--bg);
	color: var(--text);
	margin: 0;
	padding: 20px;
	border-radius: var(--radius) var(--radius) 0 0;
	font-size: 20px;
}

.modal-buttons {
	display: flex;
	gap: 10px;
	margin-top: 10px;
	padding: 0 20px 20px 20px !important;
}

.modal-buttons button {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Loading spinner */
.loading {
	display: none;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 40px;
	height: 40px;
	border: 4px solid var(--border);
	border-top-color: var(--primary);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

.loading.active {
	display: block;
}

@keyframes spin {
	to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Error message */
.error-message {
	display: none;
	padding: 12px 16px;
	background: #FEE2E2;
	color: var(--error);
	border-radius: var(--radius);
	margin-top: 15px;
	font-size: 14px;
	text-align: center;
	animation: shake 0.4s ease-in-out;
}

.error-message.active {
	display: block;
}

@keyframes shake {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-10px); }
	75% { transform: translateX(10px); }
}

.success-message {
	color: var(--success);
	font-weight: 500;
}

footer {
	text-align: center;
	margin-top: 30px;
	color: var(--text-light);
	font-size: 13px;
	display: none;
}

footer p {
	margin-bottom: 10px;
}

footer a {
	color: var(--primary);
	text-decoration: none;
}

footer a:hover {
	text-decoration: underline;
}

footer .link-button {
	margin-top: 0;
}

/* Responsive design */
@media (max-width: 480px) {
	.card {
		padding: 30px 24px;
	}

	h1 {
		font-size: 24px;
	}

	.add-button {
		bottom: 20px;
		right: 20px;
		width: 56px;
		height: 56px;
	}
}

/* Loading state for buttons */
button.loading span {
	opacity: 0;
}

button.loading::after {
	content: '';
	position: absolute;
	width: 16px;
	height: 16px;
	top: 50%;
	left: 50%;
	margin-left: -8px;
	margin-top: -8px;
	border: 2px solid white;
	border-top-color: transparent;
	border-radius: 50%;
	animation: spin 0.6s linear infinite;
}

}

/* Hide user info section now that we have Giggly header */
.calendar-header {
	display: none;
}

/* App header with background image - BOLD! */
.app-header-bg {
	width: 100%;
	height: 150px;
	background-image: url('/background.jpg');
	background-size: cover;
	background-position: center;
	position: relative;
}

.app-header-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(to bottom, rgba(0,0,0,0.4), rgba(0,0,0,0.7));
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	padding: 20px;
}

.app-title {
	font-size: 72px;
	font-weight: 900;
	color: white;
	margin: 0;
	text-shadow: 0 4px 16px rgba(0,0,0,0.6);
	letter-spacing: -1px;
	text-transform: uppercase;
}

/* Force hide user info - use !important to override any other styles */
.calendar-header,
.calendar-header .user-info,
.user-email,
#auth-email,
.profile-action-button {
	display: none !important;
}

/* Event view tabs */
.event-view-tabs {
	display: flex;
	gap: 12px;
	margin-bottom: 20px;
	border-bottom: 2px solid var(--border);
	padding-bottom: 0;
}

.event-view-tab {
	background: none;
	border: none;
	color: var(--text-light);
	font-size: 16px;
	font-weight: 600;
	padding: 12px 20px;
	cursor: pointer;
	font-family: inherit;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
	transition: all 0.2s;
	-webkit-tap-highlight-color: transparent;
	user-select: none;
	-webkit-user-select: none;
}

.event-view-tab:active {
	color: var(--primary);
	border-bottom-color: var(--primary);
}

/* Month navigation */
#month-nav {
	position: sticky;
	top: 0;
	background: var(--bg);
	z-index: 10;
	padding: 12px 0;
	margin-bottom: 16px;
	border-bottom: 2px solid var(--border);
	overflow-x: auto;
	white-space: nowrap;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.month-nav-button {
	width: 32px;
	height: 32px;
	padding: 0;
	background: var(--event-card-bg);
	border: 1px solid var(--border);
	border-radius: 50%;
	font-size: 12px;
	font-weight: 600;
	color: var(--text);
	cursor: pointer;
	transition: all 0.2s;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.month-nav-button:hover:not(:disabled) {
	background: var(--border);
	color: var(--text);
	border-color: var(--text-light);
	transform: scale(1.1);
}

.month-nav-button.active {
	background: var(--text);
	color: var(--bg);
	border-color: var(--text);
}

.month-nav-button:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

/* Responsive month buttons for mobile */
@media (max-width: 480px) {
	.month-nav-button {
		width: 28px;
		height: 28px;
		font-size: 11px;
	}

	#month-nav > div {
		gap: 4px !important;
	}
}

/* Month headers */
.month-header {
	display: flex;
	align-items: center;
	gap: 16px;
	margin: 32px 0 20px 0;
	scroll-margin-top: 80px;
}

.month-header h2 {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	color: var(--bg);
	background: var(--text);
	padding: 8px 20px;
	border-radius: 8px;
	white-space: nowrap;
}

.month-header-line {
	flex: 1;
	height: 1px;
	background: var(--text);
}
