/* AmaEducacional LMS Base Styles */

:root {
	--ama-primary: #5A2CD8;
	/* Udemy Purple-ish */
	--ama-dark: #1C1D1F;
	--ama-gray: #F7F9FA;
	--ama-white: #FFFFFF;
	--ama-text: #2D2F31;
}

.ama-lms-catalog.columns-3 {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
}

.ama-course-card {
	border: 1px solid #ddd;
	background: var(--ama-white);
	transition: box-shadow 0.2s;
}

.ama-course-card:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ama-course-thumb img {
	width: 100%;
	height: auto;
	display: block;
}

.ama-course-info {
	padding: 10px;
}

.ama-course-title {
	font-size: 16px;
	margin: 0 0 5px;
}

.ama-course-title a {
	color: var(--ama-text);
	text-decoration: none;
}

/* Player Styles */
.ama-lms-player-container {
	display: flex;
	height: 80vh;
	/* Full viewport height minus header usually */
	border: 1px solid #ccc;
}

.ama-lms-sidebar {
	width: 300px;
	background: var(--ama-gray);
	border-right: 1px solid #ccc;
	overflow-y: auto;
	padding: 15px;
}

.ama-lms-content-area {
	flex: 1;
	padding: 30px;
	overflow-y: auto;
}

.ama-lms-section-title {
	font-size: 14px;
	font-weight: bold;
	margin-top: 15px;
	margin-bottom: 5px;
}

.ama-lms-lesson-item a {
	display: block;
	padding: 8px 10px;
	text-decoration: none;
	color: var(--ama-text);
	font-size: 14px;
}

.ama-lms-lesson-item a:hover {
	background: #eee;
}

.ama-lms-video-container iframe {
	width: 100%;
	aspect-ratio: 16/9;
}

/* Public Course Page */
.ama-course-curriculum-public {
	margin-top: 40px;
	padding: 20px;
	background: #f9f9f9;
	border: 1px solid #eee;
	border-radius: 8px;
}

.ama-section-header {
	background: #eee;
	padding: 10px;
	margin: 0;
	font-size: 16px;
}

.ama-section-items {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ama-item {
	padding: 10px;
	border-bottom: 1px solid #ddd;
	background: #fff;
}


/* PLAYER MODE Styles */
.ama-mode-player {
	background: #1c1d1f;
	/* Dark background like Udemy player */
	min-height: 100vh;
	color: #fff;
	padding-top: 10px;
	/* Added padding to clear Theme Header */
}

/* Fix for theme containers if they limit width */
.ama-mode-player .ama-player-layout {
	display: flex;
	max-width: 100%;
	margin: 0;
}

.ama-player-content {
	flex: 3;
	/* 75% width roughly */
	padding: 20px;
}

.ama-player-sidebar {
	flex: 1;
	/* 25% width */
	background: #fff;
	color: #333;
	border-left: 1px solid #ddd;
	min-height: 100vh;
}

.ama-player-header {
	margin-bottom: 20px;
	border-bottom: 1px solid #3e4143;
	padding-bottom: 15px;
}

.ama-player-header h1 {
	color: #fff;
	font-size: 24px;
	margin: 0;
}

.ama-back-link {
	color: #ccc;
	font-size: 14px;
	text-decoration: none;
}

.ama-lesson-excerpt {
	font-size: 16px;
	color: #ccc;
	margin-top: 5px;
	margin-bottom: 10px;
	font-style: italic;
	line-height: 1.4;
}

.ama-lesson-excerpt {
	display: none;
	/* Hide legacy class if present */
}

.ama-sidebar-excerpt {
	font-size: 12px;
	color: #666;
	padding: 0 10px 10px 38px;
	/* Indent to align with text (checkbox width + gap) */
	line-height: 1.3;
}

.ama-content-box {
	background: #000;
	padding: 0;
	border-radius: 8px;
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	height: auto;
	min-height: min(56.25vw, 70vh);
	overflow: hidden;
}

/* Wrappers do embed do WordPress - forçar proporção 16:9 */
.ama-content-box .wp-block-embed,
.ama-content-box .wp-block-embed__wrapper {
	width: 100% !important;
	aspect-ratio: 16 / 9;
	min-height: 400px;
}

.ama-content-box .wp-block-embed__wrapper {
	position: relative;
	overflow: hidden;
}

.ama-content-box .wp-block-embed__wrapper iframe {
	position: absolute !important;
	top: 0;
	left: 0;
	width: 100% !important;
	height: 100% !important;
}

/* Iframe/vídeo direto (sem wrapper WP) */
.ama-content-box > iframe,
.ama-content-box video,
.ama-content-box .wp-block-video {
	width: 100%;
	aspect-ratio: 16 / 9;
	min-height: 400px;
	height: auto;
	max-height: 80vh;
	object-fit: contain;
	display: block;
	margin: 0 auto;
}

.ama-player-controls {
	margin-top: 20px;
	display: flex;
	justify-content: flex-end;
	/* Align Next button to right */
}

/* Sidebar Item Fix */
.ama-item {
	padding: 0;
	border-bottom: 1px solid #eee;
}

.ama-item-row {
	display: flex !important;
	/* Force flex to override theme */
	flex-direction: row !important;
	align-items: center !important;
	padding: 12px 10px;
	gap: 10px;
}

.ama-item-row input[type="checkbox"] {
	width: 16px;
	height: 16px;
	margin: 0 !important;
	/* Remove theme margins */
	cursor: pointer;
	flex-shrink: 0;
	position: relative;
	top: 0;
}

.ama-sidebar-header {
	padding: 15px;
	border-bottom: 1px solid #eee;
	background: #f7f7f7;
}

.ama-section-title {
	background: #ddd;
	padding: 10px;
	margin: 0;
	font-size: 14px;
	font-weight: bold;
}

.ama-section-items {
	list-style: none;
	padding: 0;
	margin: 0;
}

.ama-section-items li a {
	display: block;
	padding: 12px 10px;
	border-bottom: 1px solid #eee;
	text-decoration: none;
	color: #333;
	font-size: 14px;
}

.ama-section-items li.ama-active-item a,
.ama-section-items li a:hover {
	background: #e6f0ff;
	color: #0056b3;
}

.ama-btn-access,
.ama-btn-buy {
	display: inline-block;
	padding: 12px 24px;
	font-size: 18px;
	text-decoration: none;
	background: var(--ama-primary);
	color: #fff !important;
	border-radius: 5px;
}

.ama-container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
}

/* ARCHIVE / CARD GRID STYLES */
.ama-lms-archive-wrapper {
	padding: 40px 0;
	background: #fff;
	min-height: 80vh;
}

.ama-archive-header {
	margin-bottom: 30px;
}

.ama-archive-header h1 {
	font-size: 28px;
	font-weight: 700;
	margin-bottom: 5px;
}

.ama-archive-meta {
	color: #666;
	font-size: 14px;
}

.ama-course-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 20px;
}

.ama-course-card {
	border: 1px solid #d1d7dc;
	/* Udemy border color */
	background: #fff;
	transition: box-shadow 0.2s;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.ama-course-card:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ama-card-link {
	text-decoration: none;
	color: inherit;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.ama-card-thumb {
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #f7f9fa;
}

.ama-card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ama-no-thumb {
	width: 100%;
	height: 100%;
	background: #e0e0e0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ama-card-body {
	padding: 10px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.ama-card-title {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
	margin: 0 0 5px;
	color: var(--ama-text);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ama-card-author {
	font-size: 12px;
	color: #6a6f73;
	margin-bottom: 5px;
}

.ama-card-excerpt {
	font-size: 13px;
	color: #333;
	/* Slightly darker for better read on summaries */
	margin-bottom: 10px;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	/* Limit excerpt to 3 lines */
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ama-card-rating {
	display: flex;
	align-items: center;
	gap: 3px;
	margin-bottom: 10px;
	margin-top: auto;
	/* Push to bottom if content is short */
}

.ama-rating-score {
	font-weight: 700;
	color: #b4690e;
	/* Udemy star color text */
	font-size: 14px;
	margin-right: 2px;
}

.ama-rating-count {
	color: #6a6f73;
	font-size: 12px;
	margin-left: 5px;
}

.ama-progress-bar-container {
	margin-top: 10px;
}

.ama-progress-info {
	font-size: 12px;
	margin-bottom: 3px;
	color: #6a6f73;
}

.ama-progress-track {
	background: #d1d7dc;
	height: 2px;
	width: 100%;
}

.ama-progress-fill {
	background: var(--ama-primary);
	height: 100%;
}

/* Mobile player: 640px */
@media (max-width: 640px) {
	.ama-mode-player .ama-player-layout {
		flex-direction: column;
	}
	.ama-player-sidebar {
		width: 100%;
		min-height: auto;
		border-left: none;
		border-top: 1px solid #ddd;
	}
	.ama-content-box {
		min-height: 40vh;
	}
	.ama-content-box .wp-block-embed,
	.ama-content-box .wp-block-embed__wrapper {
		min-height: 200px;
	}
	.ama-content-box > iframe,
	.ama-content-box video,
	.ama-content-box .wp-block-video {
		min-height: 200px;
	}
}