/**
 * Public styles for Thai PBS Extra Content
 *
 * @package TPBS_Extra_Content
 * @since 1.0.0
 */

/* Reset and Base Styles */
.tpbs-content-wrapper {
	box-sizing: border-box;
}

.tpbs-content-wrapper *,
.tpbs-content-wrapper *:before,
.tpbs-content-wrapper *:after {
	box-sizing: inherit;
}

/* Single Content */
.tpbs-content-single {
	margin: 20px 0;
	padding: 20px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tpbs-content-single h3 {
	margin-top: 0;
	color: #333;
	font-size: 24px;
	line-height: 1.4;
}

.tpbs-content-single p {
	color: #666;
	line-height: 1.6;
	margin-bottom: 15px;
}

/* Content List */
.tpbs-content-list {
	margin: 20px 0;
}

.tpbs-content-list h3 {
	color: #333;
	border-bottom: 2px solid #0073aa;
	padding-bottom: 10px;
	margin-bottom: 20px;
}

.tpbs-content-list ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.tpbs-content-list li {
	padding: 12px 0;
	border-bottom: 1px solid #eee;
	transition: background-color 0.3s ease;
}

.tpbs-content-list li:hover {
	background-color: #f9f9f9;
	padding-left: 10px;
}

.tpbs-content-list li:last-child {
	border-bottom: none;
}

/* Content Grid */
.tpbs-content-grid {
	display: grid;
	gap: 20px;
	margin: 20px 0;
}

.tpbs-grid-cols-1 { grid-template-columns: 1fr; }
.tpbs-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.tpbs-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.tpbs-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.tpbs-grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
.tpbs-grid-cols-6 { grid-template-columns: repeat(6, 1fr); }

.tpbs-grid-item {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 20px;
	transition: all 0.3s ease;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tpbs-grid-item:hover {
	transform: translateY(-5px);
	box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.tpbs-grid-item h4 {
	margin-top: 0;
	color: #333;
	font-size: 18px;
	line-height: 1.4;
}

.tpbs-grid-item p {
	color: #666;
	line-height: 1.6;
	margin-bottom: 0;
}

/* Content Carousel */
.tpbs-content-carousel {
	position: relative;
	margin: 20px 0;
	overflow: hidden;
	border-radius: 8px;
}

.tpbs-carousel-wrapper {
	display: flex;
	transition: transform 0.3s ease;
}

.tpbs-carousel-slide {
	min-width: 100%;
	padding: 40px;
	background: #fff;
	border: 1px solid #e0e0e0;
	text-align: center;
}

.tpbs-carousel-slide h4 {
	margin-top: 0;
	color: #333;
	font-size: 20px;
	line-height: 1.4;
}

.tpbs-carousel-slide p {
	color: #666;
	line-height: 1.6;
	margin-bottom: 0;
}

/* Carousel Controls */
.tpbs-carousel-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0,0,0,0.5);
	color: #fff;
	border: none;
	padding: 10px 15px;
	cursor: pointer;
	border-radius: 4px;
	font-size: 18px;
	transition: background-color 0.3s ease;
}

.tpbs-carousel-nav:hover {
	background: rgba(0,0,0,0.7);
}

.tpbs-carousel-prev {
	left: 10px;
}

.tpbs-carousel-next {
	right: 10px;
}

.tpbs-carousel-dots {
	text-align: center;
	padding: 20px 0;
}

.tpbs-carousel-dot {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #ccc;
	margin: 0 5px;
	cursor: pointer;
	transition: background-color 0.3s ease;
}

.tpbs-carousel-dot.active {
	background: #0073aa;
}

/* Load More Button */
.tpbs-load-more {
	text-align: center;
	margin: 30px 0;
}

.tpbs-load-more-btn {
	display: inline-block;
	padding: 12px 24px;
	background: #0073aa;
	color: #fff;
	text-decoration: none;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 16px;
	transition: background-color 0.3s ease;
}

.tpbs-load-more-btn:hover,
.tpbs-load-more-btn:focus {
	background: #005a87;
	color: #fff;
	text-decoration: none;
}

.tpbs-load-more-btn:disabled {
	background: #ccc;
	cursor: not-allowed;
}

/* Loading States */
.tpbs-loading {
	position: relative;
	opacity: 0.6;
	pointer-events: none;
}

.tpbs-loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 20px;
	margin: -10px 0 0 -10px;
	border: 2px solid #f3f3f3;
	border-top: 2px solid #0073aa;
	border-radius: 50%;
	animation: tpbs-spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 1024px) {
	.tpbs-grid-cols-6 { grid-template-columns: repeat(4, 1fr); }
	.tpbs-grid-cols-5 { grid-template-columns: repeat(3, 1fr); }
	.tpbs-grid-cols-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
	.tpbs-grid-cols-6,
	.tpbs-grid-cols-5,
	.tpbs-grid-cols-4,
	.tpbs-grid-cols-3 { 
		grid-template-columns: repeat(2, 1fr); 
	}
	
	.tpbs-grid-item {
		padding: 15px;
	}
	
	.tpbs-content-single {
		padding: 15px;
	}
	
	.tpbs-carousel-slide {
		padding: 20px;
	}
}

@media (max-width: 480px) {
	.tpbs-grid-cols-6,
	.tpbs-grid-cols-5,
	.tpbs-grid-cols-4,
	.tpbs-grid-cols-3,
	.tpbs-grid-cols-2 { 
		grid-template-columns: 1fr; 
	}
	
	.tpbs-carousel-nav {
		display: none;
	}
	
	.tpbs-content-list li:hover {
		padding-left: 5px;
	}
}

/* Accessibility */
.tpbs-sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0,0,0,0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* Focus styles for better accessibility */
.tpbs-load-more-btn:focus,
.tpbs-carousel-nav:focus,
.tpbs-carousel-dot:focus {
	outline: 2px solid #005a87;
	outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
	.tpbs-content-single,
	.tpbs-grid-item {
		border-color: #000;
		box-shadow: none;
	}
	
	.tpbs-content-list li {
		border-bottom-color: #000;
	}
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
	.tpbs-grid-item,
	.tpbs-carousel-wrapper,
	.tpbs-carousel-nav,
	.tpbs-carousel-dot,
	.tpbs-load-more-btn,
	.tpbs-content-list li {
		transition: none;
	}
	
	.tpbs-grid-item:hover {
		transform: none;
	}
	
	@keyframes tpbs-spin {
		0%, 100% { transform: rotate(0deg); }
	}
}