/**
 * Ocean Prosperity Calendar Picker Widget Styles
 *
 * @package    Oceanprosperity_Core
 * @since      1.0.0
 */

/* ==========================================================================
   Calendar Picker Container
   ========================================================================== */

.op-calendar-picker-widget {
	width: 100%;
	margin: 0 auto;
}

.op-calendar-picker-container {
    display: grid;
    grid-template-columns: minmax(350px, 400px) 1fr;
    gap: 5px;
    align-items: start;
}

@media (max-width: 992px) {
	.op-calendar-picker-container {
		grid-template-columns: 1fr;
		gap: 30px;
	}
}

/* ==========================================================================
   Calendar Section
   ========================================================================== */

.op-calendar-section {
	position: sticky;
	top: 20px;
}

.op-calendar-title {
	font-weight: 400;
	margin: 0 0 24px;
	color: #343434;
}

.op-calendar-wrapper {
	border-radius: 8px;
}

.op-calendar {
	width: 100%;
}

.op-calendar.loading {
	opacity: 0.6;
	pointer-events: none;
}

/* Calendar Header */
.op-calendar-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
}

.op-calendar-header__month {
	color: #343434;
}

.op-calendar-nav {
	background: none;
	border: none;
	padding: 8px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
}

/* Calendar Weekdays */
.op-calendar-weekdays {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
	margin-bottom: 8px;
}

.op-calendar-weekdays span {
	text-align: center;
	font-size: 12px;
	font-weight: 400;
	color: #666;
	padding: 8px 0;
	text-transform: uppercase;
}

/* Calendar Days */
.op-calendar-days {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 10px
}

.op-calendar-day {
	aspect-ratio: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 400;
	color: #666;
	border-radius: 50%;
	cursor: pointer;
	position: relative;
}

.op-calendar-day.empty {
	cursor: default;
	pointer-events: none;
}

.op-calendar-day.today {
	border: 2px solid #5176ed;
}

.op-calendar-day.has-event {
	color: #5176ed;
	background-color: #e8edfe;
}

.op-calendar-day.selected,
.op-calendar-day.has-event:hover {
	background-color: #5176ed;
	color: #ffffff;
}

/* Calendar Navigation Buttons */
.op-calendar-nav-buttons {
	display: flex;
	flex-direction: row;
	gap: 12px;
	margin-top: 20px;
}

.op-nav-button {
	display: flex;
	flex: 1;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 20px;
	border: 1px solid #e0e0e0;
	border-radius: 100px;
	font-size: 14px;
	font-weight: 400;
	cursor: pointer;
}

.op-nav-button:hover:not(:disabled) {
	border-color: #5176ed;
}

.op-nav-button:disabled,
.op-nav-button.disabled {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
}

/* ==========================================================================
   Events Section
   ========================================================================== */

.op-events-section {
    padding-top: 50px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-content: center;
    justify-content: center;
    align-items: center;
}

.op-events-list {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.op-events-list.loading {
	opacity: 0.6;
	pointer-events: none;
}

.op-events-no-results {
	padding: 40px 20px;
	text-align: center;
}

.op-events-no-results p {
	font-size: 16px;
	color: #666;
	margin: 0;
}

/* Event Item */
.op-event-item {
	border-radius: 8px;
	overflow: hidden;
}

.op-event-item__image {
	width: 100%;
	height: 240px;
	margin-bottom: 0;
	overflow: hidden;
}

.op-event-item__image img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
}

.op-event-item__content {
	padding: 24px;
}

/* Event Status Label */
.op-event-status-label {
	display: inline-block;
}

.op-event-status-label h6 {
	font-weight: 500;
    color: var(--e-global-color-primary);
}


/* Event Title */
.op-event-title {
	margin: 0 0 16px;
	line-height: 1.3;
}

/* Event Meta */
.op-event-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin-bottom: 16px;
}
.op-event-meta .op-event-date-icon,
.op-event-meta .op-event-location-icon {  
    background-color: var(--e-global-color-967f2ec);
    border: 1px solid var(--e-global-color-11f568f);
	border-radius: 8px;
	padding: 5px;
	line-height: 0;
}

.op-event-meta-item {
	display: flex;
	align-items: center;
	gap: 8px;
	color: #666;
}


/* Event Excerpt */
.op-event-excerpt {
	font-weight: 400;
	margin-bottom: 20px;
}

/* Event Button */
.op-event-button {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	border-radius: 100px;
	text-decoration: none;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.op-events-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin-top: 40px;
	padding-top: 30px;
	border-top: 1px solid #e0e0e0;
}

.op-events-pagination a,
.op-events-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 400;
	color: #666;
	text-decoration: none;
}

.op-events-pagination a:hover {
    border-color: var(--e-global-color-9915f2b);
}

.op-events-pagination .page-numbers.current {
    /* background: aliceblue; */
    color: var(--e-global-color-98d4396);
    background-color: var(--e-global-color-9915f2b);
}

.op-events-pagination .dots {
	border: none;
	pointer-events: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
	.op-calendar-title {
		font-size: 24px;
		margin-bottom: 20px;
	}

	.op-calendar-wrapper {
		padding: 15px;
	}

	.op-calendar-header__month {
		font-size: 18px;
	}

	.op-calendar-weekdays span {
		font-size: 11px;
		padding: 6px 0;
	}

	.op-calendar-day {
		font-size: 13px;
	}

	.op-event-title {
		font-size: 20px;
	}

	.op-event-item {
		padding: 20px;
	}

	.op-event-meta {
		gap: 16px;
	}

	.op-event-button {
		width: 100%;
		justify-content: center;
	}

	.op-calendar-nav-buttons {
		flex-direction: row;
	}

	.op-nav-button {
		flex: 1;
		font-size: 13px;
		padding: 10px 16px;
	}
}

@media (max-width: 480px) {
	.op-calendar-picker-container {
		gap: 20px;
	}
	.op-calendar-section {
		position: relative;
	}

	.op-calendar-section {
		border-right: unset;
		padding: 0px;
	}
	.op-calendar-wrapper {
		padding: 5px;
	}

	.op-calendar-weekdays span {
		font-size: 10px;
	}

	.op-calendar-day {
		font-size: 12px;
	}

	.op-event-meta {
		flex-direction: column;
		gap: 12px;
	}
	.op-events-section {
		padding-top: 20px;
	}
	op-calendar-nav-buttons {
		padding: 5px;
	}
	.op-event-item__content {
		padding: 0px;
	}
	.op-event-item {
        padding: 10px;
    }
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.op-calendar.loading::after,
.op-events-list.loading::after {
	content: "";
	position: absolute;
	transform: translate(-50%, -50%);
	width: 40px;
	height: 40px;
	border: 4px solid #f3f3f3;
	border-top: 4px solid #5176ed;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}
.op-events-list.loading::after{
	top: 50%;
	left: 70%;
}
.op-calendar.loading::after{
	top: 50%;
	left: 50%;
}

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

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.op-calendar-picker-widget * {
	box-sizing: border-box;
}
