/*=====================================================================
Custom Styles - Universal Custom Design Components
=====================================================================
This file contains custom styling for various components:
- Dropdown & Select Elements (CSS-Only Toggle Design)
- Custom form elements
- Additional design overrides
=====================================================================*/

/* Global Select/Dropdown Reset */
select,
select.form-control,
select.form-select,
.custom-select,
.dropdown-select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23222626' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 12px;
	padding-right: 35px;
	cursor: pointer;
	border: 1.5px solid #e0e0e0;
	border-radius: 8px;
	transition: all 0.3s ease;
	font-size: 14px;
	color: #222626;
	background-color: #fff;
}

/* Modern Dropdown Toggle Style - Inspired by Colorlib Dropdown #03 */
.modern-dropdown-wrapper {
	position: relative;
	display: inline-block;
	width: 100%;
}

.modern-dropdown-wrapper select {
	width: 100%;
	padding: 12px 40px 12px 15px;
	font-weight: 500;
	line-height: 1.5;
	height: auto;
	min-height: 45px;
}

/* Custom styled select with toggle appearance */
.select-toggle {
	position: relative;
	display: block;
	width: 100%;
	padding: 12px 40px 12px 15px;
	border: 1.5px solid #e0e0e0;
	border-radius: 8px;
	background-color: #fff;
	font-size: 14px;
	font-weight: 500;
	color: #222626;
	cursor: pointer;
	transition: all 0.3s ease;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23222626' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 12px;
}

.select-toggle:hover {
	border-color: #37A626;
	box-shadow: 0 0 0 3px rgba(55, 166, 38, 0.1);
}

.select-toggle:focus {
	outline: none;
	border-color: #37A626;
	box-shadow: 0 0 0 3px rgba(55, 166, 38, 0.1);
}

/* All select elements get the modern style */
select:not([multiple]):not(.no-toggle-style),
.form-group select:not([multiple]):not(.no-toggle-style),
.calculator-wrapper select:not([multiple]):not(.no-toggle-style),
.calculator-form select:not([multiple]):not(.no-toggle-style) {
	padding: 12px 40px 12px 15px !important;
	border: 1.5px solid #e0e0e0 !important;
	border-radius: 8px !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	color: #222626 !important;
	background-color: #fff !important;
	min-height: 45px !important;
	transition: all 0.3s ease !important;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23222626' d='M6 8L0 0h12z'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 12px center !important;
	background-size: 12px !important;
	padding-right: 40px !important;
}

select:not([multiple]):not(.no-toggle-style):hover,
.form-group select:not([multiple]):not(.no-toggle-style):hover,
.calculator-wrapper select:not([multiple]):not(.no-toggle-style):hover,
.calculator-form select:not([multiple]):not(.no-toggle-style):hover {
	border-color: #37A626 !important;
	box-shadow: 0 0 0 3px rgba(55, 166, 38, 0.1) !important;
}

select:not([multiple]):not(.no-toggle-style):focus,
.form-group select:not([multiple]):not(.no-toggle-style):focus,
.calculator-wrapper select:not([multiple]):not(.no-toggle-style):focus,
.calculator-form select:not([multiple]):not(.no-toggle-style):focus {
	outline: none !important;
	border-color: #37A626 !important;
	box-shadow: 0 0 0 3px rgba(55, 166, 38, 0.1) !important;
}

/* Form control selects */
.form-control[type="select"],
.form-control:not([type]),
.form-select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	padding: 12px 40px 12px 15px;
	border: 1.5px solid #e0e0e0;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 500;
	color: #222626;
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23222626' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 12px;
	transition: all 0.3s ease;
	min-height: 45px;
}

.form-control[type="select"]:hover,
.form-control:not([type]):hover,
.form-select:hover {
	border-color: #37A626;
	box-shadow: 0 0 0 3px rgba(55, 166, 38, 0.1);
}

.form-control[type="select"]:focus,
.form-control:not([type]):focus,
.form-select:focus {
	outline: none;
	border-color: #37A626;
	box-shadow: 0 0 0 3px rgba(55, 166, 38, 0.1);
}

/* Bootstrap dropdown menu styling */
.dropdown-menu {
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	padding: 8px 0;
	margin-top: 8px;
}

.dropdown-item {
	padding: 10px 20px;
	font-size: 14px;
	color: #222626;
	transition: all 0.2s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
	background-color: rgba(55, 166, 38, 0.1);
	color: #37A626;
}

.dropdown-item.active,
.dropdown-item:active {
	background-color: #37A626;
	color: #fff;
}

/* Custom dropdown button styling */
.dropdown-toggle::after {
	margin-left: 8px;
	vertical-align: middle;
}

/* Remove default browser select styling on all browsers */
select::-ms-expand {
	display: none;
}

select::-webkit-select-arrow {
	display: none;
}

/* Style the dropdown options menu (limited browser support) */
select option {
	padding: 12px 15px;
	font-size: 14px;
	font-weight: 500;
	color: #222626;
	background-color: #fff;
	border: none;
}

select option:hover {
	background-color: rgba(55, 166, 38, 0.1);
	color: #37A626;
}

select option:checked,
select option:focus {
	background-color: #37A626;
	color: #fff;
}

/* Custom dropdown menu styling for better appearance */
select:focus {
	background-color: #fff;
}

/* Additional styling for select when open */
select:active {
	background-color: #fff;
}

/*=====================================================================
Mobile Slider Content Adjustment
Adjust slider content position on mobile to prevent occlusion by logo
Logo is at top: 22px with height: 44px, so we need to push content down
=====================================================================*/

@media screen and (max-width: 767.9px) {
	/* Adjust the tp-caption container to push content down */
	/* Logo occupies space from 26px to 70px, add extra clearance to prevent overlap */
	.business-main-slider .tp-caption[data-type="text"] {
		margin-top: 0px !important; /* Push down to clear logo (26px top + 44px height + 24px extra clearance) */
	}
	
	/* Also adjust slide-content padding if needed for additional spacing */
	.business-main-slider .slide-content {
		margin-top: 0 !important; /* Reset any conflicting margins */
	}
	
	/* Hide pattern layer on mobile */
	.business-main-slider .pattern-layer {
		display: none !important;
	}
}

/*=====================================================================
Back to Top Button
A floating icon that appears when user scrolls down
Simple icon-only design with no background
=====================================================================*/

.back-to-top {
	position: fixed;
	bottom: 30px;
	right: 30px;
	background: transparent;
	border: none;
	cursor: pointer;
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 999;
	transition: all 0.3s ease;
	opacity: 0;
	transform: translateY(20px);
	padding: 0;
}

.back-to-top.show {
	display: flex;
	opacity: 1;
	transform: translateY(0);
}

.back-to-top:hover {
	transform: translateY(-3px);
}

.back-to-top:active {
	transform: translateY(-1px);
}

.back-to-top i {
	font-size: 32px;
	color: #37A626;
	transition: color 0.3s ease;
	font-weight: 300;
}

.back-to-top:hover i {
	color: #2d8a1f;
}

/* Mobile adjustments */
@media screen and (max-width: 767.9px) {
	.back-to-top {
		bottom: 20px;
		right: 20px;
	}

	.back-to-top i {
		font-size: 28px;
	}
}

/*=====================================================================
Header Avatar
Circular avatar showing user's initial in the header navigation
=====================================================================*/

.header__avatar-link {
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	padding: 0;
	transition: transform 0.2s ease;
}

.header__avatar-link:hover {
	transform: scale(1.05);
}

.header__avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background-color: #37A626;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-weight: 600;
	font-size: 14px;
	text-transform: uppercase;
	transition: all 0.3s ease;
	border: 2px solid rgba(255, 255, 255, 0.2);
}

.header__avatar-link:hover .header__avatar {
	background-color: #2d8a1f;
	border-color: rgba(255, 255, 255, 0.3);
	box-shadow: 0 0 0 3px rgba(55, 166, 38, 0.2);
}

/* Mobile adjustments for avatar */
@media screen and (max-width: 767.9px) {
	.header__avatar {
		width: 32px;
		height: 32px;
		font-size: 12px;
	}
}

/*=====================================================================
Mobile Scroll Fix - Prevent White Flash on Overscroll
Fixes the issue where page flashes white when scrolling to top on mobile
=====================================================================*/

html {
	/* Minimal overscroll behavior for mobile only */
	overscroll-behavior-y: auto;
	overscroll-behavior: auto;
	-webkit-overflow-scrolling: touch;
	/* Ensure background color matches page to prevent white flash */
	background-color: #fafafa !important;
	/* 
	 * IMPORTANT: transform: translate3d(0, 0, 0) was removed from html element
	 * 
	 * Reason: Transform on html creates a new containing block, which breaks 
	 * position: fixed elements (like the back-to-top button). Fixed elements 
	 * then position relative to the transformed html instead of the viewport.
	 * 
	 * White flash prevention is handled by:
	 * - overscroll-behavior properties (above)
	 * - background-color: #fafafa (prevents white background flash)
	 * - JavaScript overscroll prevention (in app.blade.php)
	 * 
	 * If white flash returns on mobile, alternatives:
	 * 1. Apply transform to .page-wrapper instead (not html/body)
	 * 2. Use will-change: scroll-position on specific elements
	 * 3. Enhance JavaScript overscroll prevention
	 * 
	 * DO NOT add transform to body - it creates stacking context that hides preloader
	 */
}

body {
	/* Minimal overscroll behavior for mobile only */
	overscroll-behavior-y: auto;
	overscroll-behavior: auto;
	-webkit-overflow-scrolling: touch;
	/* Ensure background color is set */
	background-color: #fafafa !important;
	/* Don't use transform3d on body as it creates stacking context that hides preloader */
}

/* Prevent overscroll on main page wrapper */
.page-wrapper {
	overscroll-behavior: auto;
	overscroll-behavior-y: auto;
	min-height: 100vh;
	background-color: #fafafa;
}

/* Prevent overscroll on specific scrollable containers only */
.auto-container,
[class*="scroll"]:not(.mCustomScrollbar),
[class*="slider"]:not(.swiper):not(.owl-carousel) {
	overscroll-behavior-y: contain;
}

/* Global smooth scrolling fix */
html {
	scroll-behavior: smooth;
}

/* Ensure scrolling works on all devices */
body {
	height: 100%;
	min-height: 100%;
	overflow-x: hidden;
}

/* Mobile-specific fixes */
@media screen and (max-width: 767.9px) {
	html {
		/* Targeted overscroll behavior only for problematic mobile devices */
		overscroll-behavior-y: contain;
		overscroll-behavior-x: auto;
		/* Prevent pull-to-refresh on mobile browsers */
		overscroll-behavior: contain;
		/* Ensure background colors are set */
		background-color: #fafafa !important;
		/* Allow smooth momentum scrolling */
		-webkit-overflow-scrolling: touch;
		/* 
		 * IMPORTANT: transform: translate3d(0, 0, 0) was removed from html element
		 * 
		 * Reason: Transform on html creates a new containing block, which breaks 
		 * position: fixed elements (like the back-to-top button). Fixed elements 
		 * then position relative to the transformed html instead of the viewport.
		 * 
		 * White flash prevention is handled by:
		 * - overscroll-behavior properties (above)
		 * - background-color: #fafafa (prevents white background flash)
		 * - JavaScript overscroll prevention (in app.blade.php)
		 * 
		 * If white flash returns on mobile, alternatives:
		 * 1. Apply transform to .page-wrapper instead (not html/body)
		 * 2. Use will-change: scroll-position on specific elements
		 * 3. Enhance JavaScript overscroll prevention
		 * 
		 * DO NOT add transform to body - it creates stacking context that hides preloader
		 */
	}
	
	body {
		/* Targeted overscroll behavior only for problematic mobile devices */
		overscroll-behavior-y: contain;
		overscroll-behavior-x: auto;
		/* Prevent pull-to-refresh on mobile browsers */
		overscroll-behavior: contain;
		/* Ensure background colors are set */
		background-color: #fafafa !important;
		/* Allow smooth momentum scrolling */
		-webkit-overflow-scrolling: touch;
		/* Don't use transform3d on body as it creates stacking context that hides preloader */
	}
	
	/* Ensure all sections have background to prevent white flash */
	section,
	.section,
	.auto-container,
	.page-wrapper {
		background-color: inherit;
	}
	
	/* Only apply overscroll behavior to specific elements that need it */
	[class*="scroll"]:not(.mCustomScrollbar):not([class*="featured"]),
	[class*="slider"]:not(.swiper):not(.owl-carousel) {
		overscroll-behavior-y: contain;
	}
	
	/* Allow normal scrolling for all other elements */
	section, .section, .auto-container, .page-wrapper {
		overscroll-behavior: auto;
	}
	
	/* Ensure fixed elements work properly with scroll */
	.back-to-top,
	.fixed-element,
	[position="fixed"] {
		transform: translateZ(0);
		will-change: transform;
	}
}

/*=====================================================================
Footer mobile app download
=====================================================================*/

.main-footer .footer-app-download {
	margin-top: 1rem;
	margin-bottom: 1.25rem;
}

.main-footer .footer-app-download__heading {
	margin: 0 0 0.75rem;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #F29727;
	font-family: 'Poppins', sans-serif;
}

.main-footer .footer-app-download__btn {
	display: flex;
	align-items: center;
	gap: 0.875rem;
	width: 100%;
	max-width: 100%;
	min-height: 3.25rem;
	padding: 0.75rem 1rem;
	border-radius: 12px;
	border: 1px solid rgba(55, 166, 38, 0.45);
	background: linear-gradient(135deg, rgba(55, 166, 38, 0.22) 0%, rgba(34, 38, 38, 0.85) 100%);
	color: #F2F2F2;
	text-decoration: none;
	transition: border-color 0.25s ease, background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
	box-sizing: border-box;
}

.main-footer .footer-app-download__btn:hover,
.main-footer .footer-app-download__btn:focus-visible {
	color: #F2F2F2;
	text-decoration: none;
	border-color: #37A626;
	background: linear-gradient(135deg, rgba(55, 166, 38, 0.38) 0%, rgba(34, 38, 38, 0.92) 100%);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
	transform: translateY(-1px);
}

.main-footer .footer-app-download__btn:focus-visible {
	outline: 2px solid #F29727;
	outline-offset: 2px;
}

.main-footer .footer-app-download__icon {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 10px;
	background-color: #37A626;
	color: #F2F2F2;
	font-size: 1.5rem;
	line-height: 1;
}

.main-footer .footer-app-download__text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	flex: 1;
	min-width: 0;
	gap: 0.125rem;
}

.main-footer .footer-app-download__eyebrow {
	font-size: 0.6875rem;
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: rgba(242, 242, 242, 0.72);
	line-height: 1.3;
	font-family: 'Poppins', sans-serif;
}

.main-footer .footer-app-download__title {
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.25;
	color: #F2F2F2;
	font-family: 'Poppins', sans-serif;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

.main-footer .footer-app-download__action {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	background-color: rgba(242, 242, 242, 0.12);
	color: #F29727;
	font-size: 0.9375rem;
	transition: background-color 0.25s ease, color 0.25s ease;
}

.main-footer .footer-app-download__btn:hover .footer-app-download__action,
.main-footer .footer-app-download__btn:focus-visible .footer-app-download__action {
	background-color: #F29727;
	color: #222626;
}

.main-footer .footer-app-download__version {
	display: inline-block;
	margin-top: 0.5rem;
	padding: 0.2rem 0.5rem;
	font-size: 0.75rem;
	font-weight: 500;
	color: rgba(242, 242, 242, 0.55);
	background-color: rgba(242, 242, 242, 0.08);
	border-radius: 4px;
	font-family: 'Poppins', sans-serif;
}

@media screen and (max-width: 991.98px) {
	.main-footer .footer-app-download {
		margin-top: 1.5rem;
	}
}

@media screen and (max-width: 767.98px) {
	.main-footer .footer-app-download {
		margin-top: 0.875rem;
		margin-bottom: 1.5rem;
	}

	.main-footer .footer-app-download__btn {
		min-height: 3.5rem;
		padding: 0.875rem 1rem;
	}

	.main-footer .footer-app-download__title {
		font-size: 0.9375rem;
		white-space: normal;
	}
}

@media screen and (max-width: 479.98px) {
	.main-footer .footer-app-download__icon {
		width: 2.5rem;
		height: 2.5rem;
		font-size: 1.35rem;
	}

	.main-footer .footer-app-download__eyebrow {
		font-size: 0.625rem;
	}
}
