/*
 * Preflop GTO Charts Styles
 * Full-width layout, poker-guide header style
 */

/* ===== Page ===== */
.gto-charts-page {
	width: 100%;
	background: linear-gradient(160deg, #F3EEEC 0%, #EDE8E6 25%, #E8EAF0 50%, #EBE6E4 75%, #F0ECEA 100%);
}

.gto-charts-page *,
.gto-charts-page *::before,
.gto-charts-page *::after {
	box-sizing: border-box;
}

/* Breadcrumb width to match layout */
.gto-charts-page .tool-crumbs-inner { max-width: 1100px; margin: 0 auto; }

/* ===== Hero ===== */
.gto-hero {
	padding: 28px 0 12px;
	text-align: center;
}

.gto-hero-content {
	max-width: 700px;
	margin: 0 auto;
}

.gto-hero-title {
	font-size: 1.9rem;
	font-weight: 750;
	color: var(--text-dark);
	margin: 0 0 8px;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

.gto-hero-subtitle {
	font-size: 1rem;
	color: var(--text-gray);
	margin: 0;
	line-height: 1.5;
}

.gto-charts-page .tool-format-tabs-inner {
	margin: 0 auto;
}

.gto-hero-badges {
	display: flex;
	justify-content: center;
	gap: 8px;
	flex-wrap: wrap;
}

.gto-badge {
	display: inline-flex;
	align-items: center;
	padding: 4px 12px;
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--primary-color);
	background: var(--primary-bg);
	border: 1px solid var(--border-color);
	border-radius: 20px;
	letter-spacing: 0.01em;
}

/* ===== Tool Card ===== */
.gto-tool-wrap {
	padding: 12px 0 72px;
}

.gto-tool-card {
	max-width: 900px;
	margin: 0 auto;
	background: #fff;
	border-radius: 16px;
	border: 1px solid #e2e8f0;
	box-shadow: var(--shadow-md);
	padding: 24px;
}

/* ===== Position Bar ===== */
.gto-top-filters {
	display: flex;
	align-items: flex-start;
	justify-content: flex-start;
	column-gap: 30px;
	row-gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 8px;
}

.gto-top-filters .gto-position-bar,
.gto-top-filters .gto-scenario-bar {
	flex: 0 1 auto;
	margin-bottom: 0;
}

.gto-top-filters .gto-scenario-bar .gto-bar-label {
	min-width: auto;
}

.gto-position-bar,
.gto-scenario-bar,
.gto-villain-bar {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 8px;
	flex-wrap: wrap;
}

.gto-bar-label {
	font-size: 0.7rem;
	font-weight: 650;
	color: var(--text-gray);
	text-transform: uppercase;
	letter-spacing: 0.03em;
	white-space: nowrap;
	min-width: 96px;
}

.gto-position-btns,
.gto-scenario-btns,
.gto-villain-btns {
	display: flex;
	gap: 5px;
	flex-wrap: wrap;
}

/* ===== Scenario / Villain Buttons ===== */
.gto-pos-btn,
.gto-scn-btn,
.gto-villain-btn {
	padding: 5px 10px;
	font-size: 0.8rem;
	font-weight: 600;
	font-family: inherit;
	border: 1.5px solid #e2e8f0;
	border-radius: 7px;
	background: #f8fafc;
	color: var(--text-gray);
	cursor: pointer;
	transition: all 0.15s ease;
	line-height: 1.3;
}

.gto-pos-btn:hover,
.gto-scn-btn:hover,
.gto-villain-btn:hover {
	border-color: var(--primary-color);
	color: var(--primary-color);
	background: var(--primary-bg);
}

.gto-pos-btn.active,
.gto-scn-btn.active,
.gto-villain-btn.active {
	background: var(--primary-color);
	color: #fff;
	border-color: var(--primary-color);
	box-shadow: var(--shadow-primary);
}

.gto-villain-btn:disabled {
	opacity: 0.55;
	cursor: default;
	pointer-events: none;
}

/* ===== Grid Row (grid + sidebar) ===== */
.gto-grid-row {
	display: flex;
	gap: 24px;
	align-items: flex-start;
	margin-top: 12px;
}

.gto-grid-wrap {
	flex: 0 1 clamp(500px, 60vw, 600px);
	max-width: 600px;
	min-width: 0;
	border-radius: 7px;
	overflow: hidden;
	-webkit-overflow-scrolling: touch;
}

/* ===== 13×13 Grid ===== */
.gto-grid {
	border-collapse: collapse;
	width: 100%;
	table-layout: fixed;
	min-width: 0;
	overflow: visible;
}

.gto-grid td {
	position: relative;
	text-align: center;
	font-size: 0.82rem;
	font-weight: 400;
	padding: 0;
	border: 1px solid rgba(0,0,0,0.08);
	cursor: default;
	transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
	user-select: none;
	line-height: 1.1;
	letter-spacing: -0.01em;
	aspect-ratio: 1;
	vertical-align: middle;
	z-index: 0;
	border-radius: 4px;
}

.gto-grid td::before {
	content: '';
	display: block;
	padding-top: 100%;
}

.gto-grid td .gto-cell-label {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.gto-grid td:hover {
	transform: none;
	z-index: 0;
	box-shadow: none;
	border-color: rgba(0,0,0,0.08);
	outline: none;
}

/* Action colors */
.gto-grid td.gto-raise {
	background: #ef4444;
	color: #fff;
}

.gto-grid td.gto-raise2 {
	background: #f59e0b;
	color: #fff;
}

.gto-grid td.gto-call {
	background: #22c55e;
	color: #fff;
}

.gto-grid td.gto-fold {
	background: #e7ebf0;
	color: #a0a9b5;
}

.gto-grid td.gto-mixed {
	color: #fff;
}

.gto-grid td.gto-mixed-rf {
	color: #fff;
}

.gto-grid td.gto-mixed-rc {
	color: #fff;
}

/* ===== Sidebar ===== */
.gto-sidebar {
	width: 220px;
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.gto-meta-card {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 12px 12px 10px;
}

.gto-meta-divider {
	height: 1px;
	background: #e2e8f0;
	margin: 10px 0 8px;
}

.gto-sidebar-title {
	font-size: 0.78rem;
	font-weight: 700;
	color: var(--text-dark);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin: 0 0 10px;
}

/* Legend */
.gto-legend-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 6px;
	font-size: 0.82rem;
	color: var(--text-gray);
}

.gto-legend-item-main {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.gto-legend-swatch {
	width: 18px;
	height: 18px;
	border-radius: 4px;
	flex-shrink: 0;
	border: 1px solid rgba(0,0,0,0.06);
}

.gto-color-raise {
	background: #ef4444;
}

.gto-color-raise2 {
	background: #f59e0b;
}

.gto-color-call {
	background: #22c55e;
}

.gto-color-fold {
	background: #e7ebf0;
}

.gto-color-mixed {
	background: linear-gradient(90deg, #ef4444 50%, #e2e8f0 50%);
}

.gto-stat-value {
	font-size: 0.82rem;
	color: var(--text-dark);
	white-space: nowrap;
}

/* Sidebar CTA */
.gto-sidebar-cta {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 14px 14px 14px 16px;
	background: linear-gradient(135deg, #eefaf8 0%, #e6f7f4 100%);
	border: 1px solid #9fded7;
	border-left: 2px solid #21a296;
	border-radius: 10px;
	text-decoration: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
	position: relative;
	overflow: hidden;
	box-shadow: 0 6px 16px rgba(22, 140, 132, 0.12);
}

.gto-sidebar-cta:hover {
	background: linear-gradient(135deg, #e5f8f5 0%, #dcf3ef 100%);
	border-color: #46b8ae;
	box-shadow: 0 10px 22px rgba(18, 128, 121, 0.2);
	transform: translateY(-1px);
}

.gto-sidebar-cta svg {
	position: absolute;
	top: 14px;
	right: 12px;
	color: #13857b;
}

.gto-sidebar-cta-title {
	font-size: 0.85rem;
	font-weight: 700;
	color: #0f766e;
}

.gto-sidebar-cta-desc {
	font-size: 0.75rem;
	color: var(--text-gray);
	line-height: 1.4;
	padding-right: 20px;
}

/* ===== Tooltip ===== */
.gto-tooltip {
	position: fixed;
	z-index: 100;
	background: var(--text-dark);
	color: #fff;
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 0.8rem;
	line-height: 1.5;
	box-shadow: var(--shadow-lg);
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.12s ease;
	max-width: 220px;
	white-space: normal;
}

.gto-tooltip.visible {
	opacity: 1;
}

.gto-tooltip-hand {
	font-weight: 700;
	font-size: 0.9rem;
	margin-bottom: 4px;
}

.gto-tooltip-type {
	font-size: 0.72rem;
	opacity: 0.7;
	margin-bottom: 6px;
}

.gto-tooltip-actions {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.gto-tooltip-action {
	display: flex;
	justify-content: space-between;
	gap: 12px;
}

.gto-tooltip-action-name {
	opacity: 0.85;
}

.gto-tooltip-action-pct {
	font-weight: 650;
	font-variant-numeric: tabular-nums;
}

.gto-tooltip-combos {
	margin-top: 4px;
	font-size: 0.72rem;
	opacity: 0.6;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
	.gto-grid-row {
		gap: 16px;
	}

	.gto-grid-wrap {
		flex: 1 1 0;
		width: auto;
		max-width: none;
		overflow: hidden;
	}

	.gto-grid {
		width: 100%;
		min-width: 0;
	}

	.gto-sidebar {
		width: 190px;
		flex: 0 0 190px;
		flex-direction: column;
		gap: 16px;
	}

	.gto-meta-card {
		flex: 0 0 auto;
		min-width: 0;
	}

	.gto-sidebar-cta {
		flex: 0 0 auto;
	}

	.gto-tool-card {
		padding: 16px;
	}
}

@media (max-width: 640px) {
	.gto-grid-row {
		flex-direction: column;
	}

	.gto-sidebar {
		width: 100%;
		flex: 1 1 auto;
	}

	.gto-top-filters {
		display: block;
		margin-bottom: 0;
	}

	.gto-top-filters .gto-position-bar,
	.gto-top-filters .gto-scenario-bar {
		margin-bottom: 6px;
	}

	.gto-top-filters .gto-scenario-bar {
		gap: 4px;
		margin-top: 4px;
	}

	.gto-hero-title {
		font-size: 1.45rem;
	}

	.gto-hero-subtitle {
		font-size: 0.9rem;
	}

	.gto-position-bar,
	.gto-scenario-bar,
	.gto-villain-bar {
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
		margin-bottom: 6px;
	}

	.gto-bar-label {
		min-width: unset;
		font-size: 0.66rem;
	}

	.gto-position-btns {
		width: 100%;
	}

	.gto-pos-btn {
		flex: 1;
		padding: 6px 6px;
		font-size: 0.76rem;
		text-align: center;
		border-radius: 6px;
	}

	.gto-scenario-btns,
	.gto-villain-btns {
		width: 100%;
	}

	.gto-scn-btn,
	.gto-villain-btn {
		padding: 6px 8px;
		font-size: 0.74rem;
		border-radius: 6px;
	}

	.gto-grid {
		min-width: 0;
	}

	.gto-grid-wrap {
		flex: 1 1 100%;
		width: 100%;
		max-width: 100%;
		overflow: hidden;
	}

	.gto-grid td {
		font-size: 0.64rem;
	}

	.gto-tool-card {
		padding: 12px;
		border-radius: 12px;
	}
}

/* ===== Dark theme ownership ===== */
:root[data-theme="dark"] .gto-charts-page {
	background: linear-gradient(160deg, #0d1618 0%, #112022 35%, #102022 70%, #0c1617 100%);
}

:root[data-theme="dark"] .gto-charts-page .gto-badge {
	background: var(--bg-light);
	border-color: var(--border-strong);
	color: var(--text-accent);
}

:root[data-theme="dark"] .gto-charts-page .gto-tool-card {
	background: var(--bg-light);
	border-color: var(--border-color);
	box-shadow: var(--shadow-sm);
}

:root[data-theme="dark"] .gto-charts-page .tool-format-tabs-inner {
	background: #1b272b;
	border: 1px solid var(--border-color);
}

:root[data-theme="dark"] .gto-charts-page .tool-format-tab {
	color: var(--text-gray);
}

:root[data-theme="dark"] .gto-charts-page .tool-format-tab:hover:not(:disabled) {
	background: #223138;
	color: var(--text-dark);
}

:root[data-theme="dark"] .gto-charts-page .tool-format-tab.is-active {
	background: var(--bg-lighter);
	color: var(--text-accent);
	box-shadow: none;
}

:root[data-theme="dark"] .gto-charts-page .tool-format-tab.is-soon,
:root[data-theme="dark"] .gto-charts-page .tool-format-tab.is-soon:hover {
	color: #7f8ea1;
}

:root[data-theme="dark"] .gto-charts-page .tool-tab-badge {
	color: #9fb2c7;
	background: rgba(148, 163, 184, 0.2);
}

:root[data-theme="dark"] .gto-charts-page .gto-meta-card {
	background: var(--bg-lighter);
	border-color: var(--border-color);
}

:root[data-theme="dark"] .gto-charts-page .gto-meta-divider {
	background: var(--border-color);
}

:root[data-theme="dark"] .gto-charts-page .gto-bar-label,
:root[data-theme="dark"] .gto-charts-page .gto-legend-item,
:root[data-theme="dark"] .gto-charts-page .gto-sidebar-cta-desc {
	color: var(--text-gray);
}

:root[data-theme="dark"] .gto-charts-page .gto-sidebar-title,
:root[data-theme="dark"] .gto-charts-page .gto-stat-value {
	color: var(--text-dark);
}

:root[data-theme="dark"] .gto-charts-page .gto-pos-btn,
:root[data-theme="dark"] .gto-charts-page .gto-scn-btn,
:root[data-theme="dark"] .gto-charts-page .gto-villain-btn {
	background-color: var(--bg-lighter) !important;
	border-color: var(--border-color) !important;
	color: var(--text-gray) !important;
}

:root[data-theme="dark"] .gto-charts-page .gto-pos-btn:hover,
:root[data-theme="dark"] .gto-charts-page .gto-scn-btn:hover,
:root[data-theme="dark"] .gto-charts-page .gto-villain-btn:hover {
	border-color: #3f5760 !important;
	background: #223138 !important;
	color: #d7e3ea !important;
}

:root[data-theme="dark"] .gto-charts-page .gto-pos-btn.active,
:root[data-theme="dark"] .gto-charts-page .gto-scn-btn.active,
:root[data-theme="dark"] .gto-charts-page .gto-villain-btn.active {
	background: #17636a !important;
	border-color: #2a7c84 !important;
	color: #eaf7f7 !important;
	box-shadow: 0 2px 6px rgba(8, 77, 84, 0.22) !important;
}

:root[data-theme="dark"] .gto-charts-page .gto-villain-btn:disabled {
	background-color: #1a252a !important;
	border-color: var(--border-color) !important;
	color: #6b7f8c !important;
}

:root[data-theme="dark"] .gto-charts-page .gto-grid td {
	border-color: rgba(148, 163, 184, 0.3);
}

:root[data-theme="dark"] .gto-charts-page .gto-grid td:hover {
	box-shadow: none;
	border-color: rgba(148, 163, 184, 0.3);
	outline: none;
}

:root[data-theme="dark"] .gto-charts-page .gto-grid td.gto-fold {
	background: #27323b;
	color: #9aa8ba;
}

:root[data-theme="dark"] .gto-charts-page .gto-color-fold {
	background: #27323b;
}

:root[data-theme="dark"] .gto-charts-page .gto-color-mixed {
	background: linear-gradient(90deg, #ef4444 50%, #27323b 50%);
}

:root[data-theme="dark"] .gto-charts-page .gto-legend-swatch {
	border-color: rgba(148, 163, 184, 0.3);
}

:root[data-theme="dark"] .gto-charts-page .gto-sidebar-cta {
	background: linear-gradient(135deg, #163137 0%, #11272c 100%);
	border-color: #245159;
	border-left: 2px solid #2ea99d;
	box-shadow: 0 8px 20px rgba(9, 63, 71, 0.3);
}

:root[data-theme="dark"] .gto-charts-page .gto-sidebar-cta:hover {
	background: linear-gradient(135deg, #1a3b42 0%, #163238 100%);
	border-color: #32707a;
	box-shadow: 0 12px 26px rgba(11, 79, 89, 0.38);
}

:root[data-theme="dark"] .gto-charts-page .gto-sidebar-cta-title {
	color: #8ee9dd;
}

:root[data-theme="dark"] .gto-charts-page .gto-sidebar-cta svg {
	color: #6fd7cb;
}

:root[data-theme="dark"] .gto-charts-page .gto-tooltip {
	background: #0f172a;
	color: #e2e8f0;
	border: 1px solid rgba(148, 163, 184, 0.25);
}
