/**
 * SGH Calendar Styles
 *
 * @package QuellcoderSGHCalDAV
 * @since   1.0.0
 */
:root {
	/* SGH Brand Colors: #d8df20, #a1c9fd, #faee1e, #faaf3a */
	--calendar-primary-color: #d8df20;
	--calendar-button-color: black;
}

/* Container */
.sgh-calendar-container {
	margin: 2rem auto;
	background: rgba(255, 255, 255, 0.75);
	backdrop-filter: blur(10px);
}

/* Header */
.calendar-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1.5rem;
	flex-wrap: wrap;
	gap: 1rem;
}

/* View Switcher */
.calendar-view-switcher {
	display: flex;
	gap: 0.5rem;
	background: #f5f5f5;
	padding: 0.25rem;
	border-radius: 0.5rem;
}

.calendar-view-switcher button {
	padding: 0.5rem 1rem;
	background: transparent;
	border: none;
	border-radius: 0.375rem;
	cursor: pointer;
	font-weight: 500;
	transition: all 0.2s;
	color: #666;
}

.calendar-view-switcher button:hover {
	background: #e5e5e5;
	color: #333;
}

.calendar-view-switcher button.active {
	background: var(--calendar-primary-color);
	color: var(--calendar-button-color);
}

/* Filters */
.calendar-filters {
	margin-bottom: 1.5rem;
	padding: 1rem;
	background: rgba(249, 249, 249, 0.9);
	backdrop-filter: blur(8px);
	border-radius: 0.5rem;
	border: 1px solid #e5e5e5;
	position: relative;
	z-index: 1;
}

.calendar-filter-row {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
	align-items: flex-start;
}

.calendar-filter-section {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	flex: 1;
	min-width: 250px;
}

.calendar-filter-label-text {
	font-weight: 600;
	font-size: 0.875rem;
	color: #333;
	margin: 0;
}

/* Multiselect Dropdown */
.calendar-filter-multiselect {
	position: relative;
}

.calendar-multiselect-toggle {
	width: 100%;
	padding: 0.625rem 1rem;
	background: white;
	border: 2px solid #ddd;
	border-radius: 0.5rem;
	cursor: pointer;
	display: flex;
	justify-content: space-between;
	align-items: center;
	transition: all 0.2s;
	font-size: 0.9375rem;
	color: #333;
}

.calendar-multiselect-toggle:hover {

}

.calendar-multiselect-toggle:focus {
	outline: none;
	border-color: var(--calendar-primary-color);
	box-shadow: 0 0 0 3px rgba(55, 136, 216, 0.1);
}

.calendar-multiselect-text {
	flex: 1;
	text-align: left;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.calendar-multiselect-arrow {
	margin-left: 0.5rem;
	transition: transform 0.2s;
	color: #666;
	font-size: 0.75rem;
}

.calendar-multiselect-toggle.active .calendar-multiselect-arrow {
	transform: rotate(180deg);
}

.calendar-multiselect-dropdown {
	position: absolute;
	top: calc(100% + 0.5rem);
	left: 0;
	right: 0;
	background: white;
	border: 2px solid var(--calendar-primary-color);
	border-radius: 0.5rem;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	z-index: 100;
	display: none;
	max-height: 350px;
	overflow: hidden;
	flex-direction: column;
}

.calendar-multiselect-items {
	background: white;
}

.calendar-multiselect-dropdown.active {
	display: flex;
	background: white;
	z-index: 1000;
}

.calendar-multiselect-header {
	display: flex;
	gap: 0.5rem;
	padding: 0.75rem;
	border-bottom: 1px solid #e5e5e5;
	background: #f9f9f9;
}

.calendar-multiselect-select-all,
.calendar-multiselect-clear-all {
	flex: 1;
	padding: 0.375rem 0.75rem;
	background: white;
	border: 1px solid #ddd;
	border-radius: 0.25rem;
	cursor: pointer;
	font-size: 0.8125rem;
	transition: all 0.2s;
	font-weight: 500;
}

.calendar-multiselect-select-all:hover {
	background: var(--calendar-primary-color);
	color: black;
	border-color: var(--calendar-primary-color);
}

.calendar-multiselect-clear-all:hover {
	background: #dc3545;
	color: black;
	border-color: #dc3545;
}

.calendar-multiselect-items {
	overflow-y: auto;
	max-height: 280px;
}

.calendar-multiselect-item {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.625rem 1rem;
	cursor: pointer;
	transition: background-color 0.2s;
	border-bottom: 1px solid #f5f5f5;
}

.calendar-multiselect-item:hover {
	background: #f9f9f9;
}

.calendar-multiselect-item:last-child {
	border-bottom: none;
}

.calendar-multiselect-item input[type="checkbox"] {
	cursor: pointer;
	width: 16px;
	height: 16px;
	margin: 0;
}

.calendar-multiselect-color {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	flex-shrink: 0;
	border: 2px solid white;
	box-shadow: 0 0 0 1px #ddd;
}

.calendar-multiselect-name {
	flex: 1;
	font-size: 0.9375rem;
	color: #333;
}

/* Date Range Filter */
.calendar-filter-daterange {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.calendar-date-input {
	flex: 1;
	min-width: 140px;
	padding: 0.625rem 0.75rem;
	background: white;
	border: 2px solid #ddd;
	border-radius: 0.5rem;
	font-size: 0.9375rem;
	color: #333;
	transition: all 0.2s;
}

.calendar-date-input:hover {
	border-color: var(--calendar-primary-color);
}

.calendar-date-input:focus {
	outline: none;
	border-color: var(--calendar-primary-color);
	box-shadow: 0 0 0 3px rgba(55, 136, 216, 0.1);
}

.calendar-daterange-separator {
	color: #666;
	font-weight: 500;
}

.calendar-daterange-clear {
	padding: 0.625rem 0.75rem;
	background: white;
	border: 2px solid #ddd;
	border-radius: 0.5rem;
	cursor: pointer;
	color: #666;
	transition: all 0.2s;
	font-size: 0.875rem;
	line-height: 1;
}

.calendar-daterange-clear:hover {
	background: #dc3545;
	color: var(--calendar-button-color);
	border-color: #dc3545;
}

/* Navigation */
.calendar-nav {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.calendar-nav button {
	padding: 0.5rem 1rem;
	background: var(--calendar-primary-color);
	color: var(--calendar-button-color);
	border: none;
	border-radius: 0.375rem;
	cursor: pointer;
	font-weight: 500;
	transition: all 0.2s;
}

.calendar-nav button:hover {
	background: #2970b8;
}

.calendar-nav-title {
	font-size: 1.25rem;
	font-weight: 600;
	min-width: 200px;
	text-align: center;
}

.calendar-nav-btn__label {
	display: block;
}

/* View Container */
.calendar-view-container {
	position: relative;
	min-height: 400px;
}

.calendar-view-container.calendar-loading::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255, 255, 255, 0.8);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
}

/* List View */
.calendar-list-view {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.calendar-list-group {
	margin-bottom: 1rem;
}

.calendar-list-date {
	font-size: 1.5rem;
	font-weight: 600;
	margin-bottom: 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid #e5e5e5;
	color: #333;
}

.calendar-list-events {
	display: grid;
	gap: 1rem;
}

/* Compact List View - Schickhardt Style */
.calendar-list-view--compact {
	max-width: 100%;
}

.calendar-list-month-group {
	margin-bottom: 3rem;
}

.calendar-list-month-title {
	font-size: 2rem;
	font-weight: 700;
	margin-bottom: 1.5rem;
	padding-bottom: 0.75rem;
	border-bottom: 3px solid var(--calendar-primary-color);
	color: #333;
	text-transform: capitalize;
}

.calendar-list-items {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.calendar-list-item {
	display: flex;
	gap: 1.5rem;
	padding: 1.5rem 0;
	border-bottom: 1px solid #e5e5e5;
	cursor: pointer;
	transition: background-color 0.2s;
}

.calendar-list-item:hover {
	background-color: #f9f9f9;
	padding-left: 1rem;
	padding-right: 1rem;
	margin-left: -1rem;
	margin-right: -1rem;
}

.calendar-list-item__date {
	flex-shrink: 0;
	width: 80px;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: var(--calendar-primary-color);
	color: var(--calendar-button-color);
	border-radius: 0.5rem;
	padding: 0.5rem;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calendar-list-item__date-day {
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1;
	margin-bottom: 0.25rem;
}

.calendar-list-item__date-month {
	font-size: 0.875rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	opacity: 0.9;
}

.calendar-list-item__date-weekday {
	font-size: 0.75rem;
	font-weight: 400;
	text-transform: uppercase;
	margin-top: 0.25rem;
	opacity: 0.8;
	display: none;
}

.calendar-list-item__content {
	flex: 1;
	min-width: 0;
}

.calendar-list-item__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
}

.calendar-list-item__title {
	font-size: 1.25rem;
	font-weight: 600;
	margin: 0;
	color: #333;
	line-height: 1.3;
}

.calendar-list-item__category {
	flex-shrink: 0;
	padding: 0.25rem 0.75rem;
	border-radius: 1rem;
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--calendar-button-color);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.calendar-list-item__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin-bottom: 0.5rem;
	font-size: 0.875rem;
	color: #666;
}

.calendar-list-item__time,
.calendar-list-item__location {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.calendar-list-item__description {
	margin: 0.5rem 0 0 0;
	color: #555;
	font-size: 0.9375rem;
	line-height: 1.6;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Event Card */
.calendar-event-card {
	background: white;
	border-radius: 0.5rem;
	padding: 1rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	cursor: pointer;
	transition: all 0.2s;
	display: flex;
	gap: 1rem;
}

.calendar-event-card:hover {
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
}

.calendar-event-image {
	width: 120px;
	height: 120px;
	object-fit: cover;
	border-radius: 0.375rem;
	flex-shrink: 0;
}

.calendar-event-content {
	flex: 1;
}

.calendar-event-title {
	font-size: 1.125rem;
	font-weight: 600;
	margin: 0 0 0.5rem 0;
	color: #333;
}

.calendar-event-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin-bottom: 0.5rem;
	font-size: 0.875rem;
	color: #666;
}

.calendar-event-time::before {
	content: '🕒 ';
}

.calendar-event-location::before {
	content: '📍 ';
}

.calendar-event-description {
	margin: 0.5rem 0;
	color: #555;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.calendar-event-categories {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.75rem;
}

.calendar-event-category {
	padding: 0.25rem 0.75rem;
	border-radius: 1rem;
	font-size: 0.75rem;
	font-weight: 500;
	color: whivar(--calendar-button-color)te;
}

/* Month View */
.calendar-month-view {
	overflow-x: auto;
}

.calendar-month-table {
	width: 100%;
	border-collapse: collapse;
	background: white;
	border-radius: 0.5rem;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.calendar-month-table th {
	background: var(--calendar-primary-color);
	color: var(--calendar-button-color);
	padding: 0.75rem;
	text-align: center;
	font-weight: 600;
	font-size: 0.875rem;
}

.calendar-month-table td {
	border: 1px solid #e5e5e5;
	padding: 0.5rem;
	vertical-align: top;
	height: 140px;
	width: 14.28%;
	position: relative;
	overflow: hidden;
}

.calendar-day-empty {
	background: #f9f9f9;
}

.calendar-day-number {
	font-weight: 600;
	margin-bottom: 0.5rem;
	color: #333;
}

.calendar-day-today {
	background: #e3f2fd;
}

.calendar-day-today .calendar-day-number {
	color: var(--calendar-primary-color);
	font-weight: 700;
}

.calendar-day-events {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	max-height: calc(100% - 2rem);
	overflow-y: auto;
}

.calendar-day-event {
	padding: 0.25rem 0.5rem;
	border-radius: 0.25rem;
	font-size: 0.7rem;
	color: var(--calendar-button-color);
	cursor: pointer;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: normal;
	line-height: 1.2;
	transition: opacity 0.2s;
	word-wrap: break-word;
	hyphens: auto;
}

.calendar-day-event:hover {
	opacity: 0.8;
}

.calendar-day-event-more {
	font-size: 0.7rem;
	color: #666;
	padding: 0.25rem 0.5rem;
	text-align: center;
}

/* Week View */
.calendar-week-view {
	overflow-x: auto;
}

.calendar-week-table {
	width: 100%;
	border-collapse: collapse;
	background: white;
	border-radius: 0.5rem;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.calendar-week-table th {
	background: var(--calendar-primary-color);
	color: var(--calendar-button-color);
	padding: 0.75rem;
	text-align: center;
	font-weight: 600;
	font-size: 0.875rem;
	min-width: 120px;
}

.calendar-week-today {
	background: #2970b8;
}

.calendar-week-table td {
	border: 1px solid #e5e5e5;
	padding: 0.5rem;
	vertical-align: top;
	height: 80px;
	position: relative;
	overflow: hidden;
}

.calendar-week-time {
	background: #f9f9f9;
	font-weight: 600;
	text-align: center;
	color: #666;
	min-width: 80px;
}

.calendar-week-cell {
	position: relative;
	height: 100%;
	overflow-y: auto;
}

.calendar-week-event {
	padding: 0.5rem;
	border-radius: 0.25rem;
	font-size: 0.75rem;
	color: var(--calendar-button-color);
	margin-bottom: 0.25rem;
	cursor: pointer;
	transition: opacity 0.2s;
	white-space: normal;
	word-wrap: break-word;
	line-height: 1.2;
	hyphens: auto;
}

.calendar-week-event:hover {
	opacity: 0.8;
}

/* Error & Empty States */
.calendar-error,
.calendar-no-events {
	text-align: center;
	padding: 3rem 1rem;
	color: #666;
	font-size: 1rem;
}

.calendar-error {
	color: #dc3545;
	background: #f8d7da;
	border-radius: 0.5rem;
}

/* Grid View */
.calendar-grid-view {
	width: 100%;
}

.calendar-grid-items {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.5rem;
	margin-top: 1rem;
}

.calendar-grid-card {
	background: white;
	border-radius: 0.75rem;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	cursor: pointer;
	transition: all 0.3s ease;
	position: relative;
	display: flex;
	flex-direction: column;
}

.calendar-grid-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.calendar-grid-card__date {
	position: absolute;
	top: 1rem;
	left: 1rem;
	background: linear-gradient(135deg, var(--calendar-primary-color) 0%, #2970b8 100%);
	color: var(--calendar-button-color);
	padding: 0.75rem;
	border-radius: 0.5rem;
	text-align: center;
	min-width: 70px;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
	z-index: 2;
}

.calendar-grid-card__date-day {
	font-size: 2rem;
	font-weight: 700;
	line-height: 1;
	display: block;
}

.calendar-grid-card__date-month {
	font-size: 0.875rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-top: 0.25rem;
	display: block;
	opacity: 0.9;
}

.calendar-grid-card__image {
	width: 100%;
	height: 200px;
	object-fit: cover;
	display: block;
}

.calendar-grid-card__content {
	padding: 1.25rem;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.calendar-grid-card__header {
	margin-bottom: 0.75rem;
}

.calendar-grid-card__title {
	font-size: 1.125rem;
	font-weight: 600;
	margin: 0 0 0.5rem 0;
	color: #333;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.calendar-grid-card__category {
	display: inline-block;
	padding: 0.25rem 0.75rem;
	border-radius: 1rem;
	font-size: 0.7rem;
	font-weight: 500;
	color: var(--calendar-button-color);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.calendar-grid-card__meta {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
	font-size: 0.875rem;
	color: #666;
}

.calendar-grid-card__time,
.calendar-grid-card__location {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.calendar-grid-card__description {
	margin: 0;
	color: #555;
	font-size: 0.875rem;
	line-height: 1.5;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-top: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
	.calendar-header {
		flex-direction: column;
		align-items: stretch;
	}

	.calendar-view-switcher,
	.calendar-nav {
		justify-content: center;
	}

	.calendar-view-switcher button {
		flex: 1;
		font-size: 0.875rem;
	}

	.calendar-month-table td {
		padding: 0.25rem;
		font-size: 0.875rem;
		height: 100px;
	}

	.calendar-day-event {
		font-size: 0.6rem;
		padding: 0.125rem 0.25rem;
	}

	.calendar-event-card {
		flex-direction: column;
	}

	.calendar-event-image {
		width: 100%;
		height: 200px;
	}

	.calendar-nav-btn__label {
		display: none;
	}

	.calendar-week-table th,
	.calendar-week-table td {
		min-width: 100px;
		font-size: 0.75rem;
	}

	.calendar-filters {
		padding: 0.75rem;
		position: relative;

	}

	.calendar-filter-row {
		flex-direction: column;
		gap: 1rem;
	}

	.calendar-filter-section {
		min-width: 100%;
	}

	.calendar-filter-daterange {
		flex-direction: column;
		align-items: stretch;
	}

	.calendar-date-input {
		min-width: 100%;
	}

	.calendar-daterange-separator {
		display: none;
	}

	/* Compact List View Mobile */
	.calendar-list-item {
		flex-direction: column;
		gap: 1rem;
	}

	.calendar-list-item__date {
		width: 100%;
		flex-direction: row;
		justify-content: center;
		padding: 0.75rem 1rem;
		gap: 1rem;
	}

	.calendar-list-item__date-day {
		font-size: 1.75rem;
	}

	.calendar-list-item__date-month {
		font-size: 0.875rem;
		margin-top: 0;
	}

	.calendar-list-item__date-weekday {
		margin-top: 0;
	}

	.calendar-list-item__title {
		font-size: 1.125rem;
	}

	.calendar-list-month-title {
		font-size: 1.5rem;
	}

	/* Grid View Mobile */
	.calendar-grid-items {
		grid-template-columns: 1fr;
		gap: 1rem;
	}

	.calendar-grid-card__image {
		height: 180px;
	}
}

@media (max-width: 480px) {
	.sgh-calendar-container {
		padding: 0.5rem;
	}

	.calendar-nav-title {
		font-size: 1rem;
		min-width: auto;
		margin: 0;
	}

	.calendar-nav button {
		padding: 0.375rem 0.75rem;
		font-size: 0.875rem;
	}

	.calendar-view-switcher button {
		padding: 0.375rem 0.5rem;
		font-size: 0.75rem;
	}

	.calendar-list-item__header {
		flex-direction: column;
		gap: 0.5rem;
	}

	.calendar-list-item__category {
		align-self: flex-start;
	}
}

