/* ════════════════════════════════════════════════════════
   equipamentos.css
   Listagem, cadastro, edição e exclusão de Equipamentos
   e Categorias. Suporte para associação de Pontos Turísticos.
   Depende de: editar-gestor.css (modal-overlay, modal-box,
   modal-form, modal-btn, modal-input…) e
   listagem-gestores.css (page-wrapper, topbar, eq-card…).
   As classes pto-* vêm de pontosturisticos.css.
════════════════════════════════════════════════════════ */

/* ── BOTÃO OUTLINE (Gerenciar Categorias) ─────────────── */
.eq-btn-outline {
	flex-shrink: 0;
	border: 1.5px solid var(--border);
	background: var(--card);
	color: var(--white-color);
	padding: 9px 18px;
	border-radius: 999px;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	transition:
		border-color 0.18s,
		background 0.18s,
		color 0.18s;
	display: flex;
	align-items: center;
	gap: 6px;
}

.eq-btn-outline:hover {
	border-color: var(--custom-btn-bg-color);
	color: var(--custom-btn-bg-color);
	background: rgba(255, 0, 77, 0.06);
}

/* ── DELETE no expand-footer ──────────────────────────── */
.eq-btn-sm.delete {
	background: rgba(239, 68, 68, 0.12);
	color: #ef4444;
	border: 1px solid rgba(239, 68, 68, 0.3);
}

.eq-btn-sm.delete:hover {
	background: rgba(239, 68, 68, 0.22);
}

/* ── SELETOR DE PONTOS TURÍSTICOS ────────────────────── */
.eq-pontos-section {
	margin-top: 24px;
	padding-top: 24px;
	border-top: 1px solid var(--border);
}

.eq-pontos-label {
	font-weight: 600;
	font-size: 0.875rem;
	color: var(--white-color);
	margin-bottom: 12px;
	display: block;
}

.eq-pontos-input-group {
	display: flex;
	gap: 8px;
	margin-bottom: 12px;
	flex-wrap: wrap;
}

.eq-pontos-select {
	flex: 1;
	min-width: 200px;
	padding: 8px 12px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--card);
	color: var(--white-color);
	font-family: inherit;
	font-size: 0.875rem;
	cursor: pointer;
}

.eq-pontos-select:focus {
	outline: none;
	border-color: var(--custom-btn-bg-color);
	box-shadow: 0 0 0 2px rgba(255, 0, 77, 0.1);
}

.eq-pontos-add-btn {
	padding: 8px 16px;
	background: var(--custom-btn-bg-color);
	color: white;
	border: none;
	border-radius: 8px;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.18s;
	white-space: nowrap;
}

.eq-pontos-add-btn:hover {
	background: #ff1052;
}

.eq-pontos-add-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ── CHIPS DE PONTOS SELECIONADOS ────────────────────── */
.eq-pontos-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 12px;
}

.eq-pontos-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: rgba(99, 102, 241, 0.15);
	border: 1px solid rgba(99, 102, 241, 0.3);
	color: #6366f1;
	padding: 6px 12px;
	border-radius: 20px;
	font-size: 0.813rem;
	font-weight: 500;
}

.eq-pontos-chip-remove {
	background: none;
	border: none;
	color: inherit;
	cursor: pointer;
	font-size: 1.2rem;
	line-height: 1;
	padding: 0;
	display: flex;
	align-items: center;
}

.eq-pontos-chip-remove:hover {
	color: #ff1052;
}

.eq-pontos-empty {
	color: var(--muted-foreground);
	font-size: 0.813rem;
	font-style: italic;
}

/* ── PONTOS EXPANDIDOS NO CARD ───────────────────────── */
.eq-expand-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 16px;
	margin-bottom: 16px;
}

.eq-field-full {
	grid-column: 1 / -1;
}

.eq-field-full label {
	display: block;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--muted-foreground);
	font-weight: 600;
	margin-bottom: 8px;
}

.eq-pontos-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.eq-pontos-tag {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: rgba(34, 197, 94, 0.1);
	border: 1px solid rgba(34, 197, 94, 0.3);
	color: #22c55e;
	padding: 4px 10px;
	border-radius: 12px;
	font-size: 0.75rem;
	font-weight: 500;
}

/* ── SEÇÃO DE ESTATÍSTICAS ───────────────────────────── */
.eq-stats-section {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 12px;
	margin-bottom: 20px;
}

.eq-stat-card {
	background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(99, 102, 241, 0.08) 100%);
	border: 1px solid rgba(99, 102, 241, 0.2);
	border-radius: 12px;
	padding: 14px;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}

.eq-stat-label {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--muted-foreground);
	font-weight: 600;
}

.eq-stat-value {
	font-size: 24px;
	font-weight: 600;
	color: var(--white-color);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.eq-stat-icon {
	font-size: 20px;
	line-height: 1;
}

/* ── AVALIAÇÃO EM ESTRELAS ───────────────────────────── */
.eq-avaliacao-section {
	background: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, rgba(59, 130, 246, 0.08) 100%);
	border: 1px solid rgba(251, 191, 36, 0.2);
	border-radius: 12px;
	padding: 16px;
	margin-bottom: 20px;
}

.eq-avaliacao-header {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}

.eq-avaliacao-title {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--white-color);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	white-space: nowrap;
}

.eq-stars-container {
	position: relative;
	width: 120px;
	height: 24px;
	flex-shrink: 0;
}

.eq-stars-bg,
.eq-stars-fg {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	display: flex;
	gap: 2px;
	align-items: center;
}

.eq-stars-bg {
	width: 100%;
	color: rgba(251, 191, 36, 0.3);
	z-index: 1;
}

.eq-stars-fg {
	width: 0;
	color: #fbbf24;
	z-index: 2;
	overflow: hidden;
	transition: width 0.3s ease;
}

.eq-star {
	font-size: 20px;
	line-height: 1;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.eq-avaliacao-info {
	font-size: 0.813rem;
	color: var(--muted-foreground);
	font-weight: 500;
	white-space: nowrap;
}

/* ── HORÁRIO DE FUNCIONAMENTO NO CARD ────────────────── */
.eq-horarios-container {
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 12px;
}

.eq-horarios-section {
	margin-top: 24px;
	padding-top: 24px;
	border-top: 1px solid var(--border);
}

.eq-horarios-label {
	font-weight: 600;
	font-size: 0.875rem;
	color: var(--white-color);
	margin-bottom: 12px;
	display: block;
}

/* ── CABEÇALHO DOS HORÁRIOS COM CONTROLES ─────────────── */
.eq-horarios-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 16px;
	margin-bottom: 16px;
	flex-wrap: wrap;
}

.eq-horarios-controls {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	align-items: center;
}

.eq-horarios-select {
	padding: 8px 12px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--card);
	color: var(--white-color);
	font-family: inherit;
	font-size: 0.875rem;
	cursor: pointer;
	min-width: 150px;
}

.eq-horarios-select:focus {
	outline: none;
	border-color: var(--custom-btn-bg-color);
	box-shadow: 0 0 0 2px rgba(255, 0, 77, 0.1);
}

.eq-horarios-aplicar-btn {
	padding: 8px 16px;
	background: var(--custom-btn-bg-color);
	color: white;
	border: none;
	border-radius: 8px;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.18s;
	white-space: nowrap;
}

.eq-horarios-aplicar-btn:hover {
	background: #ff1052;
}

.eq-horarios-aplicar-btn:active {
	transform: scale(0.95);
}

/* ── GRID DOS HORÁRIOS ────────────────────────────────── */
.eq-horarios-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
	gap: 10px;
}

.eq-horario-item {
	display: flex;
	flex-direction: column;
	gap: 4px;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: 8px;
}

.eq-horario-dia {
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	color: var(--muted-foreground);
}

.eq-horario-horas {
	font-size: 0.813rem;
	font-weight: 500;
	color: var(--white-color);
}

.eq-horario-horas .fechado {
	color: #ef4444;
	font-weight: 600;
}

.eq-horarios-empty,
.eq-horarios-text {
	color: var(--muted-foreground);
	font-size: 0.813rem;
	font-style: italic;
}

/* ── INPUTS DE HORÁRIO ────────────────────────────────── */
.eq-horario-inputs {
	display: flex;
	flex-direction: column;
	gap: 4px;
	align-items: stretch;
}

.eq-horario-inputs .modal-input {
	font-size: 0.75rem;
	padding: 6px 8px;
}

.eq-horario-separador {
	display: none;
}

/* ── TOAST DE CADASTRO E EXCLUSÃO ─────────────────────── */
#cadCatToast,
#cadEquipToast,
#excluirCatToast,
#excluirEquipToast,
#editarEquipToast {
	position: fixed;
	bottom: 28px;
	right: 28px;
	z-index: 2000;
	display: flex;
	align-items: center;
	gap: 12px;
	background: var(--card);
	border: 1px solid var(--border);
	border-left: 4px solid #22c55e;
	border-radius: 12px;
	padding: 14px 20px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
	min-width: 280px;
	max-width: 360px;
	opacity: 0;
	transform: translateY(16px);
	pointer-events: none;
	transition:
		opacity 0.25s ease,
		transform 0.25s ease;
}

#cadCatToast.show,
#cadEquipToast.show,
#excluirCatToast.show,
#excluirEquipToast.show,
#editarEquipToast.show {
	opacity: 1;
	transform: translateY(0);
	pointer-events: all;
}

#cadCatToast .toast-icon,
#cadEquipToast .toast-icon,
#excluirCatToast .toast-icon,
#excluirEquipToast .toast-icon,
#editarEquipToast .toast-icon {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: rgba(34, 197, 94, 0.15);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #22c55e;
}

#cadCatToast .toast-body,
#cadEquipToast .toast-body,
#excluirCatToast .toast-body,
#excluirEquipToast .toast-body,
#editarEquipToast .toast-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

#cadCatToast .toast-title,
#cadEquipToast .toast-title,
#excluirCatToast .toast-title,
#excluirEquipToast .toast-title,
#editarEquipToast .toast-title {
	font-size: 0.875rem;
	font-weight: 700;
	color: var(--white-color);
}

#cadCatToast .toast-msg,
#cadEquipToast .toast-msg,
#excluirCatToast .toast-msg,
#excluirEquipToast .toast-msg,
#editarEquipToast .toast-msg {
	font-size: 0.78rem;
	color: var(--muted-foreground);
}

/* ── MODO PÁGINA (cad-page-card) ──────────────────────── */
.cad-page-card {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 16px;
	padding: 32px;
	max-width: 1400px;
	margin: 0 auto;
	width: 100%;
}

/* ── EXPANSÃO HORIZONTAL DO MODAL E PÁGINA ──────────── */
#cadastrarEquipModalBox {
	max-width: 1200px !important;
	width: 90vw !important;
	max-height: 90vh !important;
	overflow-y: auto !important;
}

#editEquipModalBox {
	max-width: 1200px !important;
	width: 90vw !important;
	max-height: 90vh !important;
	overflow-y: auto !important;
}

/* Ajustar grid de campos para 3 colunas em telas grandes */
.modal-form .modal-row {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
}

.modal-form .modal-row .modal-field {
	grid-column: span 1;
}

/* Garantir que campos full-width ocupem todas as colunas */
.modal-form .modal-row .modal-field.full-width {
	grid-column: 1 / -1;
}

/* Grade de horários mais compacta */
.eq-horarios-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 10px;
}

.eq-horario-item {
	display: flex;
	flex-direction: column;
	gap: 4px;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: 8px;
}

.eq-horario-label {
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	color: var(--muted-foreground);
	text-align: center;
}

/* Seções full-width */
.eq-horarios-section,
.eq-pontos-section {
	width: 100%;
}

/* Responsivo: manter 2 colunas em telas médias */
@media (max-width: 1024px) {
	.modal-form .modal-row {
		grid-template-columns: repeat(2, 1fr);
	}

	#cadastrarEquipModalBox,
	#editEquipModalBox {
		max-width: 900px !important;
		width: 95vw !important;
	}

	.eq-horarios-grid {
		grid-template-columns: repeat(4, 1fr);
	}

	.eq-horarios-header {
		flex-direction: column;
		align-items: stretch;
	}

	.eq-horarios-controls {
		flex-direction: column;
		width: 100%;
	}

	.eq-horarios-select,
	.eq-horarios-aplicar-btn {
		width: 100%;
	}
}

/* ── RESPONSIVO ──────────────────────────────────────── */
@media (max-width: 768px) {
	#cadastrarEquipModalBox,
	#editEquipModalBox {
		max-width: 95vw !important;
		width: 95vw !important;
	}

	.modal-form .modal-row {
		grid-template-columns: repeat(2, 1fr);
	}

	.eq-horarios-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.cad-page-card {
		max-width: 95%;
		padding: 20px 16px;
	}

	.eq-horarios-header {
		flex-direction: column;
		align-items: stretch;
	}

	.eq-horarios-controls {
		flex-direction: column;
		width: 100%;
	}

	.eq-horarios-select,
	.eq-horarios-aplicar-btn {
		width: 100%;
	}
}

@media (max-width: 480px) {
	#cadCatToast,
	#cadEquipToast,
	#excluirCatToast,
	#excluirEquipToast,
	#editarEquipToast {
		bottom: 16px;
		right: 16px;
		left: 16px;
		max-width: unset;
	}

	.cad-page-card {
		padding: 16px 12px;
		max-width: 100%;
	}

	#cadastrarEquipModalBox,
	#editEquipModalBox {
		max-width: 100vw !important;
		width: 100vw !important;
		border-radius: 0;
	}

	.modal-form .modal-row {
		grid-template-columns: 1fr;
	}

	.eq-pontos-input-group {
		flex-direction: column;
	}

	.eq-pontos-select {
		min-width: 100%;
	}

	.eq-horarios-grid {
		grid-template-columns: 1fr;
	}

	.eq-horarios-header {
		flex-direction: column;
		align-items: stretch;
	}

	.eq-horarios-controls {
		flex-direction: column;
		width: 100%;
		gap: 8px;
	}

	.eq-horarios-select,
	.eq-horarios-aplicar-btn {
		width: 100%;
	}
}

/* ── DARK MODE ───────────────────────────────────────── */
body.dark-mode #cadCatToast,
body.dark-mode #cadEquipToast,
body.dark-mode #excluirCatToast,
body.dark-mode #excluirEquipToast,
body.dark-mode #editarEquipToast {
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ── CORREÇÃO DO CORTE NO PAINEL EXPANDIDO ──────────────── */
.eq-expand-panel.open {
    max-height: 2500px !important;
    padding-bottom: 16px;
}

/* Permite que a célula do grid encolha corretamente */
.eq-field {
    min-width: 0;
}

/* Corta o texto que ultrapassar o limite da coluna */
.eq-field span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}