/* Calendar CSS with List View Support */

#simple-calendar-container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

.sc-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
	gap: 15px;
	flex-wrap: wrap;
}

.sc-header-left {
	display: flex;
	align-items: center;
	gap: 10px;
}

.sc-header-right {
	display: flex;
	align-items: center;
	gap: 15px;
}

.sc-date-picker-wrapper {
	display: flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
}

.sc-date-picker-wrapper label {
	font-size: 14px;
	font-weight: 500;
	margin: 0;
	white-space: nowrap;
}

.sc-category-filter-wrapper {
	display: flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
}

.sc-category-filter-wrapper label {
	font-size: 14px;
	font-weight: 500;
	margin: 0;
	white-space: nowrap;
}

.sc-category-filter {
	padding: 8px 12px;
	border: 1px solid #b0b0b0;
	border-radius: 4px;
	font-size: 14px;
	background: #ffffff;
	color: #4a5567;
	height: 38px;
	box-sizing: border-box;
}

.sc-date-picker,
.sc-today-btn {
	padding: 8px 12px;
	border: 1px solid #b0b0b0;
	border-radius: 4px;
	font-size: 14px;
	cursor: pointer;
	background: #f1f5fa;
	color: #4a5567;
	height: 38px;
	box-sizing: border-box;
	line-height: 1.4;
}

.sc-today-btn {
	font-weight: normal;
}

.sc-today-btn:hover {
	background: #e1e8f0;
}

#sc-title {
	font-size: 24px;
	margin: 0;
	flex: 1;
	text-align: center;
	font-weight: 600;
	letter-spacing: 0 !important;
}

.sc-nav-btn {
	padding: 8px 16px;
	background: #E07A5F;
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	display: none;
}

.sc-nav-btn:hover {
	background: #C96850;
}

#sc-today.sc-nav-btn {
	display: none;
}

.sc-view-controls {
	display: flex;
	gap: 5px;
}

.sc-view-btn {
	padding: 8px 16px;
	background: #d0d0d0;
	border: 1px solid #b0b0b0;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
}

.sc-view-btn:hover {
	background: #c0c0c0;
}

.sc-view-btn.active {
	background: #E07A5F;
	color: white;
	border-color: #E07A5F;
}

.sc-date-picker {
	padding: 8px 12px;
	border: 1px solid #b0b0b0;
	border-radius: 4px;
	font-size: 14px;
	cursor: pointer;
}

/* Calendar Grid */
#sc-calendar {
	background: white;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	overflow: hidden;
}

/* Calendar Title Bar */
.sc-calendar-title-bar {
	grid-column: 1 / -1;
	display: grid;
	grid-template-columns: 60px 1fr 60px;
	align-items: center;
	padding: 10px 15px;
	background: #f0f0f1;
	border-bottom: 2px solid #dcdcde;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
}

.sc-title-text {
	text-align: center;
	grid-column: 2;
}

.sc-title-nav-btn {
	background: none;
	border: none;
	font-size: 24px;
	color: #666;
	cursor: pointer;
	padding: 0;
	line-height: 1;
	transition: color 0.2s;
}

.sc-title-nav-btn:hover {
	color: #333;
	background: none;
}

.sc-title-prev {
	grid-column: 1;
	justify-self: start;
}

.sc-title-next {
	grid-column: 3;
	justify-self: end;
}

/* Month View */
.sc-month-view {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
}

.sc-month-view .sc-calendar-title-bar {
	grid-column: 1 / -1;
}

.sc-month-view .sc-day-header {
	grid-column: span 1;
}

.sc-month-view .sc-day-cell {
	min-height: 100px;
}

.sc-day-header {
	padding: 6px 8px;
	background: #f0f0f1;
	border-bottom: 1px solid #dcdcde;
	border-right: 1px solid #dcdcde;
	text-align: center;
	font-weight: 600;
	font-size: 12px;
	line-height: 1;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.sc-month-view .sc-day-header:nth-child(8) {
	border-right: none;
}

.sc-day-cell {
	min-height: 100px;
	border: 1px solid #dcdcde;
	padding: 8px;
	position: relative;
	overflow: visible;
	height: auto;
}

.sc-day-cell.other-month {
	background: #f9f9f9;
	color: #999;
}

.sc-day-cell.today {
	background: #fffbea;
}

.sc-week-day-column.today {
	background: #fffbea;
}

.sc-day-number {
	font-weight: 600;
	margin-bottom: 5px;
}

.sc-event {
	background: #2271b1;
	color: #222222;
	padding: 4px 6px;
	margin: 2px 0;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
	overflow: visible;
	white-space: normal;
	word-wrap: break-word;
	display: block;
	max-width: 100%;
	position: relative;
	line-height: 1.3;
}

.sc-event-title {
	display: block;
}

.sc-event-time {
	font-size: 10px;
	opacity: 0.85;
	margin-top: 2px;
	font-weight: normal;
}

.sc-event:hover {
	opacity: 0.85;
	box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* All Day Events in Month View */
.sc-event-allday {
	position: relative;
}

.sc-event-allday-label {
	font-weight: 600;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.sc-event-title {
	display: block;
}

/* Week View */
.sc-week-view {
	display: flex;
	flex-direction: column;
}

.sc-week-view .sc-calendar-title-bar {
	width: 100%;
	display: grid;
}

.sc-week-view-mobile .sc-calendar-title-bar {
	display: grid;
}

.sc-all-day-section {
	display: grid;
	grid-template-columns: 90px repeat(7, 1fr);
	border-bottom: 2px solid #dcdcde;
	background: #fafafa;
	min-height: 40px;
}

.sc-all-day-label {
	padding: 8px;
	font-size: 11px;
	font-weight: 600;
	color: #666;
	text-align: center;
	border-right: 2px solid #dcdcde;
}

.sc-all-day-cell {
	padding: 4px;
	border-right: 1px solid #dcdcde;
	position: relative;
	min-height: 40px;
}

.sc-all-day-cell:last-child {
	border-right: none;
}

.sc-all-day-event {
	background: #A8D5BA;
	color: #222222;
	padding: 4px 6px;
	margin: 2px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 500;
	cursor: pointer;
	border-left: 3px solid;
	position: relative !important;
	top: auto !important;
	height: auto !important;
	left: auto !important;
	right: auto !important;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sc-all-day-event:hover {
	opacity: 0.85;
	box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.sc-week-header {
	display: grid;
	grid-template-columns: 90px repeat(7, 1fr);
	border-bottom: 2px solid #dcdcde;
}

.sc-week-header .sc-day-header {
	border: none;
	border-right: 1px solid #dcdcde;
	padding: 6px 4px;
	font-size: 12px;
	line-height: 1;
}

.sc-week-header .sc-day-header:last-child {
	border-right: none;
}

.sc-week-body {
	display: flex;
	overflow-y: auto;
	max-height: 600px;
}

.sc-time-column {
	width: 90px;
	min-width: 90px;
	flex-shrink: 0;
}

.sc-time-slot {
	height: 60px;
	padding: 5px 8px 5px 5px;
	border-bottom: 1px solid #e0e0e0;
	border-right: 2px solid #dcdcde;
	font-size: 11px;
	color: #666;
	text-align: right;
	white-space: nowrap;
	overflow: visible;
}

.sc-week-grid {
	flex: 1;
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	position: relative;
}

.sc-week-day-column {
	border-right: 1px solid #dcdcde;
	position: relative;
}

.sc-week-day-column:last-child {
	border-right: none;
}

.sc-hour-line {
	height: 60px;
	border-bottom: 1px solid #e0e0e0;
}

.sc-week-event {
	position: absolute;
	background: #2271b1;
	color: #222222 !important;
	padding: 4px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 500;
	cursor: pointer;
	overflow: hidden;
	text-overflow: ellipsis;
	border-left: 3px solid;
	z-index: 1;
	max-width: calc(100% - 8px);
	white-space: normal;
	word-wrap: break-word;
	line-height: 1.3;
}

.sc-week-event:hover {
	opacity: 0.85;
	z-index: 2;
	box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Day View */
.sc-day-view {
	display: flex;
}

.sc-day-view .sc-calendar-title-bar {
	width: 100%;
	display: grid;
}

.sc-day-view .sc-week-event {
	white-space: normal;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.sc-day-header-single {
	text-align: center;
	padding: 8px;
	background: #f0f0f1;
	border-bottom: 2px solid #dcdcde;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
}

.sc-day-view .sc-all-day-section {
	grid-template-columns: 90px 1fr;
}

/* List View */
.sc-list-view {
	display: flex;
	flex-direction: column;
}

.sc-list-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 15px 20px;
	background: #f0f0f1;
	border-bottom: 2px solid #dcdcde;
}

.sc-list-title {
	font-size: 18px;
	font-weight: 600;
	margin: 0;
}

.sc-list-body {
	padding: 20px;
}

.sc-list-day {
	margin-bottom: 30px;
}

.sc-list-day:last-child {
	margin-bottom: 10px;
}

.sc-list-day-header {
	font-size: 16px;
	font-weight: 600;
	color: #333;
	margin-bottom: 12px;
	padding-bottom: 8px;
	border-bottom: 2px solid #dcdcde;
}

.sc-list-day-date {
	color: #666;
	font-size: 14px;
	font-weight: normal;
	margin-left: 10px;
}

.sc-list-event {
	background: white;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	padding: 12px 15px;
	margin-bottom: 10px;
	cursor: pointer;
	transition: box-shadow 0.2s, transform 0.2s;
	border-left: 4px solid;
}

.sc-list-event:hover {
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
	transform: translateX(2px);
}

.sc-list-event-title {
	font-size: 15px;
	font-weight: 600;
	color: #333;
	margin-bottom: 5px;
}

.sc-list-event-time {
	font-size: 13px;
	color: #666;
	margin-bottom: 5px;
}

.sc-list-event-description {
	font-size: 13px;
	color: #555;
	margin-top: 8px;
	line-height: 1.5;
}

.sc-list-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 15px;
	padding: 20px;
	border-top: 1px solid #dcdcde;
}

.sc-list-page-btn {
	padding: 8px 16px;
	background: #E07A5F;
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	transition: background 0.2s;
}

.sc-list-page-btn:hover:not(:disabled) {
	background: #C96850;
}

.sc-list-page-btn:disabled {
	background: #d0d0d0;
	cursor: not-allowed;
	opacity: 0.6;
}

.sc-list-page-info {
	font-size: 14px;
	color: #666;
}

.sc-list-no-events {
	text-align: center;
	padding: 40px 20px;
	color: #999;
	font-size: 16px;
}

/* Modal */
.sc-modal {
	display: none;
	position: fixed;
	z-index: 999999;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	overflow: auto;
	background-color: rgba(0,0,0,0);
	transition: background-color 0.3s ease;
}

.sc-modal.active {
	display: block;
	animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
	from {
		background-color: rgba(0,0,0,0);
	}
	to {
		background-color: rgba(0,0,0,0.6);
	}
}

.sc-modal-content {
	background-color: #fefefe;
	margin: 10% auto;
	padding: 20px;
	border: 1px solid #888;
	border-radius: 4px;
	width: 80%;
	max-width: 500px;
	opacity: 0;
	transform: scale(0.95);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.sc-modal.active .sc-modal-content {
	opacity: 1;
	transform: scale(1);
}

.sc-close {
	color: #aaa;
	float: right;
	font-size: 28px;
	font-weight: bold;
	cursor: pointer;
}

.sc-close:hover,
.sc-close:focus {
	color: black;
}

#sc-modal-title {
	margin-top: 0;
}

#sc-modal-description {
	margin: 15px 0;
	line-height: 1.6;
}

#sc-modal-time {
	color: #666;
	font-size: 14px;
}

/* Custom Tooltip */
.sc-custom-tooltip {
	position: absolute;
	padding: 8px 12px;
	border-radius: 4px;
	font-size: 13px;
	font-weight: 500;
	color: #222222;
	z-index: 10000;
	pointer-events: none;
	max-width: 300px;
	word-wrap: break-word;
	box-shadow: 0 4px 12px rgba(0,0,0,0.25);
	opacity: 0;
	transition: opacity 0.15s ease-in;
	line-height: 1.4;
}

.sc-custom-tooltip.show {
	opacity: 1;
}

/* Arrow pointing down (tooltip above event) */
.sc-custom-tooltip::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 20px;
	border: 6px solid transparent;
	border-top-color: inherit;
}

/* Arrow pointing up (tooltip below event) */
.sc-custom-tooltip.below::after {
	top: auto;
	bottom: 100%;
	border-top-color: transparent;
	border-bottom-color: inherit;
}

/* Mobile Responsive Styles */
@media (min-width: 769px) {
	.sc-all-day-label {
		width: 90px;
		min-width: 90px;
	}
	
	.sc-time-column {
		width: 90px;
		min-width: 90px;
	}
}

@media (max-width: 768px) {
	#simple-calendar-container {
		padding: 10px;
	}
	
	.sc-header {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
	}
	
	.sc-header-left,
	.sc-header-right {
		width: 100%;
		justify-content: center;
		flex-wrap: wrap;
	}
	
	#sc-title {
		font-size: 18px;
		order: 2;
		margin-bottom: 5px;
	}
	
	.sc-header-left {
		order: 1;
	}
	
	.sc-header-right {
		order: 3;
		justify-content: space-between;
	}
	
	.sc-view-controls {
		order: 1;
	}
	
	.sc-category-filter-wrapper {
		order: 2;
	}
	
	.sc-date-picker-wrapper {
		order: 3;
	}
	
	.sc-view-btn[data-view="month"] {
		display: none;
	}
	
	.sc-nav-btn,
	.sc-view-btn,
	.sc-date-picker,
	.sc-category-filter {
		padding: 10px 14px;
		font-size: 16px;
		min-height: 44px;
	}
	
	/* Week view - mobile list style */
	.sc-week-view-mobile {
		display: flex;
		flex-direction: column;
		gap: 10px;
	}
	
	.sc-week-view-mobile .sc-calendar-title-bar {
		margin-bottom: 0;
	}
	
	.sc-week-mobile-day {
		background: white;
		border: 1px solid #dcdcde;
		border-radius: 4px;
		padding: 12px;
	}
	
	.sc-week-mobile-day.today {
		background: #fffbea;
		border-color: #6B8E23;
		border-width: 2px;
	}
	
	.sc-week-mobile-day-header {
		font-weight: 600;
		font-size: 16px;
		margin-bottom: 8px;
		color: #333;
	}
	
	.sc-week-mobile-event {
		background: #2271b1;
		color: #222222 !important;
		padding: 8px 10px;
		margin: 5px 0;
		border-radius: 3px;
		font-size: 14px;
		font-weight: 500;
		cursor: pointer;
		border-left: 3px solid;
	}
	
	.sc-week-mobile-event:hover {
		opacity: 0.9;
	}
	
	.sc-week-mobile-event-time {
		color: #222222 !important;
	}
	
	.sc-week-mobile-event-time {
		font-size: 12px;
		opacity: 0.9;
		margin-top: 3px;
	}
	
	.sc-week-mobile-no-events {
		color: #999;
		font-style: italic;
		font-size: 14px;
	}
	
	/* Hide desktop week view on mobile */
	.sc-week-view {
		display: none;
	}
	
	.sc-time-column {
		width: 70px;
		min-width: 70px;
	}
	
	.sc-all-day-label {
		width: 70px !important;
		min-width: 70px !important;
		max-width: 70px !important;
		box-sizing: border-box !important;
		padding: 8px 2px !important;
		font-size: 10px !important;
	}
	
	.sc-day-view .sc-all-day-section {
		grid-template-columns: 70px 1fr !important;
	}
	
	.sc-all-day-section {
		grid-template-columns: 70px repeat(7, 1fr) !important;
	}
	
	.sc-event,
	.sc-week-event {
		min-height: 30px;
		font-size: 13px;
		padding: 6px;
	}
	
	/* List view mobile adjustments */
	.sc-list-body {
		padding: 15px;
	}
	
	.sc-list-day {
		margin-bottom: 25px;
	}
	
	.sc-list-day-header {
		font-size: 15px;
	}
	
	.sc-list-event {
		padding: 10px 12px;
	}
	
	/* Modal adjustments */
	.sc-modal-content {
		width: 90%;
		margin: 20% auto;
	}
}

@media (max-width: 480px) {
	#sc-title {
		font-size: 16px;
	}
	
	.sc-nav-btn,
	.sc-view-btn {
		padding: 8px 10px;
		font-size: 14px;
	}
	
	.sc-time-column {
		width: 70px;
		min-width: 70px;
	}
	
	.sc-week-header {
		grid-template-columns: 70px 1fr;
	}
	
	.sc-date-picker-wrapper label {
		font-size: 12px;
	}
	
	.sc-list-day-header {
		font-size: 14px;
	}
	
	.sc-list-event-title {
		font-size: 14px;
	}
}
