/**
 * Ecosystem Critical Fixes
 * High priority CSS to fix all ecosystem issues
 */

/* CRITICAL: Remove any problematic font declarations */
@font-face {
	font-family: 'SF Pro Display';
	src: local('SF Pro Display'), local('SFProDisplay-Regular'), local('system-ui'), local('-apple-system');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

/* CRITICAL: Force smooth scrolling */
html {
	scroll-behavior: smooth !important;
}

/* CRITICAL: Scroll target positioning */
#he-sinh-thai-cards,
#section-companies {
	scroll-margin-top: 120px !important;
	padding-top: 40px !important;
}

/* DEBUG: Make section-companies more visible */
#section-companies {
	background: #f8fafc !important;
	border: 2px solid #e2e8f0 !important;
	min-height: 200px !important;
}

/* CRITICAL: Force minimum font size 17px for ALL text */
body *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(.hero-title):not(.main-title):not(.sb-title):not(.brand-name):not(.ceo-name):not(.stat-num):not(.stat-number):not(.event-year) {
	font-size: max(17px, 1rem) !important;
}

/* CRITICAL: Restore heading hierarchy */
h1, h2, h3, h4, h5, h6,
.hero-title, .main-title, .sb-title, .brand-name, .ceo-name {
	font-size: revert !important;
}

/* CRITICAL: Company cards grid layout - FORCE 1 ROW */
.companies-grid {
	display: grid !important;
	gap: 20px !important;
	grid-template-columns: repeat(5, 1fr) !important;
	margin-top: 40px !important;
	align-items: stretch !important;
	max-width: 1400px !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

/* CRITICAL: Equal height company cards with flexbox - OPTIMIZED FOR 1 ROW */
.company-card {
	min-height: 400px !important;
	display: flex !important;
	flex-direction: column !important;
	justify-content: flex-start !important;
	align-items: center !important;
	padding: 25px 20px 70px 20px !important;
	border: 1px solid var(--border-subtle) !important;
	border-radius: 20px !important;
	text-align: center !important;
	background: var(--bg-card) !important;
	transition: all 0.3s ease !important;
	position: relative !important;
	overflow: hidden !important;
	max-width: 260px !important;
	margin: 0 auto !important;
}

/* CRITICAL: Fix card-link-hint alignment at bottom */
.company-card .card-link-hint {
	position: absolute !important;
	bottom: 20px !important;
	left: 50% !important;
	transform: translateX(-50%) translateY(10px) !important;
	display: block !important;
	padding: 10px 20px !important;
	border-top: 1px solid var(--border-subtle) !important;
	font-size: 17px !important;
	font-weight: 600 !important;
	color: var(--brand-blue) !important;
	text-align: center !important;
	opacity: 0 !important;
	transition: all 0.3s ease !important;
	flex-shrink: 0 !important;
	width: calc(100% - 60px) !important;
	background: rgba(255, 255, 255, 0.95) !important;
	backdrop-filter: blur(5px) !important;
	border-radius: 8px !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.company-card:hover .card-link-hint {
	opacity: 1 !important;
	transform: translateX(-50%) translateY(0) !important;
}

.company-card:hover {
	transform: translateY(-5px) !important;
	box-shadow: var(--shadow-hover) !important;
	border-color: var(--brand-cyan) !important;
}

/* CRITICAL: Company card logo positioning - SMALLER FOR 1 ROW */
.company-card .company-logo-wrapper {
	width: 80px !important;
	height: 80px !important;
	margin: 0 auto 20px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	background: var(--bg-body) !important;
	border-radius: 16px !important;
	padding: 12px !important;
	border: 1px solid var(--border-subtle) !important;
	transition: all 0.3s ease !important;
	flex-shrink: 0 !important;
}

.company-card:hover .company-logo-wrapper {
	background: #fff !important;
	border-color: var(--brand-cyan) !important;
	transform: scale(1.05) !important;
}

/* CRITICAL: Company card title positioning - SMALLER FOR 1 ROW */
.company-card .company-name {
	font-size: 1.2rem !important;
	font-weight: 800 !important;
	color: var(--text-primary) !important;
	margin-bottom: 6px !important;
	letter-spacing: -0.5px !important;
	text-align: center !important;
	flex-shrink: 0 !important;
	line-height: 1.2 !important;
}

/* CRITICAL: Company card slogan - SMALLER FOR 1 ROW */
.company-card .company-slogan {
	font-size: 14px !important;
	font-weight: 600 !important;
	color: var(--brand-blue) !important;
	text-transform: uppercase !important;
	letter-spacing: 0.5px !important;
	margin-bottom: 12px !important;
	flex-shrink: 0 !important;
	line-height: 1.3 !important;
}

/* CRITICAL: Company card description - grows to fill space - SMALLER FOR 1 ROW */
.company-card .company-desc {
	font-size: 14px !important;
	line-height: 1.5 !important;
	color: var(--text-secondary) !important;
	margin: 0 0 15px 0 !important;
	flex-grow: 1 !important;
	display: flex !important;
	align-items: center !important;
	text-align: center !important;
	justify-content: center !important;
	min-height: 40px !important;
}

/* CRITICAL: Company card tags - positioned above card-link-hint - SMALLER FOR 1 ROW */
.company-card .company-tags {
	display: flex !important;
	flex-wrap: wrap !important;
	gap: 6px !important;
	justify-content: center !important;
	margin-top: 0 !important;
	margin-bottom: 12px !important;
	flex-shrink: 0 !important;
}

.company-card .company-tag {
	display: inline-block !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	color: var(--text-secondary) !important;
	background: var(--bg-body) !important;
	padding: 4px 10px !important;
	border-radius: 50px !important;
	border: 1px solid var(--border-subtle) !important;
	transition: all 0.3s ease !important;
	line-height: 1.2 !important;
}

.company-card:hover .company-tag {
	background: #fff !important;
	border-color: var(--brand-cyan) !important;
	color: var(--brand-blue) !important;
}

/* CRITICAL: Ensure all card-link-hint elements are aligned at same height - SMALLER FOR 1 ROW */
.companies-grid .company-card .card-link-hint {
	position: absolute !important;
	bottom: 15px !important;
	left: 50% !important;
	transform: translateX(-50%) !important;
	width: calc(100% - 40px) !important;
	height: 32px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	color: #64748b !important;
	background: rgba(255, 255, 255, 0.95) !important;
	border: 1px solid #e2e8f0 !important;
	border-radius: 6px !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
	opacity: 0.8 !important;
	transition: all 0.3s ease !important;
	backdrop-filter: blur(5px) !important;
}

.companies-grid .company-card:hover .card-link-hint {
	opacity: 1 !important;
	color: #0038FF !important;
	border-color: #01f3f8 !important;
	transform: translateX(-50%) translateY(-2px) !important;
	box-shadow: 0 4px 12px rgba(0, 56, 255, 0.2) !important;
}

/* CRITICAL: Button font size */
.ecosystem-hero-banner .btn,
.ecosystem-hero-banner .btn-primary,
.ecosystem-hero-banner .btn-secondary {
	font-size: 17px !important;
	font-weight: 700 !important;
	font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* CRITICAL: Button hover effect */
.ecosystem-hero-banner .btn-primary:hover {
	transform: translateY(-3px) !important;
	box-shadow: 0 12px 35px rgba(0, 56, 255, 0.4) !important;
}

/* CRITICAL: Force all small text elements to 17px */
.sb-subtitle,
.stat-label,
.ceo-label,
.service-tag,
.live-icon,
.tag,
.growth-labels,
.feature-desc,
.stat-desc,
.ceo-team,
.service-list li,
.stat-info p,
.ceo-role,
.achievements-list li,
.divider-label,
.brand-slogan,
.brand-intro,
.badge h4,
.badge span,
.ceo-title,
.ceo-bio,
.achievement-item,
.company-slogan,
.company-desc,
.company-tag,
.instructor-title,
.tl-content,
.tl-text,
.desc-text,
.hero-desc,
.usp-list li,
.comp-list li,
.he-sinh-thai__card-desc,
.ecosystem-hero-banner .nav-item {
	font-size: 17px !important;
}

/* CRITICAL: Specific section overrides */
#section-care *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(.stat-num):not(.stat-number):not(.hero-title):not(.sb-title):not(.main-title),
#section-win *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(.stat-num):not(.stat-number):not(.hero-title):not(.sb-title):not(.main-title),
#section-seller *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(.stat-num):not(.stat-number):not(.hero-title):not(.sb-title):not(.main-title),
#section-agency *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(.stat-num):not(.stat-number):not(.hero-title):not(.sb-title):not(.main-title),
#section-academy *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(.stat-num):not(.stat-number):not(.hero-title):not(.sb-title):not(.main-title) {
	font-size: max(17px, 1rem) !important;
}

/* CRITICAL: Mobile responsive - OPTIMIZED FOR 1 ROW */
@media (max-width: 1200px) {
	.companies-grid {
		grid-template-columns: repeat(5, 1fr) !important;
		gap: 15px !important;
		max-width: 1200px !important;
	}
	
	.company-card {
		min-height: 380px !important;
		padding: 20px 15px 60px 15px !important;
		max-width: 220px !important;
	}
	
	.company-card .company-logo-wrapper {
		width: 70px !important;
		height: 70px !important;
	}
	
	.company-card .company-name {
		font-size: 1.1rem !important;
	}
}

@media (max-width: 992px) {
	.companies-grid {
		grid-template-columns: repeat(3, 1fr) !important;
		gap: 20px !important;
		max-width: 800px !important;
	}
	
	.company-card {
		min-height: 350px !important;
		max-width: 250px !important;
	}
}

@media (max-width: 768px) {
	.companies-grid {
		grid-template-columns: repeat(2, 1fr) !important;
		gap: 15px !important;
		max-width: 500px !important;
	}
	
	.company-card {
		min-height: 320px !important;
		padding: 20px 15px 50px 15px !important;
		max-width: 220px !important;
	}
}

@media (max-width: 480px) {
	.companies-grid {
		grid-template-columns: 1fr !important;
		gap: 20px !important;
		max-width: 300px !important;
	}
	
	.company-card {
		min-height: 300px !important;
		max-width: 280px !important;
	}
}