/**
 * FT Propfirm Comparison Widget Styles
 *
 * @package fundedtrading-core
 * @since 1.1.51
 */

/* ================================
   Widget Container
   ================================ */
.ft-propfirm-comparison-widget {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.ft-comparison-notice {
	padding: 40px 20px;
	border: 2px dashed #2d3e5f;
	border-radius: 8px;
	text-align: center;
	background: rgba(26, 41, 66, 0.3);
	margin: 20px 0;
}

.ft-comparison-notice p {
	margin: 0;
	color: #8a9eb0;
	line-height: 1.6;
}

/* ================================
   Header Section
   ================================ */
.ft-comparison-header {
	border-radius: 8px 8px 0 0;
	padding: 30px 20px;
	margin-bottom: 0;
}

.ft-comparison-header-grid {
	display: grid;
	grid-template-columns: 200px repeat(2, 1fr);
	gap: 30px;
	align-items: start;
}

.ft-header-label {
	text-align: left;
	padding-left: 20px;
	visibility: hidden;
}

.ft-header-firm {
	text-align: left;
	position: relative;
}

/* ================================
   Firm Selector
   ================================ */
.ft-firm-select-wrapper {
	position: relative;
	margin-bottom: 20px;
}

.ft-firm-selector {
	width: 100%;
	background-color: #1a2942;
	color: #ffffff;
	padding: 12px 40px 12px 16px;
	border: 1px solid #2d3e5f;
	border-radius: 6px;
	cursor: pointer;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	transition: all 0.3s ease;
}


.ft-firm-selector:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.ft-remove-firm {
	position: absolute;
	right: 35px;
	top: 50%;
	transform: translateY(-50%);
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 4px;
	line-height: 1;
	transition: all 0.2s ease;
	z-index: 10;
}

.ft-remove-firm:hover {
	transform: translateY(-50%) scale(1.1);
}

.ft-remove-firm i {
	display: block;
}

/* ================================
   Firm Logo
   ================================ */
.ft-firm-logo {
	width: 120px;
	height: 120px;
	border: 1px solid #FFFFFF33;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ft-firm-logo img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

/* ================================
   Firm Name
   ================================ */
.ft-firm-name {
	font-weight: 700;
	margin: 15px 0;
	line-height: 1.3;
}

/* ================================
   View Profile Button
   ================================ */
.ft-view-profile-btn {
	width: 100%;
	text-align: center;
	display: inline-block;
	padding: 12px 30px;
	text-decoration: none;
	border: 1px solid #00FFD2;
	border-radius: 8px;
	margin-top: 10px;
	border: none;
	cursor: pointer;
}

.ft-view-profile-btn:hover {
	text-decoration: none;
}

/* ================================
   Comparison Table
   ================================ */
.ft-comparison-table {
	border-radius: 8px;
	overflow: hidden;
}

.ft-comparison-row {
	display: grid;
	grid-template-columns: 200px repeat(2, 1fr);
	gap: 0;
	border-bottom: 1px solid #FFFFFF33;
	min-height: 60px;
}

.ft-comparison-row:last-child {
	border-bottom: none;
}

.ft-comparison-row > div {
	border-right: 1px solid #FFFFFF33;
}

/* ================================
   Row Label
   ================================ */
.ft-comparison-row-label {
	text-align: left;
	padding: 20px;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
}

/* ================================
   Row Value
   ================================ */
.ft-comparison-row-value {
	position: relative;
	text-align: center;
}

.ft-comparison-row-value.review{
	text-align: left;
	overflow-x: auto;
}

.ft-comparison-row-value.review.no-firm-selected {
    text-align: center;
}

.ft-comparison-row-value:last-of-type {
	border-right: none;
}

/* ================================
   Badge Styles (for taxonomy terms)
   ================================ */
.ft-comparison-row-value .ft-badge {
	display: inline-block;
	padding: 4px 12px;
	border: 1px solid #FFFFFF33;
	border-radius: 16px;
	margin: 2px;
}

/* ================================
   Icon Styles
   ================================ */
.ft-comparison-row-value .ft-icon {
	width: 24px;
	height: 24px;
	margin-right: 8px;
	display: inline-block;
	vertical-align: middle;
}

/* ================================
   Coupon Code Badge
   ================================ */
.ft-comparison-promo-badge {
	width: fit-content;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: rgba(0, 255, 210, 0.1);
	border: 1px solid #00FFD2;
	border-radius: 6px;
	padding: 8px 16px;
	cursor: pointer;
	position: relative;
}

.ft-comparison-promo-badge .ft-promo-icon {
	color: #00FFD2;
	flex-shrink: 0;
}

.ft-comparison-promo-badge .ft-promo-code {
	color: #00FFD2;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	user-select: none;
}

.ft-comparison-row-value.coupon_code {
    align-items: center;
}

/* Copied tooltip */
.ft-promo-code-tooltip {
	position: absolute;
	top: -35px;
	left: 50%;
	transform: translateX(-50%) translateY(5px);
	background: #00FFD2;
	color: #ffffff;
	padding: 6px 12px;
	border-radius: 4px;
	font-weight: 600;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: all 0.3s ease;
	z-index: 1000;
}

.ft-promo-code-tooltip::after {
	content: '';
	position: absolute;
	bottom: -4px;
	left: 50%;
	transform: translateX(-50%);
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 5px solid #00FFD2;
}

.ft-promo-code-tooltip.show {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* ================================
   Taxonomy Badge
   ================================ */
.ft-comparison-taxonomy-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: rgba(45, 62, 95, 0.5);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 6px;
	padding: 8px 16px;
	margin: 4px;
	transition: all 0.3s ease;
}

.ft-comparison-taxonomy-badge:hover {
	background: rgba(45, 62, 95, 0.8);
	border-color: rgba(255, 255, 255, 0.3);
	transform: translateY(-1px);
}

.ft-comparison-taxonomy-badge .ft-taxonomy-icon {
	width: 20px;
	height: 20px;
	object-fit: contain;
	flex-shrink: 0;
}

.ft-comparison-taxonomy-badge .ft-taxonomy-text {
	color: #ffffff;
	font-weight: 500;
	font-size: 14px;
	white-space: nowrap;
}

/* Wrapper for multiple taxonomy badges */
.ft-comparison-row-value {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	align-items: center;
	justify-content: center;
}

.ft-comparison-row-value.no-firm-selected {
	justify-content: center;
	align-items: center;
}

.ft-comparison-row-value.review.no-firm-selected{
	align-items: flex-start;
}

/* ================================
   Float Number Display
   ================================ */
.ft-comparison-row-value.float_number {

	font-weight: 700;
	color: #00FFD2;
	letter-spacing: 0.5px;
}

/* ================================
   Score Display
   ================================ */
.ft-score-display {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.ft-score-display .ft-score-value {
	color: #ffffff;
	letter-spacing: 0.5px;
}

.ft-score-display .ft-score-star {
	width: 16px;
    height: 16px;
	flex-shrink: 0;
	margin-bottom: 3px;
}

.ft-comparison-row-value.score {
	font-size: 32px;
}

/* ================================
   Responsive Styles
   ================================ */

/* Tablet */
@media (max-width: 1024px) {
	.ft-comparison-header-grid,
	.ft-comparison-row {
		grid-template-columns: 180px 1fr 1fr;
		gap: 20px;
	}

	.ft-header-label {
		padding-left: 15px;
	}

	.ft-firm-logo {
		width: 100px;
		height: 100px;
	}

	.ft-comparison-row-label {
		padding-left: 20px;
	}
}

/* Mobile */
@media (max-width: 768px) {
	.ft-comparison-header {
		padding: 20px 15px;
	}

	.ft-comparison-header-grid {
		grid-template-columns: 1fr;
		gap: 30px;
	}

	.ft-header-label {
		text-align: center;
		padding-left: 0;
		margin-bottom: 10px;
	}

	.ft-firm-logo {
		width: 80px;
		height: 80px;
	}

	.ft-view-profile-btn {
		padding: 10px 24px;
	}

	/* Scroll indicator hint - positioned before table */
	.ft-comparison-table::before {
		margin-bottom: 30px;
		content: '← Scroll to compare →';
		display: block;
		text-align: center;
		padding: 8px;
		opacity: 0.6;
		background: rgba(26, 41, 66, 0.5);
		border-radius: 4px 4px 0 0;
		animation: fadeInOut 3s ease-in-out infinite;
		position: sticky;
		left: 0;
		z-index: 3;
	}

	/* Scrollable table with frozen label column */
	.ft-comparison-table {
		position: relative;
		overflow-x: auto;
		overflow-y: visible;
		-webkit-overflow-scrolling: touch;
		scroll-behavior: smooth;
	}

	/* Wrapper for scrollable content */
	.ft-comparison-table::after {
		content: '';
		display: block;
		min-width: 100%;
	}

	.ft-comparison-row {
		display: flex;
		position: relative;
		border-top: 1px solid #FFFFFF33;
		border-bottom: unset;
		min-height: 60px;
		min-width: fit-content;
	}

	.ft-comparison-row-label {
		position: sticky;
		background-color: #002841;
		left: 0;
		z-index: 2;
		flex: 0 0 120px;
		min-width: 120px;
		max-width: 120px;
		padding: 15px 12px;
		text-align: left;
		justify-content: flex-start;
		font-weight: 600;
		box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
	}

	.ft-comparison-row-value {
		flex: 0 0 200px;
		min-width: 200px;
		max-width: 200px;
		padding: 15px 15px;
		border-right: 1px solid #FFFFFF33;
		position: relative;
	}

	.ft-comparison-row-value:last-of-type {
		border-right: none;
	}

	/* Custom scrollbar for the table */
	.ft-comparison-table::-webkit-scrollbar {
		height: 6px;
	}

	.ft-comparison-table::-webkit-scrollbar-track {
		background: #0d1520;
		border-radius: 3px;
	}

	.ft-comparison-table::-webkit-scrollbar-thumb {
		background: #2d3e5f;
		border-radius: 3px;
	}

	.ft-comparison-table::-webkit-scrollbar-thumb:hover {
		background: #3d4e6f;
	}

	/* Add firm labels on first row */
	.ft-comparison-table .ft-comparison-row:first-child .ft-comparison-row-value::before {
		content: attr(data-firm-label);
		position: absolute;
		top: -35px;
		left: 50%;
		transform: translateX(-50%);
		text-transform: uppercase;
		white-space: nowrap;
		opacity: 0.7;
	}

	@keyframes fadeInOut {
		0%, 100% { opacity: 0.6; }
		50% { opacity: 0.3; }
	}
}

/* Small Mobile */
@media (max-width: 480px) {
	.ft-comparison-header {
		padding: 15px 10px;
	}

	.ft-firm-selector {
		padding: 10px 35px 10px 12px;
	}

	.ft-remove-firm {
		right: 30px;
	}

	.ft-view-profile-btn {
		padding: 8px 20px;
	}

	/* Adjust frozen column for smaller screens */
	.ft-comparison-row-label {
		flex: 0 0 120px;
		min-width: 120px;
		max-width: 120px;
		padding: 12px 8px;
	}

	.ft-comparison-row-value {
		flex: 0 0 180px;
		min-width: 180px;
		max-width: 180px;
		padding: 12px 12px;
		align-content: flex-start;
	}

	.ft-comparison-row > div.ft-comparison-row-label.review {
		justify-content: flex-start;
	}

	.ft-comparison-row > div.ft-comparison-row-value.review {
		justify-content: flex-start;
		padding: 0px;
	} 
}

/* ================================
   Loading State
   ================================ */
.ft-propfirm-comparison-widget.loading {
	opacity: 0.6;
	pointer-events: none;
}

.ft-propfirm-comparison-widget.loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 40px;
	height: 40px;
	border: 4px solid #f3f3f3;
	border-top: 4px solid #4a90e2;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% { transform: translate(-50%, -50%) rotate(0deg); }
	100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ================================
   Print Styles
   ================================ */
@media print {
	.ft-firm-select-wrapper,
	.ft-remove-firm,
	.ft-view-profile-btn {
		display: none;
	}
}
