/*
 * SleekApp Main Stylesheet
 */

/* --- 1. CSS Variables & Theming --- */
:root {
	/* Textures - Replace with your actual image */
	--texture-background: linear-gradient(45deg, var(--color-card-bg), #414345);

	/* Light Mode Colors */
	--color-bg: #f4f5f7;
	--color-text: #172b4d;
	--color-card-bg: #ffffff;
	--color-header-bg: var(--texture-background, linear-gradient(45deg, #232526, #414345));
	--color-header-text: #ffffff;
	--color-border: #dfe1e6;
	--color-accent: #0052cc;

	--color-secondary: #fc7d2c; /* Default secondary color */
	/* Component Colors */
	--color-tabs-active: var(--color-accent);
	--color-tabs-inactive: var(--color-text);

	/* Sidebar Specific Colors */
	--color-sidebar-bg: #1d2125;
	--color-sidebar-text: #c1c7d0;
	--color-sidebar-hover-bg: #282e33;
	--color-sidebar-active-text: #ffffff;

	/* Shadows */
	--shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
	--shadow-nav: 0 -2px 10px rgba(0, 0, 0, 0.1);

	/* Sizing & Radius */
	--border-radius-card: 8px;
	--border-radius-btn: 8px;

	/* Typography */
	--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
	--font-size-base: 16px;
	--font-size-h1: 2.5rem;
	--font-size-h2: 1.5rem;
}

/* Dark Mode (applied via .dark-mode class on body) */
body.dark-mode {
	--color-bg: #1d2125;
	--color-text: #c1c7d0;
	--color-card-bg: #282e33;
	--color-border: #424f5e;
	--color-accent: #4c9aff;
}

/* --- 2. General & Body --- */
body {
	background-color: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-sans);
	font-size: var(--font-size-base);
	margin: 0;
	line-height: 1.6;
}

a {
	color: var(--color-accent);
	text-decoration: none;
}

/* --- 2.5 Icon Component --- */
.icon svg {
	width: 1em; /* Use font-size to control icon size */
	height: 1em;
	vertical-align: -0.125em; /* Better vertical alignment */
	stroke-width: 2;
	fill: none; /* For outlined icons */
}

/* Font Awesome specific adjustments */
.icon.fas, .icon.far, .icon.fab {
	stroke-width: 0;
	fill: currentColor;
}

/* --- 3. Desktop Layout --- */
.page-wrapper {
	display: flex;
}

.sidebar-left {
	width: 240px;
	background-color: var(--color-sidebar-bg);
	border-right: 1px solid var(--color-border);
	display: flex;
	flex-direction: column;
	transition: width 0.2s ease-in-out, padding 0.2s ease-in-out;
	height: calc(100vh - 60px); /* Full height minus header */
	position: sticky;
	top: 60px;
	padding: 20px;
}

.page-wrapper.sidebar-collapsed .sidebar-left {
	width: 80px; /* Collapsed width */
	padding: 20px 0;
}

.page-wrapper.sidebar-collapsed .sidebar-footer .sidebar-toggle {
	justify-content: center;
}

.page-wrapper.sidebar-collapsed .sidebar-footer .sidebar-toggle .icon {
	transform: rotate(180deg);
}

.page-wrapper.sidebar-collapsed .sidebar-footer .menu-item-title-text {
	display: none; /* Hide text when collapsed */
}

.site-main {
	flex-grow: 1;
	padding: 2rem;
}

.sidebar-right {
	width: 280px; /* A bit wider for secondary content */
	flex-shrink: 0;
	padding: 2rem;
	border-left: 1px solid var(--color-border);
	background-color: var(--color-card-bg);
}

/* --- 3.5 Header Addons --- */
.header-top-bar,
.header-under-bar {
	background-color: var(--color-card-bg);
	border-bottom: 1px solid var(--color-border);
	padding: 0;
	text-align: center;
	font-size: 0.9rem;
}

.header-top-bar {
	/* The main header will sit on top of this if sticky */
	position: relative;
	z-index: 999;
}

/* --- 3.6 Sidebar Footer --- */
.sidebar-footer {
	margin-top: auto; /* Pushes the button to the bottom */
	padding-top: 1rem;
	border-top: 1px solid var(--color-sidebar-hover-bg);
}

.sidebar-footer .sidebar-toggle {
	width: 100%;
}

/* --- 3.7 Sidebar Toggle --- */
.sidebar-toggle {
	background: none;
	border: none;
	color: var(--color-sidebar-text);
	cursor: pointer;
	font-size: 1.5rem;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px;
}

/* Header toggle should match header text color */
#sidebar-toggle {
	color: var(--color-header-text);
}

.mobile-sidebar-toggle {
	display: none; /* Hidden by default, shown on mobile */
	color: var(--color-header-text);
}

/* --- 4. Header --- */
.site-header {
	background: var(--color-header-bg);
	color: var(--color-header-text);
	min-height: 60px;
	position: sticky;
	top: 0;
	z-index: 1000;
	background-size: cover;
	background-position: center;
	box-shadow: var(--shadow-soft);
}

.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;	
	padding: 0.5rem 2rem; /* Add vertical padding */
	min-height: inherit; /* Inherit min-height from parent */
}

.header-left,
.header-center,
.header-right {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-shrink: 0;
}

.header-left {
	justify-content: flex-start;
}

.page-wrapper.sidebar-collapsed .header-left {
	/* Adjust layout when sidebar is collapsed */
	flex-basis: auto;
}

.header-center {
	justify-content: center;
	flex-grow: 1; /* Allow center to take up available space */
	flex-shrink: 1;
}

.header-right {
	justify-content: flex-end;
}

.site-title {
	font-size: 1.25rem;
	font-weight: 600;
	margin: 0;
}
.site-title a {
	color: var(--color-header-text);
}

.site-branding {
	flex-shrink: 0;
}

.custom-logo-link {
	display: block;
}
.custom-logo {
	height: 40px; /* Controls the display height */
	width: auto;
}

.header-shortcode {
	width: 100%;
	max-width: 600px; /* Adjust as needed */
}

.logout-link {
	color: var(--color-header-text);
	line-height: 0;
	opacity: 0.8;
}

.header-search,
.header-actions,
.header-profile-placeholder { /* Renamed for clarity if needed elsewhere */
	display: flex;
	font-size: 1.5rem;
}

.header-profile {
	position: relative; /* For dropdown positioning */
}

.profile-toggle {
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	line-height: 0;
	border-radius: 50%;
}

.profile-toggle .avatar {
	border-radius: 50%;
	display: block;
}

.profile-dropdown {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	background-color: var(--color-card-bg);
	border: 1px solid var(--color-border);
	border-radius: var(--border-radius-card);
	box-shadow: var(--shadow-soft);
	list-style: none;
	margin: 0;
	padding: 0.5rem;
	width: 220px;
	z-index: 1010;
}

.profile-dropdown[hidden] {
	display: none;
}

.profile-dropdown-header {
	padding: 0.75rem 1rem;
	border-bottom: 1px solid var(--color-border);
	margin-bottom: 0.5rem;
}

.profile-dropdown .user-name {
	display: block;
	font-weight: 600;
	color: var(--color-text);
}

.profile-dropdown .user-email {
	display: block;
	font-size: 0.85rem;
	color: var(--color-text);
	opacity: 0.7;
}

.profile-dropdown li a {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.5rem 1rem;
	color: var(--color-text);
	border-radius: 4px;
	font-size: 0.9rem;
}

.profile-dropdown li a:hover {
	background-color: var(--color-bg);
	color: var(--color-accent);
}

.profile-dropdown .separator hr {
	border: none;
	border-top: 1px solid var(--color-border);
	margin: 0.5rem 0;
}

.header-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 1.5rem;
}

.header-navigation a {
	color: var(--color-header-text);
	font-weight: 500;
	position: relative;
	opacity: 0.8;
	transition: opacity 0.2s ease-in-out;
}

.header-navigation a:hover {
	opacity: 1;
}

/* Hide header nav on mobile, it's for desktop inline style */
@media (max-width: 768px) {
	.header-navigation { display: none; }
}

/* --- 5. Navigation --- */
.main-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.main-navigation .menu-item {
	/* Use position relative to anchor the toggle button */
	position: relative;
	display: block;
}

.main-navigation .menu-item a {
	display: flex; /* This is crucial for side-by-side alignment */
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	flex-grow: 1; /* Allow the link to take up all available space */
	border-radius: 6px; /* This will be applied to the link area */
	color: var(--color-sidebar-text); /* This will be the default, overridden by options */
	font-weight: 500;
	position: relative; /* For z-index stacking */
	font-family: var(--font-sans); /* Ensure font consistency */
	white-space: nowrap;
	overflow: hidden;
}

.main-navigation .menu-item > a:hover {
	background-color: var(--color-sidebar-hover-bg);
	color: var(--color-sidebar-active-text);
}

.main-navigation .current-menu-item > a,
.main-navigation .current-menu-ancestor > a {
	background-color: var(--color-sidebar-hover-bg);
	color: var(--color-sidebar-active-text);
	font-weight: 600;
}

.main-navigation .menu-item-title-text {
	display: inline-block; /* Ensures it aligns correctly within the flex container */
	vertical-align: middle;
}

/* Sub Menu */
.main-navigation .menu-item:before{
  display: none;
}

.page-wrapper.sidebar-collapsed .main-navigation .menu-item > a {
	justify-content: center;
}

.page-wrapper.sidebar-collapsed .main-navigation .menu-item-title-text {
	display: none;
}

/* Sub-menu styling */
.main-navigation .sub-menu {
	list-style: none;
	padding-left: 15px; /* Indent sub-menu items */
	margin: 0;
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.3s ease-in-out;
}

.main-navigation .menu-item-has-children.is-open > .sub-menu {
	max-height: 1000px; /* A large value to allow it to expand */
}

.main-navigation .sub-menu .menu-item a {
	font-size: 0.9rem;
	font-weight: 400;
	opacity: 0.8;
	padding-left: 20px; /* Extra indent for sub-items */
}

.main-navigation .sub-menu li a:hover {
	opacity: 1;
}

/* Sub-menu Toggle Button */
.submenu-toggle {
	position: absolute;
	right: 5px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	cursor: pointer;
	color: var(--color-sidebar-text);
	opacity: 0.6;
	padding: 10px;
	line-height: 0;
	transition: opacity 0.2s ease, transform 0.2s ease;
	z-index: 2; /* Ensure toggle is above the sub-menu */
}

.submenu-toggle:hover {
	opacity: 1;
}

.submenu-toggle::after {
	content: '\f078'; /* Font Awesome chevron-down */
	font-family: "Font Awesome 5 Free";
	font-weight: 900;
	font-size: 0.8em;
	transition: transform 0.3s ease-in-out;
}

.menu-item-has-children.is-open > .submenu-toggle::after {
	transform: rotate(-180deg);
}

.page-wrapper.sidebar-collapsed .main-navigation .menu-item-has-children > .submenu-toggle {
	display: none; /* Hide arrow when collapsed */
}

/* Fly-out sub-menu on hover when collapsed */
.page-wrapper.sidebar-collapsed .main-navigation .menu-item-has-children:hover > .sub-menu {
	display: block;
	position: absolute;
	left: 100%; /* Position next to the collapsed sidebar */
	top: 0;
	width: 220px;
	background-color: var(--color-sidebar-bg);
	border: 1px solid var(--color-sidebar-hover-bg);
	border-radius: 0 var(--border-radius-card) var(--border-radius-card) 0;
	box-shadow: var(--shadow-soft);
	padding: 0.5rem;
	max-height: none; /* Override expanding animation */
	overflow: visible;
	z-index: 10;
	padding-left: 0; /* Reset padding for flyout */
}

/* --- 6. Card Grid --- */
.card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 1.5rem;
}

.card {
	background-color: var(--color-card-bg);
	border: 1px solid var(--color-border);
	border-radius: var(--border-radius-card);
	padding: 1.5rem;
	box-shadow: var(--shadow-soft);
	transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.card:hover {
	transform: translateY(-4px) scale(1.02);
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card:active {
	transform: translateY(-1px) scale(0.99);
	transition-duration: 0.1s;
}

.card-grid .card > * {
	/* Apply the pop-in animation to the card's direct children inside a grid */
	animation: popIn 0.4s ease-out forwards;
	opacity: 0;
}

.card-grid .card > * {
	/* Stagger the pop-in animation for each card's content inside a grid */
	animation-delay: calc(var(--card-index, 0) * 50ms);
}
.entry-title {
	font-size: var(--font-size-h1);
	margin: 0 0 1rem 0;
}

.card .entry-title {
	font-size: var(--font-size-h2);
	margin: 0 0 0.5rem 0;
}
.entry-title a {
	color: inherit;
}
.entry-summary {
	font-size: 0.95rem;
}

.archive-description {
	margin-top: 1rem;
	font-size: 1rem;
	color: var(--color-text);
}

.card-thumbnail {
	width: 100%;
	height: auto;
	border-radius: var(--border-radius-card) var(--border-radius-card) 0 0;
	margin: -1.5rem -1.5rem 1.5rem -1.5rem;
	max-width: calc(100% + 3rem);
}

.entry-content-wrapper {
	background: var(--color-card-bg);
	padding: 2rem;
	border-radius: var(--border-radius-card);
	box-shadow: var(--shadow-soft);
}

.entry-meta {
	font-size: 0.9rem;
	color: var(--color-text);
	opacity: 0.8;
	margin-bottom: 1.5rem;
}

.entry-meta .byline a {
	font-weight: 500;
}

.post-thumbnail {
	margin-bottom: 2rem;
}

.post-thumbnail img {
	width: 100%;
	height: auto;
	border-radius: var(--border-radius-card);
}

.entry-footer {
	margin-top: 2rem;
	padding-top: 2rem;
	border-top: 1px solid var(--color-border);
}

.social-share {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.share-title {
	font-size: 1rem;
	font-weight: 500;
	margin: 0 1rem 0 0;
}

.social-share-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background-color: var(--color-bg);
	color: var(--color-text);
	font-size: 1rem;
	transition: all 0.2s ease-in-out;
}

.social-share-link:hover {
	background-color: var(--color-accent);
	color: #fff;
	transform: translateY(-2px);
}

.social-share-link.facebook:hover {
	background-color: #1877F2;
}

.social-share-link.twitter:hover {
	background-color: #1DA1F2;
}

.social-share-link.linkedin:hover {
	background-color: #0A66C2;
}

.social-share-link.whatsapp:hover {
	background-color: #25D366;
}

.social-share-link.copy-link:hover {
	background-color: var(--color-secondary);
}

.social-share-link.copy-link.is-copied {
	background-color: #28a745; /* A success green color */
	color: #fff;
}

.related-posts {
	margin-top: 3rem;
	padding-top: 2rem;
	border-top: 1px solid var(--color-border);
}

.related-posts-title {
	font-size: var(--font-size-h2);
	margin-bottom: 1.5rem;
}

/* --- 6.5 Theme Toggle --- */
.theme-toggle {
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	color: var(--color-header-text);
	line-height: 0; /* Prevents extra space */
}

.theme-toggle .icon {
	display: inline-block;
}

/* Hide moon icon in light mode */
.theme-toggle .icon-moon {
	display: none;
}

/* Hide sun icon in dark mode */
.dark-mode .theme-toggle .icon-sun {
	display: none;
}

.dark-mode .theme-toggle .icon-moon {
	display: block;
}

/* --- 6.7 Buttons --- */
.btn,
button,
input[type="button"],
input[type="reset"],
input[type="submit"],
.button /* Common WordPress class */
{
	display: inline-block;
	padding: 0.75rem 1.5rem;
	border-radius: var(--border-radius-btn);
	font-weight: 500;
	text-align: center;
	cursor: pointer;
	transition: all 0.2s ease-in-out;
	border-width: 1px;
	border-style: solid;
	text-decoration: none;
}

.btn:hover,
button:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
input[type="submit"]:hover,
.button:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-soft);
}

.btn:active,
button:active,
input[type="button"]:active,
input[type="reset"]:active,
input[type="submit"]:active,
.button:active {
	transform: translateY(0) scale(0.98);
	box-shadow: none;
	transition-duration: 0.1s;
}

/* Style 1 */
.btn-primary,
button,
input[type="button"],
input[type="reset"],
input[type="submit"],
.button {
	background-color: var(--color-btn-primary-bg, #d0cea8);
	border-color: var(--color-btn-primary-border, #666745);
	color: var(--color-btn-primary-text, black);
}

/* Style 2 */
.btn-secondary,
.wp-block-button__link.is-style-outline > .wp-block-button__link { /* Example for block editor outline button */
	background-color: var(--color-btn-secondary-bg, var(--color-secondary));
	border-color: var(--color-btn-secondary-border, var(--color-secondary));
	color: var(--color-btn-secondary-text, #ffffff);
}

/* When buttons are grouped, style the last one as secondary */
.btn-primary + .btn-secondary,
.btn-primary + .btn,
.btn-primary + button,
.btn-primary + input[type="button"],
.btn-primary + input[type="reset"],
.btn-primary + input[type="submit"],
.btn-primary + .button {
	background-color: var(--color-secondary);
	border-color: var(--color-secondary);
	color: #ffffff; /* Assuming secondary color is dark enough for white text */
}

/* --- 7. Mobile Version --- */

/* Hide mobile nav on desktop */
.mobile-bottom-nav {
	display: none;
}

/* Mobile Styles (e.g., screens < 768px) */
@media (max-width: 768px) {
	body {
		/* Add padding to prevent content from hiding behind bottom nav */
		padding-bottom: 80px;
	}

	/* Hide desktop sidebar on mobile */
	.sidebar-left {
		display: none;
	}

	.desktop-only {
		display: none !important;
	}

	.header-inner {
		padding: 0 1rem;
	}

	/* Show mobile nav */
	.mobile-bottom-nav {
		display: flex;
		justify-content: space-around;
		align-items: center;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		height: 65px;
		background-color: var(--color-card-bg);
		box-shadow: var(--shadow-nav);
		z-index: 1000;
	}

	.nav-item {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		flex-grow: 1;
		color: var(--color-text);
		padding: 4px 0;
		min-width: 44px; /* Touch target */
		min-height: 44px; /* Touch target */
	}
	.nav-item.active {
		color: var(--color-accent);
	}
	.nav-item .icon {
		font-size: 1.5rem;
	}
	.nav-item .label {
		font-size: 0.7rem;
	}

	/* Switch to single-column grid on mobile */
	.card-grid {
		grid-template-columns: 1fr;
	}

	/* On mobile, constrain tab component width to be responsive with padding */
	.sleekapp-tabs {
		width: calc(100vw - 2rem); /* Full viewport width minus padding */
		margin-left: auto;
		margin-right: auto;
	}

	.sidebar-right.hide-on-mobile {
		display: none;
	}

	/* Mobile Hamburger Menu Styles */
	.has-mobile-sidebar .mobile-sidebar-toggle {
		display: block;
	}

	.has-mobile-sidebar .sidebar-left {
		display: flex;
		position: fixed;
		top: 0;
		left: 0;
		height: 100vh;
		z-index: 3000;
		transform: translateX(-100%);
		transition: transform 0.3s ease-in-out;
		padding: 20px; /* Restore padding for mobile view */
	}

	body.mobile-sidebar-open .sidebar-left {
		transform: translateX(0);
	}

	.mobile-sidebar-overlay {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background-color: rgba(0, 0, 0, 0.5);
		z-index: 2999;
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.3s ease, visibility 0.3s;
	}
	body.mobile-sidebar-open .mobile-sidebar-overlay {
		opacity: 1;
		visibility: visible;
	}
}

/* --- 8. Page Transitions --- */
.site-main {
	transition: opacity 0.3s ease-in-out;
}

/* Fade in on page load */
body.page-is-fading-in .site-main {
	opacity: 0;
}

/* Fade out when navigating away */
body.page-is-fading-out .site-main {
	opacity: 0;
}
/* The beforeunload event also adds this class, ensuring a fade-out even for external links or reloads. */
body.page-is-leaving .site-main {
	opacity: 0;
}

/* --- 9. Pull to Refresh --- */
.ptr--ptr {
	/* Ensure the indicator uses theme colors */
	color: var(--color-accent);
	background: var(--color-bg);
}

.ptr--ptr .ptr--icon,
.ptr--ptr .ptr--text {
	/* Ensure the spinner uses the accent color */
	color: var(--color-accent);
}

/* --- 10. Sliding Panel Modal --- */
.sliding-panel-container {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 2000;
	pointer-events: none; /* Allow clicks through when hidden */
	display: flex;
	justify-content: flex-end; /* Aligns panel to the right */
}

.panel-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	opacity: 0;
	transition: opacity 0.3s ease-in-out;
}

.sliding-panel {
	width: 100%;
	max-width: 400px; /* Desktop width */
	height: 100%;
	background-color: var(--color-card-bg);
	box-shadow: -5px 0 15px rgba(0,0,0,0.1);
	transform: translateX(100%); /* Start off-screen */
	transition: transform 0.3s ease-in-out;
	display: flex;
	flex-direction: column;
}

.panel-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1rem 1.5rem;
	border-bottom: 1px solid var(--color-border);
	flex-shrink: 0;
}

.panel-title {
	font-size: 1.25rem;
	font-weight: 600;
	margin: 0;
}

.close-panel-button {
	background: none;
	border: none;
	cursor: pointer;
	color: var(--color-text);
	font-size: 1.5rem;
	padding: 0;
	line-height: 0;
}

.panel-content {
	padding: 1.5rem;
	overflow-y: auto;
	flex-grow: 1;
}

/* Open State */
.sliding-panel-container.is-open {
	pointer-events: auto; /* Enable clicks when open */
}
.sliding-panel-container.is-open .panel-overlay {
	opacity: 1;
}
.sliding-panel-container.is-open .sliding-panel {
	transform: translateX(0);
}

/* Mobile: Slide up from bottom */
@media (max-width: 768px) {
	.sliding-panel-container {
		align-items: flex-end; /* Aligns panel to the bottom */
	}
	.sliding-panel {
		max-width: 100%;
		height: 90vh;
		border-radius: 16px 16px 0 0;
		transform: translateY(100%); /* Start off-screen */
	}
	.sliding-panel-container.is-open .sliding-panel {
		transform: translateY(0);
	}
}

/* --- 10.5 Loading Spinner --- */
.spinner-container {
	display: flex;
	justify-content: center;
	align-items: center;
	height: 100%;
	min-height: 150px;
}

.spinner {
	width: 40px;
	height: 40px;
	border: 4px solid rgba(0, 0, 0, 0.1);
	border-left-color: var(--color-accent);
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* --- 11. Footer --- */
.site-footer {
	padding: 2rem;
	background: var(--color-footer-bg, var(--color-header-bg)); /* Use footer color, fallback to header */
	display: none; /* Hidden by default on mobile where bottom nav is used */
	color: var(--color-header-text); /* Match header text color */
}

.footer-inner {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap; /* Allow stacking on small screens */
	gap: 1rem;
}

.footer-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
}

.footer-navigation a {
	color: var(--color-header-text);
	font-size: 0.9rem;
	font-weight: 500;
	transition: color 0.2s ease-in-out;
}

.footer-navigation a:hover {
	color: var(--color-accent);
}

.site-info {
	font-size: 0.9rem;
	color: var(--color-header-text);
}

@media (min-width: 769px) {
	.site-footer {
		display: block; /* Show footer on desktop */
	}
	.footer-above-bar,
	.footer-below-bar {
		display: block;
	}
}

.footer-above-bar,
.footer-below-bar {
	padding: 1rem;
	text-align: center;
	font-size: 0.9rem;
	background-color: var(--color-card-bg);
	border-top: 1px solid var(--color-border);
	display: none; /* Hidden by default, shown with footer */
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* --- 13. Custom Tabs --- */
.sleekapp-tabs {
	margin-top: 2rem;
}

.tab-triggers {
	display: flex;
	border-bottom: 1px solid var(--color-border);
	margin-bottom: 1.5rem;
	gap: 1rem;
	max-width: 100%; /* This is the key fix */
	/* Make tab headers scrollable/swipeable */
	overflow-x: auto;
	white-space: nowrap;
	-webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
	/* Hide scrollbar for a cleaner look */
	-ms-overflow-style: none;  /* IE and Edge */
	scrollbar-width: none;  /* Firefox */
}

.tab-trigger {
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	padding: 0.75rem 1rem;
	cursor: pointer;
	font-size: 1rem;
	font-weight: 500;
	color: var(--color-tabs-inactive);
	opacity: 0.7;
	transition: all 0.2s ease-in-out;
	margin-bottom: -1px; /* Overlap the container's border */
}

.tab-triggers::-webkit-scrollbar {
	display: none; /* Chrome, Safari, and Opera */
}

.tab-trigger:hover {
	opacity: 1;
	background-color: var(--color-bg);
}

.tab-trigger.active {
	opacity: 1;
	border-bottom-color: var(--color-tabs-active);
	color: var(--color-tabs-active);
}

.tab-trigger .tab-icon {
	margin-right: 0.5em;
	opacity: 0.8;
	transition: opacity 0.2s ease-in-out;
}

.tab-panel {
	display: none;
	animation: fadeIn 0.3s ease-in-out;
}

.tab-panel.active {
	display: block;
}

@keyframes fadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes popIn {
	from {
		opacity: 0;
		transform: scale(0.95);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

/* --- 14. Custom Modals (Alert, Confirm, Prompt) --- */
.sleekapp-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.6);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 9999;
	padding: 1rem;
	animation: fadeIn 0.2s ease-in-out;
}

.sleekapp-modal-container {
	background-color: var(--color-card-bg);
	border-radius: var(--border-radius-card);
	box-shadow: var(--shadow-soft);
	width: 100%;
	max-width: 450px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.sleekapp-modal-header {
	padding: 1rem 1.5rem;
	border-bottom: 1px solid var(--color-border);
}

.sleekapp-modal-header h3 {
	margin: 0;
	font-size: 1.2rem;
	font-weight: 600;
	color: var(--color-text);
}

.sleekapp-modal-body {
	padding: 1.5rem;
	color: var(--color-text);
}

.sleekapp-modal-body p {
	margin: 0 0 1rem 0;
}

.sleekapp-modal-body p:last-child {
	margin-bottom: 0;
}

.sleekapp-modal-input {
	width: 100%;
	padding: 0.75rem;
	border: 1px solid var(--color-border);
	border-radius: 6px;
	background-color: var(--color-bg);
	color: var(--color-text);
	margin-top: 1rem;
}

.sleekapp-modal-footer {
	display: flex;
	justify-content: flex-end;
	gap: 0.75rem;
	padding: 1rem 1.5rem;
	background-color: var(--color-bg);
	border-top: 1px solid var(--color-border);
}

/* --- 15. Auth Pages (Login/Register) --- */
.auth-page-wrapper {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	background-color: var(--color-bg);
	padding: 2rem;
}

.auth-container {
	position: relative;
	width: 100%;
	max-width: 400px;
	text-align: center;
}

.auth-intro {
	position: fixed; /* Position relative to the viewport */
	top: 0;
	left: 0;
	z-index: 2;
	transition: opacity 0.5s ease, visibility 0.5s;
	width: 100vw; /* Full viewport width */
	height: 100vh; /* Full viewport height */
	border-radius: 0;
	overflow: hidden; /* Ensures the image stays within the rounded corners */
}

.auth-intro-gif {
	width: 100%;
	height: 100%;
	object-fit: cover; /* Prevents the GIF from being stretched or distorted */
}

.auth-form-container {
	position: relative; /* For positioning form wrappers */
	background-color: transparent; /* Initially transparent to not hide the GIF */
	padding: 2rem;
	border-radius: var(--border-radius-card);
	box-shadow: var(--shadow-soft);
	opacity: 0;
	transform: scale(0.95);
	transition: opacity 0.4s ease-out, transform 0.4s ease-out;
	transition-delay: 0.2s; /* Delay the form appearance */
	overflow: hidden; /* Hide overflowing form wrappers */
}

.auth-form-wrapper {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	padding: 0; /* Padding is now handled by the parent .auth-form-container */
	box-sizing: border-box;
	opacity: 0;
	transform: translateX(100%);
	transition: opacity 0.4s ease-out, transform 0.4s ease-out;
	transition-delay: 0.2s; /* Delay the form appearance */
}

/* State when form is active */
.auth-container.form-active .auth-intro {
	opacity: 0;
	visibility: hidden;
}

.auth-container.form-active .auth-form-container {
	opacity: 1;
	background-color: var(--color-card-bg); /* Fade in the background color with the form */
	transform: scale(1);
}

.auth-form-wrapper.is-active {
	position: relative; /* Take up space in the document flow */
	opacity: 1;
	transform: translateX(0);
}

/* Animation for forms sliding out */
.auth-form-wrapper.is-leaving {
	position: absolute;
	transform: translateX(-100%);
}

/* WordPress Login Form Styling */
#loginform, #sleekapp-register-form, #sleekapp-lostpassword-form {
	text-align: left;
}

.auth-branding {
	margin-bottom: 1.5rem;
	/* Animation setup */
	opacity: 0;
	transform: translateX(-30px);
	transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.auth-container.form-active .auth-branding {
	opacity: 1;
	transform: translateX(0);
}

.auth-branding .custom-logo {
	height: 45px;
	width: auto;
}

.auth-title {
	font-size: 1.5rem;
	margin-bottom: 1.5rem;
}

#loginform p, #sleekapp-register-form p, #sleekapp-lostpassword-form p {
	margin-bottom: 1rem;
}

#loginform label, #sleekapp-register-form label, #sleekapp-lostpassword-form label {
	display: block;
	font-weight: 500;
	margin-bottom: 0.5rem;
}

#loginform input[type="text"],
#loginform input[type="password"],
#sleekapp-register-form input[type="text"],
#sleekapp-register-form input[type="email"],
#sleekapp-lostpassword-form input[type="text"],
.auth-form-container .input /* Generic class for all auth inputs */ {
	width: 100%;
	padding: 0.75rem;
	border: 1px solid var(--color-border);
	border-radius: 6px;
	background-color: var(--color-bg);
	color: var(--color-text);
}

/* Ensure all inputs inside the auth container have the same style */
.auth-form-container input[type="text"],
.auth-form-container input[type="password"],
.auth-form-container input[type="email"] {
	/* This block can be left empty if the .input class is consistently used, or styles can be duplicated here for robustness. */
}
#loginform .forgetmenot {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

#loginform .forgetmenot label {
	margin-bottom: 0;
	font-weight: 400;
}

#loginform .submit .button,
#sleekapp-register-form .submit .button,
#sleekapp-lostpassword-form .submit .button {
	width: 100%;
	padding: 0.8rem;
	font-size: 1rem;
}

.auth-links {
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	margin-top: 1.5rem;
	font-size: 0.9rem;
}

.auth-message {
	margin-top: 1rem;
	font-size: 0.9rem;
	color: var(--color-accent);
}

/* --- 12. Comments --- */
.comments-area {
	margin-top: 2rem;
	padding-top: 2rem;
	border-top: 1px solid var(--color-border);
}

.comments-title,
.comment-reply-title {
	font-size: 1.5rem;
	margin-bottom: 1.5rem;
}

.comment-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.comment-list .comment {
	margin-bottom: 1.5rem;
}

.comment-body {
	padding: 1.5rem;
	background-color: var(--color-card-bg);
	border: 1px solid var(--color-border);
	border-radius: 8px;
}

.comment-meta {
	margin-bottom: 1rem;
	display: flex;
	align-items: center;
	gap: 1rem;
}

.comment-author .avatar {
	border-radius: 50%;
}

.comment-author .fn {
	font-weight: 600;
	font-style: normal;
}

.comment-metadata a {
	font-size: 0.85rem;
	color: var(--color-text);
	opacity: 0.7;
}

.comment-form p {
	margin-bottom: 1rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 0.75rem;
	border: 1px solid var(--color-border);
	border-radius: 6px;
	background-color: var(--color-bg);
	color: var(--color-text);
}

/* --- 16. Back to Top Button --- */
.back-to-top-button {
	position: fixed;
	bottom: 20px;
	right: 20px;
	width: 44px;
	height: 44px;
	background-color: var(--color-accent);
	color: #fff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: var(--shadow-soft);
	z-index: 999;
	opacity: 0;
	transform: translateY(20px);
	pointer-events: none;
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.back-to-top-button.is-visible {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}