@import "tailwindcss";
@import "@manacore/shared-tailwind/themes.css";

/* Scan shared packages for Tailwind classes */
@source "../../../packages/shared/src";
@source "../../../../../packages/shared-ui/src";
@source "../../../../../packages/shared-theme-ui/src";
@source "../../../../../packages/shared-theme-ui/src/components";
@source "../../../../../packages/shared-theme-ui/src/pages";

/* Calendar-specific CSS Variables */
@layer base {
	:root {
		/* Spacing */
		--spacing-xs: 0.25rem;
		--spacing-sm: 0.5rem;
		--spacing-md: 1rem;
		--spacing-lg: 1.5rem;
		--spacing-xl: 2rem;
		--spacing-2xl: 3rem;

		/* Border Radius */
		--radius-sm: 0.25rem;
		--radius-md: 0.5rem;
		--radius-lg: 0.75rem;
		--radius-xl: 1rem;
		--radius-full: 9999px;

		/* Transitions */
		--transition-fast: 150ms ease;
		--transition-base: 200ms ease;
		--transition-slow: 300ms ease;

		/* Calendar-specific */
		--hour-height: 48px;
		--day-header-height: 40px;
		--time-column-width: 56px;
	}
}

/* Calendar Grid Styles - Using plain CSS (not @layer) for guaranteed inclusion */
/* Hour slot in day/week view */
.hour-slot {
	height: var(--hour-height);
	border-bottom: 1px solid color-mix(in srgb, var(--color-border) 50%, transparent);
	position: relative;
}

.hour-slot:hover {
	background-color: color-mix(in srgb, var(--color-muted) 30%, transparent);
}

/* Event card in calendar */
.event-card {
	background-color: var(--color-primary);
	color: var(--color-primary-foreground);
	border-radius: var(--radius-sm);
	padding: 2px 6px;
	font-size: 0.75rem;
	overflow: hidden;
	cursor: pointer;
	transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.event-card:hover {
	transform: scale(1.02);
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Day cell in month view */
.day-cell {
	min-height: 100px;
	border: 1px solid var(--color-border);
	padding: var(--spacing-xs);
	transition: background-color var(--transition-fast);
}

.day-cell:hover {
	background-color: color-mix(in srgb, var(--color-muted) 30%, transparent);
}

.day-cell.today {
	background-color: color-mix(in srgb, var(--color-primary) 10%, transparent);
}

.day-cell.other-month {
	opacity: 0.5;
}

/* Time indicator (current time line) */
.time-indicator {
	position: absolute;
	left: 0;
	right: 0;
	height: 2px;
	background-color: var(--color-error);
	z-index: 10;
}

.time-indicator::before {
	content: '';
	position: absolute;
	left: -4px;
	top: -4px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background-color: var(--color-error);
}

/* Mini calendar */
.mini-calendar {
	font-size: 0.875rem;
}

.mini-calendar .day {
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius-full);
	cursor: pointer;
	transition: all var(--transition-fast);
}

.mini-calendar .day:hover {
	background-color: var(--color-muted);
}

.mini-calendar .day.today {
	background-color: var(--color-primary);
	color: var(--color-primary-foreground);
}

.mini-calendar .day.selected {
	border: 2px solid var(--color-primary);
}

/* Card styles */
.card {
	background-color: var(--color-surface);
	border-radius: var(--radius-lg);
	padding: var(--spacing-lg);
	border: 1px solid var(--color-border);
}

/* Button styles */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.5rem 1rem;
	border-radius: var(--radius-md);
	font-weight: 500;
	font-size: 0.875rem;
	transition: all var(--transition-base);
	cursor: pointer;
	border: none;
	background: transparent;
}

.btn-primary {
	background: var(--color-primary);
	color: var(--color-primary-foreground);
}

.btn-primary:hover {
	filter: brightness(0.9);
}

.btn-primary:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.btn-secondary {
	background: var(--color-secondary);
	color: var(--color-secondary-foreground);
}

.btn-secondary:hover {
	filter: brightness(0.9);
}

.btn-ghost {
	background: transparent;
	color: var(--color-foreground);
}

.btn-ghost:hover {
	background: var(--color-muted);
}

.btn-icon {
	padding: 0.5rem;
}

.btn-sm {
	padding: 0.25rem 0.5rem;
	font-size: 0.75rem;
}

/* Input styles */
.input {
	display: block;
	width: 100%;
	padding: 0.5rem 0.75rem;
	border: 2px solid var(--color-border);
	border-radius: var(--radius-md);
	background-color: var(--color-background);
	color: var(--color-foreground);
	font-size: 0.875rem;
	transition: border-color var(--transition-fast);
}

.input:focus {
	outline: none;
	border-color: var(--color-primary);
}

.input::placeholder {
	color: var(--color-muted-foreground);
}

/* Select styling */
select.input {
	appearance: none;
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
	background-position: right 0.5rem center;
	background-repeat: no-repeat;
	background-size: 1.5em 1.5em;
	padding-right: 2.5rem;
}

/* Text colors */
.text-destructive {
	color: var(--color-error);
}

/* Scrollbar styling */
@layer utilities {
	.scrollbar-thin::-webkit-scrollbar {
		width: 6px;
		height: 6px;
	}

	.scrollbar-thin::-webkit-scrollbar-track {
		background: transparent;
	}

	.scrollbar-thin::-webkit-scrollbar-thumb {
		background-color: hsl(var(--muted-foreground) / 0.3);
		border-radius: 3px;
	}

	.scrollbar-thin::-webkit-scrollbar-thumb:hover {
		background-color: hsl(var(--muted-foreground) / 0.5);
	}
}
