/**
 * LWCE — Estilos
 *
 * Estilos para:
 *   1. Botão WooCommerce na página do curso (F1)
 *   2. Área "Meus Cursos" na Minha Conta (F2)
 *
 * Paleta neutra — herda as variáveis CSS do tema LearnDash ld30 quando
 * disponíveis e cai para defaults quando não existem.
 */

/* ==========================================================================
   F1 — Botão de compra na página do curso
   ========================================================================== */

.lwce-buy-wrap {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
}

/* Preço WooCommerce */
.lwce-price {
	font-size: 1.5em;
	font-weight: 700;
	line-height: 1.2;
	color: var( --ld-color-primary, #30bce4 );
}

.lwce-price del {
	color: #999;
	font-size: 0.75em;
	font-weight: 400;
	margin-right: 6px;
}

.lwce-price ins {
	text-decoration: none;
	color: var( --ld-color-primary, #30bce4 );
}

/* Botão principal */
.lwce-buy-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	transition: opacity 0.2s ease, transform 0.15s ease;
}

.lwce-buy-btn:hover {
	opacity: 0.88;
	transform: translateY( -1px );
}

.lwce-buy-btn:active {
	transform: translateY( 0 );
}

/* Estado de carregamento */
.lwce-buy-btn .lwce-btn-loading {
	display: none;
}

.lwce-buy-btn--loading .lwce-btn-label {
	display: none;
}

.lwce-buy-btn--loading .lwce-btn-loading {
	display: inline;
}

.lwce-buy-btn--loading {
	opacity: 0.7;
	cursor: wait;
}

/* Estado concluído */
.lwce-buy-btn--done {
	background-color: #4caf50 !important;
	border-color: #4caf50 !important;
	cursor: default;
}

/* Botão indisponível */
.lwce-buy-btn--disabled {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
}

/* Mensagem e acções pós-add-to-cart */
.lwce-msg {
	width: 100%;
}

.lwce-cart-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.lwce-cart-link {
	font-size: 0.9em;
	text-decoration: underline;
	color: var( --ld-color-primary, #30bce4 );
}

.lwce-checkout-link {
	font-size: 0.9em;
}

.lwce-error {
	display: inline-block;
	color: #c62828;
	font-size: 0.88em;
	background: #ffebee;
	border-left: 3px solid #c62828;
	padding: 6px 10px;
	border-radius: 3px;
}

/* ==========================================================================
   F2 — Meus Cursos na Minha Conta WooCommerce
   ========================================================================== */

.lwce-courses-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 280px, 1fr ) );
	gap: 24px;
	margin-top: 24px;
}

/* Card individual de curso */
.lwce-course-card {
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.2s ease;
}

.lwce-course-card:hover {
	box-shadow: 0 4px 16px rgba( 0, 0, 0, 0.1 );
}

/* Thumbnail */
.lwce-course-thumb {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	background: #f5f5f5;
}

.lwce-course-thumb--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: linear-gradient( 135deg, #e3f2fd 0%, #bbdefb 100% );
	font-size: 2.5em;
	color: #90caf9;
}

/* Corpo do card */
.lwce-course-body {
	padding: 16px;
	display: flex;
	flex-direction: column;
	flex: 1;
	gap: 10px;
}

/* Badge de estado */
.lwce-course-status {
	display: inline-block;
	font-size: 0.72em;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	padding: 2px 8px;
	border-radius: 20px;
	align-self: flex-start;
}

.lwce-course-status--not-started {
	background: #f0f0f0;
	color: #666;
}

.lwce-course-status--in-progress {
	background: #e3f2fd;
	color: #1565c0;
}

.lwce-course-status--completed {
	background: #e8f5e9;
	color: #2e7d32;
}

/* Título */
.lwce-course-title {
	font-size: 1em;
	font-weight: 600;
	margin: 0;
	line-height: 1.35;
}

.lwce-course-title a {
	color: inherit;
	text-decoration: none;
}

.lwce-course-title a:hover {
	color: var( --ld-color-primary, #30bce4 );
}

/* Barra de progresso */
.lwce-progress-wrap {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.lwce-progress-label {
	display: flex;
	justify-content: space-between;
	font-size: 0.78em;
	color: #666;
}

.lwce-progress-bar-bg {
	width: 100%;
	height: 6px;
	background: #e0e0e0;
	border-radius: 3px;
	overflow: hidden;
}

.lwce-progress-bar-fill {
	height: 100%;
	border-radius: 3px;
	background: var( --ld-color-primary, #30bce4 );
	transition: width 0.5s ease;
}

.lwce-progress-bar-fill--completed {
	background: #4caf50;
}

/* Botão de acção */
.lwce-course-action {
	margin-top: auto;
}

.lwce-course-btn {
	display: inline-block;
	width: 100%;
	text-align: center;
	padding: 9px 16px;
	border-radius: 4px;
	font-size: 0.9em;
	font-weight: 600;
	text-decoration: none;
	background: var( --ld-color-primary, #30bce4 );
	color: #fff;
	transition: background 0.2s ease;
}

.lwce-course-btn:hover,
.lwce-course-btn:focus {
	background: var( --ld-color-primary-dark, #1a9dc2 );
	color: #fff;
}

.lwce-course-btn--completed {
	background: #4caf50;
}

.lwce-course-btn--completed:hover {
	background: #388e3c;
}

/* Estado vazio */
.lwce-no-courses {
	text-align: center;
	padding: 48px 24px;
	color: #666;
}

.lwce-no-courses p {
	margin-bottom: 16px;
}

/* Responsivo: ecrãs pequenos */
@media ( max-width: 600px ) {
	.lwce-courses-grid {
		grid-template-columns: 1fr;
	}
}

/* ==========================================================================
   F3 — Tabs Currículo e Instrutor na página do produto WooCommerce
   ========================================================================== */

/* --- Resumo do currículo --- */
.lwce-curriculo-summary {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid #e0e0e0;
}

.lwce-curriculo-stat {
	font-size: 0.875em;
	color: #555;
	background: #f5f5f5;
	padding: 4px 12px;
	border-radius: 20px;
}

/* --- Lista de secções --- */
.lwce-curriculo-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.lwce-curriculo-section {
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	overflow: hidden;
}

/* Cabeçalho da secção (botão) */
.lwce-section-header {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 13px 16px;
	background: #fafafa;
	border: none;
	cursor: default;
	text-align: left;
	font-size: 0.95em;
	font-weight: 600;
	color: #333;
	transition: background 0.15s ease;
}

.lwce-section-header--expandable {
	cursor: pointer;
}

.lwce-section-header--expandable:hover {
	background: #f0f0f0;
}

.lwce-section-icon {
	flex-shrink: 0;
	font-size: 0.7em;
	color: #888;
	min-width: 12px;
}

.lwce-section-title {
	flex: 1;
}

.lwce-section-meta {
	font-size: 0.8em;
	color: #888;
	font-weight: 400;
	white-space: nowrap;
}

/* Badges */
.lwce-badge {
	display: inline-block;
	font-size: 0.7em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 2px 8px;
	border-radius: 20px;
}

.lwce-badge--free {
	background: #e8f5e9;
	color: #2e7d32;
}

.lwce-badge--quiz {
	background: #e3f2fd;
	color: #1565c0;
}

/* Itens da secção */
.lwce-section-items {
	border-top: 1px solid #e0e0e0;
}

.lwce-section-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 20px;
	font-size: 0.88em;
	color: #444;
	border-bottom: 1px solid #f0f0f0;
}

.lwce-section-item:last-child {
	border-bottom: none;
}

.lwce-section-item--quiz {
	background: #fafbff;
}

.lwce-item-icon {
	flex-shrink: 0;
	color: #aaa;
	font-size: 0.9em;
}

.lwce-item-title {
	flex: 1;
}

/* --- Tab Instrutor --- */
.lwce-instrutor-card {
	display: flex;
	align-items: flex-start;
	gap: 20px;
}

.lwce-instrutor-avatar img {
	border-radius: 50%;
	display: block;
}

.lwce-instrutor-info {
	flex: 1;
}

.lwce-instrutor-name {
	font-size: 1.1em;
	font-weight: 700;
	margin: 0 0 10px;
}

.lwce-instrutor-name a {
	color: inherit;
	text-decoration: none;
}

.lwce-instrutor-name a:hover {
	color: var( --ld-color-primary, #30bce4 );
}

.lwce-instrutor-bio {
	font-size: 0.9em;
	color: #555;
	line-height: 1.6;
}

.lwce-instrutor-no-bio {
	font-size: 0.9em;
	color: #999;
	font-style: italic;
}

/* Responsivo */
@media ( max-width: 600px ) {
	.lwce-instrutor-card {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}
}
