/**
 * Custom CSS Overrides for Charitize Template Integration
 * This file provides custom styles to ensure proper integration between
 * the Charitize template and existing application content
 */

/* ========== Typography & Colors ========== */
:root {
	--primary-color: #0d47a1;
	--secondary-color: #2c3e50;
	--light-bg: #f8f9fa;
}

body {
	font-family: "Open Sans", sans-serif;
	color: #2c3e50;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: "Josefin Sans", sans-serif;
	font-weight: 600;
}

/* ========== Page Header Styling ========== */
.page-header {
	background: linear-gradient(135deg, #5b7fa6 0%, #6b8eba 50%, #5b7fa6 100%);
	background-image: linear-gradient(
			135deg,
			rgba(91, 127, 166, 0.75) 0%,
			rgba(107, 142, 186, 0.75) 50%,
			rgba(91, 127, 166, 0.75) 100%
		),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 400'%3E%3Cdefs%3E%3Cpattern id='wave1' x='0' y='0' width='100' height='100' patternUnits='userSpaceOnUse'%3E%3Cpath d='M0,50 Q25,30 50,50 T100,50' fill='none' stroke='%23ffffff' stroke-width='0.5' opacity='0.12'/%3E%3C/pattern%3E%3Cpattern id='wave2' x='0' y='0' width='120' height='120' patternUnits='userSpaceOnUse'%3E%3Cpath d='M0,60 Q30,40 60,60 T120,60' fill='none' stroke='%23ffffff' stroke-width='0.5' opacity='0.08'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='1200' height='400' fill='url(%23wave1)'/%3E%3Crect width='1200' height='400' fill='url(%23wave2)'/%3E%3C/svg%3E");
	background-size: auto, 100% 100%;
	background-attachment: fixed;
	background-position: center;
	position: relative;
	overflow: hidden;
}

.page-header::before {
	content: "";
	position: absolute;
	top: -50%;
	right: -10%;
	width: 400px;
	height: 400px;
	background: radial-gradient(
		circle,
		rgba(255, 255, 255, 0.06) 0%,
		transparent 70%
	);
	border-radius: 50%;
	pointer-events: none;
}

.page-header::after {
	content: "";
	position: absolute;
	bottom: -30%;
	left: -10%;
	width: 300px;
	height: 300px;
	background: radial-gradient(
		circle,
		rgba(255, 255, 255, 0.04) 0%,
		transparent 70%
	);
	border-radius: 50%;
	pointer-events: none;
}

.page-header h1 {
	text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.25);
	position: relative;
	z-index: 1;
	font-weight: 700;
	letter-spacing: 1px;
	color: #ffffff;
}

.page-header .container {
	position: relative;
	z-index: 1;
}

.page-header .breadcrumb {
	position: relative;
	z-index: 1;
}

/* ========== Mobile Header Optimization ========== */

/* Logo responsive sizing */
.logo-responsive {
	transition: all 0.3s ease;
	width: 50px;
	height: 50px;
	object-fit: contain;
}

/* Header link wrapper */
.header-link {
	text-decoration: none;
	white-space: normal;
}

.header-link:hover {
	opacity: 0.9;
}

/* Header text wrapper */
.header-text-wrapper {
	display: flex;
	flex-direction: column;
	gap: 0;
	line-height: 1;
	min-width: 0;
	word-break: break-word;
	overflow-wrap: break-word;
}

.header-text-line1,
.header-text-line2 {
	font-weight: 700;
	color: #0d47a1;
	line-height: 1.1;
	margin: 0;
	padding: 0;
	word-break: break-word;
	overflow-wrap: break-word;
	white-space: normal;
}

/* Topbar adjustments for mobile */
.top-bar {
	padding: 0;
}

.top-bar .col-lg-4 {
	padding: 8px 15px;
}

/* Mobile layout - screens up to 991px */
@media (max-width: 991px) {
	.top-bar {
		padding: 0;
	}

	.top-bar .col-lg-4 {
		padding: 8px 15px;
		text-align: center;
	}

	.top-bar .header-link {
		justify-content: center;
		gap: 8px;
		width: 100%;
		flex-wrap: wrap;
	}

	.logo-responsive {
		width: 42px;
		height: 42px;
		flex-shrink: 0;
	}

	.header-text-wrapper {
		text-align: center;
		gap: 0;
		min-width: 0;
		flex: 1;
		display: flex;
		flex-direction: column;
		justify-content: center;
	}

	.header-text-line1,
	.header-text-line2 {
		font-size: 14px;
		line-height: 1.2;
		padding: 0;
		margin: 0;
		word-break: break-word;
		overflow-wrap: break-word;
		hyphens: auto;
	}

	.header-text-line1 {
		margin-bottom: 0;
		font-weight: 700;
		color: #0d47a1;
	}

	.header-text-line2 {
		font-weight: 700;
		color: #0d47a1;
		font-size: 13px;
	}
}

/* Desktop topbar contact compactness */
@media (min-width: 992px) {
	.top-bar .btn-square {
		width: 44px;
		height: 44px;
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 6px;
	}

	.top-bar .col-lg-8 .row > .col-lg-4 {
		max-width: 33%;
	}

	.top-bar h6 {
		font-size: 13px;
		margin-bottom: 0;
		font-weight: 700;
	}

	.top-bar span {
		display: block;
		font-size: 13px;
		color: #ffffff;
	}

	.top-bar .d-flex.align-items-center {
		/* tighter gap */
		gap: 8px;
	}
}

/* Extra small screens (mobile phones) */
@media (max-width: 576px) {
	.top-bar .col-lg-4 {
		padding: 10px 15px;
	}

	.top-bar .header-link {
		gap: 8px;
		flex-wrap: wrap;
		align-items: center;
	}

	.logo-responsive {
		width: 40px;
		height: 40px;
		flex-shrink: 0;
	}

	.header-text-wrapper {
		text-align: center;
		min-width: 0;
		flex: 1;
	}

	.header-text-line1,
	.header-text-line2 {
		font-size: 12px;
		line-height: 1.15;
		word-break: break-word;
		overflow-wrap: break-word;
		white-space: normal;
	}

	.header-text-line1 {
		margin-bottom: 0;
	}

	.header-text-line2 {
		margin-top: 2px;
	}
}

/* Large screens (desktop) */
@media (min-width: 992px) {
	.top-bar .col-lg-4 {
		padding: 0;
		text-align: right;
	}

	/* Align the logo+site-name block to the right above the navbar */
	.top-bar .header-link {
		justify-content: flex-end;
		gap: 8px;
	}

	.logo-responsive {
		width: 50px;
		height: 50px;
	}

	/* Make the site name right-aligned on desktop */
	.header-text-wrapper {
		text-align: right;
	}

	.header-text-line1 {
		font-size: 24px;
		line-height: 1;
		font-weight: 800;
		color: #ffac00;
		letter-spacing: 1px;
	}

	.header-text-line2 {
		display: none;
	}

	/* Ensure logo and site name are always visible on desktop */
	.logo-responsive {
		display: inline-block !important;
		opacity: 1 !important;
	}

	.header-text-line1 {
		display: block !important;
		visibility: visible !important;
		z-index: 5;
	}

	.top-bar {
		z-index: 6;
	}
}

/* Logo hit area and desktop placement tweaks */
.logo-hit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 6px; /* increases clickable area */
	border-radius: 8px;
}

/* Remove visual background while keeping hit area large */
.logo-hit img {
	display: block;
}

@media (min-width: 992px) {
	/* Make hit area larger on desktop */
	.logo-hit {
		padding: 10px;
	}

	/* Ensure logo is left of site name, but the whole block sits right */
	.top-bar .header-link {
		flex-direction: row;
		align-items: center;
	}

	/* Slightly reduce gap between logo and text for compact look */
	.top-bar .header-link {
		gap: 8px;
	}

	/* Make site name a touch larger on desktop if needed */
	.header-text-line1 {
		font-size: 26px;
	}
}

/* Hover state: subtle highlight for logo area */
.logo-hit:hover {
	background: rgba(255, 255, 255, 0.03);
}

/* ========== Section Title Styling ========== */
.section-title {
	display: inline-block;
	position: relative;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 2px;
	color: #0d47a1;
	text-transform: uppercase;
	margin-bottom: 15px;
}

/* ========== Card & Box Styling ========== */
.gallery-item {
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
	transform: translateY(-5px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.team-member {
	padding: 15px;
	border-radius: 8px;
	transition: all 0.3s ease;
}

.team-member:hover {
	background-color: #f8f9fa;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.team-member img {
	border: 3px solid #0d47a1;
	transition: border-color 0.3s ease;
}

.team-member:hover img {
	border-color: #2c3e50;
}

/* ========== Blog & Article Styling ========== */
.blog-item {
	transition: all 0.3s ease;
	border: none;
}

.blog-item:hover {
	transform: translateY(-8px);
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.blog-img {
	background-color: #f8f9fa;
	position: relative;
	overflow: hidden;
}

.blog-img img {
	transition: transform 0.5s ease;
}

.blog-item:hover .blog-img img {
	transform: scale(1.05);
}

.blog-category {
	position: absolute;
	top: 15px;
	right: 15px;
	z-index: 2;
}

.article-content {
	line-height: 1.8;
	word-wrap: break-word;
}

.article-content img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	margin: 15px 0;
}

/* ========== Testimonial Styling ========== */
.testimonial-item {
	border-left: 4px solid #0d47a1;
	transition: all 0.3s ease;
}

.testimonial-item:hover {
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
	transform: translateX(5px);
}

/* ========== Table Styling ========== */
.table {
	background-color: #fff;
}

.table-light thead {
	background-color: #f8f9fa;
	border-bottom: 2px solid #dee2e6;
}

.table tbody tr {
	transition: background-color 0.2s ease;
}

.table tbody tr:hover {
	background-color: #f8f9fa;
}

.table td {
	vertical-align: middle;
	padding: 12px;
}

.btn-primary {
	background-color: #ffa500;
	border-color: #0f4c4c;
	transition: all 0.3s ease;
}

.btn-primary:hover {
	background-color: #0f4c4c;
	border-color: #0f4c4c;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(13, 71, 161, 0.3);
}

.btn-secondary {
	background-color: #2c3e50;
	border-color: #2c3e50;
	transition: all 0.3s ease;
}

.btn-secondary:hover {
	background-color: #34495e;
	border-color: #34495e;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(44, 62, 80, 0.3);
}

.btn-link {
	color: #0d47a1;
	text-decoration: none;
	transition: color 0.3s ease;
	padding-left: 0;
	padding-right: 0;
}

.btn-link:hover {
	color: #2c3e50;
	text-decoration: underline;
}

/* ========== Form Styling ========== */
.form-control,
.form-select {
	border: 1px solid #dee2e6;
	border-radius: 6px;
	transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
	border-color: #0d47a1;
	box-shadow: 0 0 0 0.2rem rgba(13, 71, 161, 0.25);
}

/* ========== Alert Styling ========== */
.alert {
	border: none;
	border-radius: 8px;
	padding: 15px 20px;
}

.alert-info {
	background-color: #e3f2fd;
	color: #1565c0;
}

.alert-success {
	background-color: #e8f5e9;
	color: #2e7d32;
}

.alert-warning {
	background-color: #fff3e0;
	color: #e65100;
}

.alert-danger {
	background-color: #ffebee;
	color: #c62828;
}

/* ========== Breadcrumb Styling ========== */
.breadcrumb {
	background-color: transparent;
	padding: 0;
}

.breadcrumb-item a {
	color: #fff;
	text-decoration: none;
	transition: opacity 0.3s ease;
}

.breadcrumb-item a:hover {
	opacity: 0.8;
	text-decoration: underline;
}

.breadcrumb-item.active {
	color: #ffc107;
}

/* ========== Badge Styling ========== */
.badge {
	padding: 6px 10px;
	font-weight: 500;
	border-radius: 6px;
}

.badge.bg-primary {
	background-color: #0d47a1 !important;
}

.badge.bg-success {
	background-color: #28a745 !important;
}

.badge.bg-danger {
	background-color: #dc3545 !important;
}

/* ========== Media Objects & Images ========== */
img {
	max-width: 100%;
	height: auto;
}

figure {
	margin: 20px 0;
}

figure img {
	border-radius: 8px;
}

/* ========== WOW Animation ========== */
.wow {
	visibility: hidden;
}

.wow.animated {
	visibility: visible;
}

/* ========== Back to Top Button ========== */
.back-to-top {
	width: 50px;
	height: 50px;
	position: fixed;
	bottom: 30px;
	right: 30px;
	background-color: #0d47a1;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	text-decoration: none;
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s ease;
	z-index: 999;
}

.back-to-top.active,
.back-to-top:hover {
	opacity: 1;
	visibility: visible;
}

.back-to-top:hover {
	background-color: #2c3e50;
	transform: translateY(-5px);
}

/* ========== Spinner Styling ========== */
#spinner {
	z-index: 9999;
}

.spinner-border {
	color: #0d47a1;
}

/* ========== Footer Specific ========== */
.footer {
	background-color: #2c3e50;
	color: #ecf0f1;
}

.footer h4 {
	color: #fff;
	margin-bottom: 20px;
	font-weight: 600;
}

.footer p {
	margin-bottom: 10px;
	opacity: 0.9;
}

.footer a {
	color: #0d47a1;
	text-decoration: none;
	transition: color 0.3s ease;
}

.footer a:hover {
	color: #fff;
	text-decoration: underline;
}

.footer .btn-square {
	width: 40px;
	height: 40px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	transition: all 0.3s ease;
}

.footer .btn-square:hover {
	transform: translateY(-3px);
}

/* Hide footer sections on mobile */
@media (max-width: 991px) {
	.footer .row.g-5 {
		display: none !important;
	}
}

/* ========== Mobile Bottom Navigation ========== */
.mobile-bottom-nav {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	background: #ffffff;
	border-top: 1px solid #dee2e6;
	display: flex;
	justify-content: space-around;
	align-items: center;
	height: 70px;
	z-index: 1000;
	padding: 8px 0;
	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-bottom-nav .btn-item {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	color: #2c3e50;
	font-size: 11px;
	padding: 8px 0;
	transition: all 0.3s ease;
}

.mobile-bottom-nav .btn-item i {
	font-size: 22px;
	margin-bottom: 3px;
	display: block;
}

.mobile-bottom-nav .btn-item:hover,
.mobile-bottom-nav .btn-item.active {
	color: #0d47a1;
	background-color: #f0f4ff;
}

.mobile-bottom-nav .btn-item span {
	display: block;
	text-align: center;
	line-height: 1.2;
}

/* ========== Mobile Pelayanan Submenu ========== */
.mobile-pelayanan-submenu {
	position: fixed;
	bottom: 70px;
	left: 0;
	right: 0;
	background: #f8f9fa;
	border-top: 1px solid #dee2e6;
	z-index: 999;
	max-height: calc(100vh - 70px);
	overflow-y: auto;
	animation: slideUp 0.3s ease;
}

@keyframes slideUp {
	from {
		transform: translateY(100%);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

.submenu-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	background: #0d47a1;
	color: #fff;
	border-bottom: 1px solid #dee2e6;
}

.submenu-header button {
	background: transparent;
	border: none;
	color: #fff;
	font-size: 14px;
	padding: 0;
	cursor: pointer;
}

.submenu-title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	text-align: center;
	flex: 1;
}

.submenu-items {
	display: flex;
	flex-direction: column;
	padding: 8px 0;
}

.submenu-item {
	display: flex;
	align-items: center;
	padding: 12px 16px;
	text-decoration: none;
	color: #2c3e50;
	border-bottom: 1px solid #dee2e6;
	transition: all 0.2s ease;
}

.submenu-item i {
	margin-right: 12px;
	font-size: 16px;
	color: #0d47a1;
	min-width: 20px;
}

.submenu-item:hover {
	background-color: #e3f2fd;
	color: #0d47a1;
	padding-left: 20px;
}

/* ========== Responsive Adjustments ========== */
@media (max-width: 991px) {
	/* Hide ALL navbar and navigation elements on mobile */
	.navbar,
	.nav-bar,
	.navbar-expand-lg,
	.navbar-collapse,
	.container-fluid.bg-secondary.px-0,
	.container-fluid.bg-secondary.px-0.wow.fadeIn {
		display: none !important;
	}

	/* Ensure body has padding for mobile bottom nav */
	body {
		padding-bottom: 80px;
	}

	/* Hide topbar contact info on mobile - only show logo */
	.top-bar .col-lg-8 {
		display: none !important;
	}
}

@media (max-width: 768px) {
	.page-header {
		background-attachment: scroll;
	}

	.page-header h1 {
		font-size: 28px;
	}

	.back-to-top {
		width: 40px;
		height: 40px;
		bottom: 20px;
		right: 20px;
		bottom: 100px;
	}

	.team-member {
		margin-bottom: 15px;
	}

	.blog-item {
		margin-bottom: 20px;
	}

	.gallery-item {
		margin-bottom: 15px;
	}

	.section-title {
		font-size: 12px;
	}

	h1 {
		font-size: 24px;
	}

	h2 {
		font-size: 20px;
	}

	h3 {
		font-size: 18px;
	}

	/* Add padding bottom to body for mobile bottom nav */
	body {
		padding-bottom: 80px;
	}

	/* Force hide navbar container on mobile */
	.container-fluid.bg-secondary.d-none.d-lg-block {
		display: none !important;
	}

	.nav-bar {
		display: none !important;
	}

	.navbar {
		display: none !important;
	}
}

@media (max-width: 991px) {
	body {
		padding-bottom: 80px;
	}

	/* Force hide navbar on tablet and below */
	.nav-bar {
		display: none !important;
	}

	.navbar {
		display: none !important;
	}

	.navbar-expand-lg {
		display: none !important;
	}

	/* Hide all navbar-related elements */
	.navbar-toggler,
	.navbar-collapse,
	.navbar-nav {
		display: none !important;
	}

	/* Hide navbar container */
	.container-fluid.bg-secondary.px-0 {
		display: none !important;
	}
}

/* Hide mobile bottom nav on desktop (lg breakpoint and above) */
@media (min-width: 992px) {
	.d-lg-none {
		display: none !important;
	}
	.mobile-bottom-nav {
		display: none !important;
	}
	.mobile-pelayanan-submenu {
		display: none !important;
	}
	.offcanvas-menu {
		display: none !important;
	}
}

/* Show header and center all on desktop */
@media (min-width: 992px) {
	.top-bar {
		text-align: center;
	}

	.top-bar .col-lg-4 {
		display: flex !important;
		justify-content: center;
		order: 1;
		padding: 8px 15px;
	}

	.top-bar .col-lg-8 {
		justify-content: center;
		order: 2;
	}

	.top-bar .row {
		flex-wrap: wrap;
		justify-content: center;
	}

	.top-bar .header-link {
		justify-content: center;
	}

	.header-text-wrapper {
		text-align: center;
	}
}

/* ========== Print Styles ========== */
@media print {
	.page-header,
	.back-to-top,
	.footer,
	.btn {
		display: none;
	}

	body {
		background-color: white;
		color: black;
	}

	a {
		color: black;
		text-decoration: underline;
	}
}
