/**
 * Styles for Football Pool Predictions Stats refreshable widgets.
 *
 * @package football-pool-predictions-stats
 */

/* Refreshable container */
.fpps-refreshable {
	position: relative;
}

/* Loading state */
.fpps-refreshable.fpps-refreshing {
	opacity: 0.6;
	transition: opacity 0.2s ease-in-out;
}

.fpps-refreshable.fpps-refreshing::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 30px;
	height: 30px;
	margin-top: -15px;
	margin-left: -15px;
	border: 3px solid rgba( 0, 0, 0, 0.1 );
	border-top-color: #333;
	border-radius: 50%;
	animation: fpps-spin 0.8s linear infinite;
}

@keyframes fpps-spin {
	to {
		transform: rotate( 360deg );
	}
}

/* Login prompt styling */
.fpps-login-prompt {
	font-style: italic;
	color: #666;
}

/* ==========================================================================
   Carousel Styles
   ========================================================================== */

.fpps-carousel {
	position: relative;
	width: 100%;
	margin: 0 auto;
}

/* Carousel Header */
.fpps-carousel-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 15px;
	background: #f5f5f5;
	border: 1px solid #ddd;
	border-bottom: none;
	border-radius: 4px 4px 0 0;
}

.fpps-carousel-counter {
	font-weight: bold;
	color: #333;
}

.fpps-carousel-group-name {
	font-weight: 600;
	color: #555;
	text-transform: uppercase;
	font-size: 0.9em;
}

/* Carousel Container */
.fpps-carousel-container {
	display: flex;
	align-items: stretch;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 0 0 4px 4px;
	position: relative;
	overflow: hidden;
}

/* Navigation Buttons */
.fpps-carousel-nav {
	flex: 0 0 40px;
	width: 40px;
	background: rgba(0, 0, 0, 0.05);
	border: none;
	cursor: pointer;
	font-size: 20px;
	color: #555;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	z-index: 10;
}

.fpps-carousel-nav:hover {
	background: rgba(0, 0, 0, 0.1);
	color: #333;
}

.fpps-carousel-nav:focus {
	outline: 2px solid #0073aa;
	outline-offset: -2px;
}

.fpps-carousel-prev {
	border-right: 1px solid #ddd;
}

.fpps-carousel-next {
	border-left: 1px solid #ddd;
}

.fpps-carousel-arrow {
	display: block;
	line-height: 1;
}

/* Carousel Viewport */
.fpps-carousel-viewport {
	flex: 1 1 auto;
	overflow: hidden;
	position: relative;
}

.fpps-carousel-track {
	display: flex;
	transition: transform 0.3s ease;
}

/* Carousel Slides */
.fpps-carousel-slide {
	flex: 0 0 100%;
	width: 100%;
	display: none;
	padding: 15px;
	box-sizing: border-box;
}

.fpps-carousel-slide-active {
	display: block;
}

.fpps-carousel-content {
	/* Inherits from core Football Pool styles */
}

/* Carousel Dots */
.fpps-carousel-dots {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	padding: 15px 10px;
	background: #f5f5f5;
	border: 1px solid #ddd;
	border-top: none;
	border-radius: 0 0 4px 4px;
}

.fpps-carousel-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	border: 2px solid #ccc;
	background: #fff;
	cursor: pointer;
	transition: all 0.2s ease;
	padding: 0;
}

.fpps-carousel-dot:hover {
	border-color: #999;
	background: #f0f0f0;
}

.fpps-carousel-dot-active,
.fpps-carousel-dot-active:hover {
	background: #333;
	border-color: #333;
}

.fpps-carousel-dot:focus {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

/* Loading State for Carousel */
.fpps-carousel.fpps-refreshing {
	opacity: 0.7;
}

.fpps-carousel.fpps-refreshing::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 40px;
	height: 40px;
	margin-top: -20px;
	margin-left: -20px;
	border: 3px solid rgba(0, 0, 0, 0.1);
	border-top-color: #333;
	border-radius: 50%;
	animation: fpps-spin 0.8s linear infinite;
	z-index: 100;
}

/* No groups message */
.fpps-no-groups {
	padding: 20px;
	text-align: center;
	color: #666;
	font-style: italic;
}

/* Responsive Styles */
@media (max-width: 600px) {
	.fpps-carousel-nav {
		flex: 0 0 35px;
		width: 35px;
		font-size: 16px;
	}

	.fpps-carousel-header {
		flex-direction: column;
		gap: 5px;
		text-align: center;
	}

	.fpps-carousel-slide {
		padding: 10px;
	}

	.fpps-carousel-dot {
		width: 10px;
		height: 10px;
	}
}

/* Dark mode support (optional, if theme supports it) */
@media (prefers-color-scheme: dark) {
	.fpps-carousel-header,
	.fpps-carousel-dots {
		background: #2a2a2a;
		border-color: #444;
	}

	.fpps-carousel-container {
		background: #1a1a1a;
		border-color: #444;
	}

	.fpps-carousel-nav {
		background: rgba(255, 255, 255, 0.05);
		color: #aaa;
	}

	.fpps-carousel-nav:hover {
		background: rgba(255, 255, 255, 0.1);
		color: #fff;
	}

	.fpps-carousel-counter {
		color: #ddd;
	}

	.fpps-carousel-group-name {
		color: #bbb;
	}

	.fpps-carousel-dot {
		background: #2a2a2a;
		border-color: #555;
	}

	.fpps-carousel-dot:hover {
		background: #3a3a3a;
		border-color: #777;
	}

	.fpps-carousel-dot-active,
	.fpps-carousel-dot-active:hover {
		background: #fff;
		border-color: #fff;
	}
}
