/* CSS for Index Page - Pali Thunder */
/* Compatible with Tailwind CSS and preserves meta functionality */

/* Base styles - ไม่ใช้ universal reset เพื่อไม่ conflict กับ Tailwind */
body {
	font-family: "Sarabun", sans-serif;
	line-height: 1.6;
	color: #333;
	margin: 0;
	padding: 0;
}

.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 1rem;
}

/* Header styles */
header {
	background: white;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	position: sticky;
	top: 0;
	z-index: 100;
}

nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1rem 0;
}

.logo {
	display: flex;
	align-items: center;
	font-size: 1.5rem;
	font-weight: bold;
	color: #ea580c;
	text-decoration: none;
}

.logo img {
	width: 40px;
	height: 40px;
	margin-right: 0.75rem;
}

.nav-buttons {
	display: flex;
	align-items: center;
	gap: 1rem;
}

/* Button styles */
.btn {
	display: inline-flex;
	align-items: center;
	padding: 0.5rem 1.5rem;
	border-radius: 0.5rem;
	font-weight: bold;
	text-decoration: none;
	border: none;
	cursor: pointer;
	transition: all 0.3s ease;
	font-family: "Sarabun", sans-serif;
}

.btn-orange {
	background-color: #ea580c;
	color: white;
}

.btn-orange:hover {
	background-color: #dc2626;
}

.btn-blue {
	background-color: #3b82f6;
	color: white;
}

.btn-blue:hover {
	background-color: #2563eb;
}

.btn-white {
	background-color: white;
	color: #ea580c;
}

.btn-white:hover {
	background-color: #f3f4f6;
}

/* Hero section */
.hero-section {
	background: linear-gradient(135deg, #f97316 0%, #dc2626 100%);
	color: white;
	padding: 4rem 0;
	text-align: center;
}

.hero-logo {
	margin-bottom: 2rem;
}

.hero-logo img {
	width: 96px;
	height: 96px;
	margin: 0 auto 1rem;
	background: rgba(255, 255, 255, 0.2);
	padding: 1rem;
	border-radius: 50%;
	display: block;
}

.hero-title {
	font-size: 3rem;
	font-weight: bold;
	margin-bottom: 1.5rem;
	line-height: 1.2;
}

.hero-subtitle {
	font-size: 1.25rem;
	margin-bottom: 2rem;
	opacity: 0.9;
}

.hero-buttons {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	align-items: center;
}

.hero-buttons .btn {
	padding: 0.75rem 2rem;
	font-size: 1.125rem;
}

/* Features section */
.features-section {
	padding: 4rem 0;
	background: white;
}

.section-title {
	font-size: 2rem;
	font-weight: bold;
	text-align: center;
	margin-bottom: 3rem;
	color: #1f2937;
}

.features-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
}

.feature-card {
	text-align: center;
	padding: 2rem;
	border-radius: 0.5rem;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.feature-icon {
	font-size: 3rem;
	color: #ea580c;
	margin-bottom: 1rem;
	display: block;
}

.feature-title {
	font-size: 1.25rem;
	font-weight: bold;
	margin-bottom: 0.5rem;
	color: #1f2937;
}

.feature-description {
	color: #6b7280;
}

/* Lessons section */
.lessons-section {
	padding: 4rem 0;
	background: #f9fafb;
}

.lessons-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
}

.lesson-card {
	background: white;
	border-radius: 0.5rem;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
	transition: all 0.3s ease;
	cursor: pointer;
}

.lesson-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.lesson-card-content {
	padding: 1.5rem;
}

.lesson-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.75rem;
}

.lesson-badge {
	background: #fed7aa;
	color: #9a3412;
	font-size: 0.75rem;
	font-weight: bold;
	padding: 0.25rem 0.5rem;
	border-radius: 9999px;
}

.lesson-number {
	color: #6b7280;
	font-size: 0.875rem;
}

.lesson-title {
	font-size: 1.125rem;
	font-weight: bold;
	margin-bottom: 0.5rem;
	color: #1f2937;
}

.lesson-module {
	color: #6b7280;
	font-size: 0.875rem;
	margin-bottom: 1rem;
}

.lesson-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.lesson-link {
	color: #ea580c;
	font-weight: bold;
	text-decoration: none;
}

.lesson-link:hover {
	text-decoration: underline;
}

/* CTA section */
.cta-section {
	padding: 4rem 0;
	background: #ea580c;
	color: white;
	text-align: center;
}

.cta-title {
	font-size: 2rem;
	font-weight: bold;
	margin-bottom: 1rem;
}

.cta-description {
	font-size: 1.25rem;
	margin-bottom: 2rem;
	opacity: 0.9;
}

/* Loading and error states */
.loading-state,
.error-state,
.empty-state {
	text-align: center;
	padding: 5rem 0;
}

.loading-spinner {
	font-size: 3rem;
	color: #ea580c;
	margin-bottom: 1rem;
}

.error-icon {
	font-size: 3rem;
	color: #ef4444;
	margin-bottom: 1rem;
}

.empty-icon {
	font-size: 3rem;
	color: #9ca3af;
	margin-bottom: 1rem;
}

/* Modal styles */
.modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
	padding: 1rem;
	backdrop-filter: blur(5px);
}

.modal-content {
	background: white;
	border-radius: 0.75rem;
	box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
	max-width: 28rem;
	width: 100%;
	padding: 2rem;
	position: relative;
}

.modal-header {
	text-align: center;
	margin-bottom: 1.5rem;
}

.modal-logo {
	width: 64px;
	height: 64px;
	margin: 0 auto 0.5rem;
	display: block;
}

.modal-title {
	font-size: 1.5rem;
	font-weight: bold;
	color: #1f2937;
}

.modal-subtitle {
	color: #6b7280;
	margin-top: 0.5rem;
}

.modal-close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	background: none;
	border: none;
	color: #9ca3af;
	cursor: pointer;
	font-size: 1.25rem;
}

.modal-close:hover {
	color: #6b7280;
}

/* Form styles */
.form-group {
	margin-bottom: 1rem;
}

.form-label {
	display: block;
	font-size: 0.875rem;
	font-weight: bold;
	color: #6b7280;
	margin-bottom: 0.25rem;
}

.form-input {
	width: 100%;
	padding: 0.75rem;
	border: 1px solid #d1d5db;
	border-radius: 0.5rem;
	font-size: 1rem;
	transition: border-color 0.3s ease;
	font-family: "Sarabun", sans-serif;
	box-sizing: border-box;
}

.form-input:focus {
	outline: none;
	border-color: #ea580c;
	box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.1);
}

.form-button {
	width: 100%;
	padding: 0.75rem;
	margin-top: 1rem;
	border: none;
	border-radius: 0.5rem;
	font-weight: bold;
	cursor: pointer;
	transition: background-color 0.3s ease;
	font-family: "Sarabun", sans-serif;
}

.form-switch {
	text-align: center;
	margin-top: 1rem;
}

.form-switch button {
	background: none;
	border: none;
	color: #3b82f6;
	font-weight: bold;
	cursor: pointer;
	text-decoration: underline;
	font-family: "Sarabun", sans-serif;
}

.error-message {
	padding: 1rem;
	background: #fee2e2;
	border: 1px solid #fecaca;
	color: #991b1b;
	border-radius: 0.5rem;
	margin-bottom: 1rem;
	text-align: center;
}

/* Responsive design */
@media (min-width: 768px) {
	.container {
		padding: 0 1.5rem;
	}

	.hero-title {
		font-size: 4rem;
	}

	.hero-subtitle {
		font-size: 1.5rem;
	}

	.hero-buttons {
		flex-direction: row;
		justify-content: center;
	}

	.features-grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.lessons-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1024px) {
	.lessons-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* Utility classes - specific to avoid conflicts */
.index-text-center {
	text-align: center;
}
.index-text-left {
	text-align: left;
}
.index-text-right {
	text-align: right;
}
.index-font-bold {
	font-weight: bold;
}
.index-mb-2 {
	margin-bottom: 0.5rem;
}
.index-mb-4 {
	margin-bottom: 1rem;
}
.index-mr-2 {
	margin-right: 0.5rem;
}
.index-mt-4 {
	margin-top: 1rem;
}
.index-hidden {
	display: none;
}

/* Animation */
@keyframes spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

.fa-spin {
	animation: spin 1s linear infinite;
}

/* Override utility classes to use standard names for compatibility */
.text-center {
	text-align: center;
}
.text-left {
	text-align: left;
}
.text-right {
	text-align: right;
}
.font-bold {
	font-weight: bold;
}
.mb-2 {
	margin-bottom: 0.5rem;
}
.mb-4 {
	margin-bottom: 1rem;
}
.mr-2 {
	margin-right: 0.5rem;
}
.mt-4 {
	margin-top: 1rem;
}
.hidden {
	display: none;
}
