/* Turmas Presenciais - Frontend Styles */

.turmas-presenciais-panel {
	max-width: 1200px;
	margin: 20px auto;
	padding: 20px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.turmas-presenciais-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	padding-bottom: 20px;
	border-bottom: 2px solid #e0e0e0;
}

.header-actions {
	display: flex;
	gap: 10px;
}

/* Tabs Navigation */
.turmas-presenciais-tabs {
	display: flex;
	gap: 0;
	margin-bottom: 30px;
	border-bottom: 2px solid #e0e0e0;
}

.tab-button {
	padding: 12px 24px;
	background: transparent;
	border: none;
	border-bottom: 3px solid transparent;
	cursor: pointer;
	font-size: 16px;
	font-weight: 600;
	color: #666;
	transition: all 0.3s ease;
	position: relative;
	z-index: 10;
}

.tab-button:hover {
	color: #2271b1;
	background: #f5f5f5;
}

.tab-button.active {
	color: #2271b1;
	border-bottom-color: #2271b1;
	background: #f9f9f9;
}

.tab-button:focus {
	outline: 2px solid #2271b1;
	outline-offset: -2px;
}

.tab-content {
	display: none !important;
}

#tab-content-turmas[style*="block"],
#tab-content-instrutores[style*="block"] {
	display: block !important;
}

.turmas-presenciais-header h2 {
	margin: 0;
	color: #333;
}

/* Formulário */
.turmas-presenciais-form {
	background: #f9f9f9;
	padding: 25px;
	border-radius: 8px;
	margin-bottom: 30px;
	border: 1px solid #e0e0e0;
}

.turmas-presenciais-form h3 {
	margin-top: 0;
	margin-bottom: 20px;
	color: #333;
}

.form-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 20px;
	margin-bottom: 20px;
}

.form-group {
	display: flex;
	flex-direction: column;
}

.form-group label {
	margin-bottom: 5px;
	font-weight: 600;
	color: #555;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="datetime-local"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
	padding: 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	width: 100%;
	font-family: inherit;
}

.form-group textarea {
	resize: vertical;
	min-height: 80px;
}

.form-group small {
	display: block;
	margin-top: 5px;
	color: #666;
	font-size: 12px;
}

.form-group input[type="checkbox"] {
	width: auto;
	margin-right: 8px;
}

.form-group select[multiple] {
	min-height: 120px;
	padding: 8px;
	width: 100%;
	display: block !important;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: #fff;
}

.form-group button.button {
	margin-left: 10px;
	margin-top: 0;
}

#preview-assinatura img {
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 5px;
	background: #f9f9f9;
}

.form-group input[type="text"]:focus,
.form-group input[type="date"]:focus,
.form-group input[type="datetime-local"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus,
.form-group textarea:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.1);
}

.turmas-presenciais-form hr {
	margin: 30px 0;
	border: none;
	border-top: 2px solid #e0e0e0;
}

.turmas-presenciais-form h4 {
	margin: 20px 0 15px 0;
	color: #333;
	font-size: 16px;
}

.form-actions {
	display: flex;
	gap: 10px;
	margin-top: 20px;
}

/* Tabela */
.turmas-presenciais-list {
	margin-top: 30px;
}

.turmas-table-wrapper {
	overflow-x: auto;
}

.turmas-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
}

.turmas-table thead {
	background: #f5f5f5;
}

.turmas-table th {
	padding: 12px;
	text-align: left;
	font-weight: 600;
	color: #333;
	border-bottom: 2px solid #ddd;
}

.turmas-table td {
	padding: 12px;
	border-bottom: 1px solid #eee;
}

.turmas-table tbody tr:hover {
	background: #f9f9f9;
}

.turmas-table .no-results {
	text-align: center;
	color: #999;
	padding: 40px;
}

/* Botões de ação */
.turma-actions {
	display: flex;
	gap: 5px;
}

.btn-action {
	padding: 5px 10px;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 12px;
	text-decoration: none;
	display: inline-block;
}

.btn-edit {
	background: #2271b1;
	color: #fff;
}

.btn-edit:hover {
	background: #135e96;
}

.btn-delete {
	background: #dc3232;
	color: #fff;
}

.btn-delete:hover {
	background: #b32d2e;
}

/* Mensagens */
#turmas-messages {
	margin-top: 20px;
}

.turmas-message {
	padding: 12px 15px;
	border-radius: 4px;
	margin-bottom: 10px;
}

.turmas-message.success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.turmas-message.error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

/* ============================================
   Merge Codes Help Section
   ============================================ */
.merge-codes-help {
	background: #fff;
	padding: 30px;
	border-radius: 8px;
}

.merge-codes-help h3 {
	margin-top: 0;
	color: #2271b1;
	font-size: 24px;
	border-bottom: 2px solid #2271b1;
	padding-bottom: 10px;
}

.merge-codes-help h4 {
	color: #333;
	font-size: 18px;
	margin-top: 30px;
	margin-bottom: 15px;
}

.merge-codes-section {
	margin-bottom: 30px;
}

.merge-codes-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 20px;
	background: #fff;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.merge-codes-table th,
.merge-codes-table td {
	border: 1px solid #e0e0e0;
	padding: 12px 15px;
	text-align: left;
}

.merge-codes-table th {
	background-color: #f5f5f5;
	font-weight: 600;
	color: #333;
}

.merge-codes-table tbody tr:nth-child(even) {
	background-color: #f9f9f9;
}

.merge-codes-table tbody tr:hover {
	background-color: #f0f0f0;
}

.merge-code {
	background: #f5f5f5;
	padding: 4px 8px;
	border-radius: 4px;
	font-family: 'Courier New', monospace;
	color: #d63638;
	font-weight: 600;
	cursor: pointer;
	display: inline-block;
	transition: all 0.2s ease;
}

.merge-code:hover {
	background: #2271b1;
	color: #fff;
}

.merge-codes-usage {
	background: #f9f9f9;
	padding: 20px;
	border-radius: 8px;
	margin-top: 30px;
	border-left: 4px solid #2271b1;
}

.merge-codes-usage ol {
	margin-left: 20px;
}

.merge-codes-usage ol li {
	margin-bottom: 10px;
	line-height: 1.6;
}

.merge-codes-example {
	background: #fff;
	padding: 20px;
	border-radius: 4px;
	margin-top: 15px;
	border: 1px solid #e0e0e0;
}

.merge-codes-example pre {
	background: #f5f5f5;
	padding: 15px;
	border-radius: 4px;
	overflow-x: auto;
	line-height: 1.6;
	font-size: 13px;
	border: 1px solid #ddd;
}

.merge-codes-example p {
	margin-top: 15px;
	margin-bottom: 8px;
	font-weight: 600;
	color: #555;
}

.merge-codes-example p:first-child {
	margin-top: 0;
}

/* Loading */
.loading {
	text-align: center;
	padding: 40px;
	color: #666;
}

/* Spinner */
.spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid #f3f3f3;
	border-top: 2px solid #2271b1;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin-right: 8px;
	vertical-align: middle;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.is-loading {
	opacity: 0.7;
	pointer-events: none;
	position: relative;
}

.is-loading::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255, 255, 255, 0.8);
	z-index: 10;
}

/* Responsivo */
@media (max-width: 768px) {
	.turmas-presenciais-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 15px;
	}

	.form-row {
		grid-template-columns: 1fr;
	}

	.turmas-table {
		font-size: 14px;
	}

	.turmas-table th,
	.turmas-table td {
		padding: 8px;
	}
}
