/* General Styles */
html { 
	overflow-x: hidden;
	width: 100%; 
}

body {
	overflow-x: hidden;
	width: 100%;
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	line-height: 1.6;
	margin: 0;
	padding: 50px 0px 0px 0px;
	color: #333;
	background-color: #e0f7f4;
	min-height: 100vh;
	display: flex;
	flex-direction: column; /* Make body a flex container */
}

/* Main Content */
.main-content {
    grid-column: 2;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    box-sizing: border-box;
    padding: 10px;
    overflow-x: hidden;
}

:root {
	--z-nav: 100;
	--z-dropdown: 200;
	--z-modal: 300;
}

/* Navigation Bar Styling */
nav {
	background-color: #3faea0;
	color: #ffffff;
	border-bottom: 4px solid #ffffff;
	padding: 5px 10px;
	position: fixed; 
	top: 0;
	left: 0;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 40px;
	z-index: var(--z-nav);
}

.menu {
	display: flex;
	align-items: center;
	padding: 0 15px;
}

/* Menu Icon (Hamburger) */
.menu-icon {
	display: none; 
	font-size: 24px;
	padding: 20px;
	cursor: pointer;
	position: absolute;
	left: 25px; 
	top: 50%;
	transform: translateY(-50%);
	color: white;
}

/* Show menu icon at 1057px */
@media (max-width: 1057px) {
	.menu-icon {
		display: block !important;
	}
	
	/* Hide the main navigation menu */
	nav ul {
		display: none; 
	}
	
	/* Keep Bookstore button visible */
	.buy-books-link {
		display: flex !important;
	}
}

/* Buy Book */
.buy-books-link {
    display: flex;
    align-items: center;
    position: static;  /* Back to static */
    flex-shrink: 0;    /* Prevent shrinking */
    order: 999;        /* Put it at the end */
}

.buy-books-link .cta-button {
    background-color: #FF9900;
    color: white !important;
	padding: 10px 12px;
    border: 0px solid transparent;	
    transition: background-color 0.2s ease;
	margin-right: 40px; 
	font-size: 16px;
    white-space: nowrap; /* Prevent text wrapping */
}

.buy-books-link .cta-button:hover {
    background-color: #CC7A00;
    border: 0px solid #CC7A00;
}

/* Navigation Menu */
nav ul {
	background-color: #3faea0;
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: nowrap;
}

/* Menu Items */
nav ul li {
	display: flex;
	align-items: center;
	height: 40px; /* Match navbar height */
}

nav ul li a {
	display: block;
	color: #ffffff;
	text-align: center;
	padding: 10px 12px;
	text-decoration: none;
	background-color: #3faea0;
	font-size: 16px;
}

.dropdown-menu a {
    font-style: italic;
}

/* Hover Effect */
nav ul li a:hover {
	background-color: #5fc1b0;
	color: #ffffff;
}

nav ul li a.active {
	background-color: #7fd3c0; /* Highlight color */
	 /* Text color */
}

/* Dropdown Menu Styles */
.dropdown {
	position: relative;
}

.dropdown-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	background-color: #3faea0;
	min-width: 200px;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
	z-index: var(--z-dropdown);
	border-radius: 0 0 5px 5px;
}

.dropdown-menu li {
	width: 100%;
}

.dropdown-menu a {
	padding: 10px 15px;
	width: 100%;
	box-sizing: border-box;
	text-align: left;
}

.dropdown:hover .dropdown-menu {
	display: block;
}

.cta-button {
    background-color: #3faea0;
    color: #FFF000 !important;
    padding: 10px 12px;
    border: 0px solid transparent;	
    transition: background-color 0.2s ease;
    font-size: 16px;
}

.cta-button:hover {
    background-color: #5fc1b0;
    border: 0px solid #5fc1b0;
}

nav ul li a.cta-color {
    color: #FFF000 !important;  
}

nav ul li a.cta-color:hover,
nav ul li a.cta-color.active {
    color: #FFF000 !important;
    background-color: #5fc1b0;
}

/* Navigation Tabs */
.nav-tabs {
	display: flex;
	gap: 10px;
	margin-bottom: 20px;
	flex-wrap: wrap;
	justify-content: center;
}

.tab-button {
	padding: 10px 20px;
	background: #1e8e7a;
	border: none;
	border-radius: 5px;
	cursor: pointer;
	color: white;
	transition: background 0.3s;
}

.tab-button:hover {
	background: #17a589;
}

.tab-button.active {
	background: #20c997;
}

/* Content Sections */
.content-section {
	display: none;
	animation: fadeIn 0.5s;
	background: white;
	padding: 30px 30px 20px 30px ;
	border-radius: 10px;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
	margin: 0 auto;
	width: 100%;
	box-sizing: border-box;
}

.content-section.active {
	display: block;
}

/* Animation */
@keyframes fadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

/* Typography */
h1, h2, h3, h4 {
	color: #116466;
}

.underlined {
	border-bottom: 2px solid #1a4157;
}

/* Main Content Container */
#mainContent {
	display: flex;
	flex-direction: column;
	width: 100%;
}

/* Book Showcase */
.book-showcase {
	display: flex;
	gap: 30px;
	margin: 30px 0;
	padding: 30px;
	background: white;
	border-radius: 10px;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
	align-items: center;
	flex-wrap: wrap;
	width: 100%;
	box-sizing: border-box;
}

.book-info {
	flex: 1;
	min-width: 280px;
}

.book-title {
	font-size: 1.5em;
	margin: 0 0 10px 0;
	color: #116466;
}

.book-meta {
	color: #666;
	font-size: 0.9em;
	margin-bottom: 15px;
	display: flex;
	font-weight: 600;
    justify-content: space-between;
}

.book-description {
	line-height: 1.6;
}

/* Volume Info Styles */
.volume-info {
	margin-top: 15px;
	padding-top: 15px;
	border-top: 1px solid #ddd;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.volume-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.volume-item p {
	margin: 0;
	flex: 1;
}

.volume-item a.amazon-btn {
	padding: 10px 20px;
	background: #ff9900;
	color: white;
	border: none;
	border-radius: 5px;
	cursor: pointer;
	font-size: 0.9rem; /* Match the font-size of the menu buttons */
	transition: background 0.3s, transform 0.2s;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1; /* Ensure the button height is not affected by line-height */
}

.volume-item a.amazon-btn:hover {
	background: #cc7a00;
}

.volume-item a.amazon-btn:active {
	transform: scale(0.95);
}

/* Amazon Button Tooltip Styles */
.amazon-btn {
	position: relative;
}

.amazon-btn:hover::after {
	content: attr(data-tooltip);
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	padding: 8px 12px;
	background-color: #e0f7f4; /* Pale teal background */
	color: #116466; /* Darker teal text for better contrast */
	border-radius: 4px;
	font-size: 0.75rem;
	white-space: normal;
	z-index: 1000;
	width: max-content;
	max-width: 130px;
	margin-bottom: 8px;
	box-shadow: 0 2px 8px rgba(30, 142, 122, 0.3);
	line-height: 1.4;
	border: 2px solid #1e8e7a; /* Darker teal border */
}

/* Amazon Button Tooltip Arrow Styles */
.amazon-btn:hover::before {
	content: '';
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: #1e8e7a; /* Match the border color */
	margin-bottom: -2px;
	z-index: 1000;
}

@keyframes tooltipFadeIn {
	from {
		opacity: 0;
		transform: translate(-50%, 5px);
	}
	to {
		opacity: 1;
		transform: translate(-50%, 0);
	}
}

/* Footer Styles */
.footer {
    background-color: #f8f9fa;
    padding: 1rem 0; 
    margin-top: 2rem; 
}

.copyright {
    text-align: center;
    color: #666; 
    margin: 0; 
	font-size: 0.9rem;
}

.copyright {
	text-align: center;
	color: #666;
}

.copyright p {
    margin: 0.25rem 0;
}

.badge {
	display:inline-flex; 
	align-items:center; 
	margin-top: 0.5rem;
	padding:0.25rem 0.5rem;
	font-size:0.75rem;
	font-weight:500;
	color:#047857;
	background-color:#d1fae5;
	border-radius:9999px;
}

.indented {
	margin-left: 20px; /* Indents the whole paragraph */
}

/* Floating Share Button */
.floating-share-btn {
	position: fixed;
	bottom: 20px;
	right: 20px;
	background: rgba(0, 119, 181, 0.8);
	color: white;
	border: none;
	padding: 12px 18px;
	font-size: 16px;
	border-radius: 50px;
	cursor: pointer;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
	transition: transform 0.3s ease;
	z-index: 1000; /* Added z-index */
}

.floating-share-btn:hover {
	transform: scale(1.1);
}

/* Modal Background */
.modal-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 1001; /* Added z-index */
}

/* Share Modal */
.share-modal {
	display: none;
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(255, 255, 255, 0.95);
	padding: 15px 20px 40px 20px;
	border-radius: 12px;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
	width: 300px;
	text-align: center;
	z-index: 1002; /* Added z-index */
}

/* Icons */
.share-modal a {
	display: inline-block; /* Changed from inline-flex */
	margin: 10px;
	padding: 10px;
	font-size: 1.5rem;
	color: #333;
	text-decoration: none;
	transition: transform 0.3s ease;
}

.share-modal a:hover {
	transform: scale(1.2);
}

.share-modal a .fab.fa-facebook { 
	color: #1877F2;
}

.share-modal a .fab.fa-linkedin {
	color: #0077B5; 
}

.share-modal a .fab.fa-x-twitter {
	color: #000000;
}

.share-modal a .fas.fa-envelope {
	color: #D44638;
}

/* QR */
#qrDisplay {
  margin: 0.5rem 0 1.5rem 0;
  text-align: center;
}

#qrImage {
  display: none; 
  width: 150px;
  height: 150px;
}

/* Close Button */
.close-btn {
	background: #6BC4C4;
	color: white;
	border: none;
	padding: 12px 18px;
	font-size: 16px;
	border-radius: 50px;
	cursor: pointer;
	margin-top: 15px 0;
	transition: background 0.3s ease;
	width: 100px;
}

.close-btn:hover {
	background: #5AB3B3;
}

.hkcc a {
    color: #0077b5;
    text-decoration: none; /* Removes default underline */
}

.hkcc a:hover {
    text-decoration: underline; /* Adds underline on hover */
}		

@media (max-width: 1057px) {		
	html { 
		overflow-x: hidden;
		width: 100%; 
	}
	
	body {
		overflow-x: hidden;
		width: 100%;
	}

	.menu-icon {
		display: block;
		position: absolute;
		left: 15px;
		top: 50%;
		transform: translateY(-50%);
		z-index: 999;
		padding: 10px;
		font-size: 24px;
		color: white;
		cursor: pointer;
	}

	#menu {
		display: none;
		position: absolute;
		top: 40px;
		left: 0;
		width: 200px;
		background-color: white;
		border: 1px solid #3faea0;
		border-radius: 0 0 4px 4px;
		z-index: 1000;
		padding: 0;
	}

	.menu-item {
		width: 100%;
		padding: 10px;
		border-bottom: 1px solid #ccc;
	}

	#menu.show {
		display: block;
	}
	
	#menu li {
		padding: 1px 0;
		border-bottom: 1px solid #e2e8f0;
	}

	/* Adjusted Menu Items */
	nav {
		width: 100%;
		padding-right: 30px;
		margin: 0;
	}

	nav ul {
		flex-direction: column;
		width: 100%;
		background-color: white;
		margin: 0;
		padding: 0;
		display: none;
		position: absolute;
		top: 40px;
		left: 0;
		z-index: 1000;
	}

	nav ul.show {
		display: flex;
	}

	nav ul li {
		width: 100%;
		height: auto;
		border-bottom: 1px solid #e0e0e0;
		margin: 0;
		padding: 0;
	}

	nav ul li:last-child {
		border-bottom: none;
	}

	nav ul li a, 
	.dropdown-trigger, 
	nav ul li .dropdown-trigger {
		width: 100%;
		color: #3faea0;
		background-color: #ffffff;
		font-size: 14px;
		display: block;
		box-sizing: border-box;
		text-align: center; 
		padding: 12px 16px; 
		line-height: 1.5; 
	}

	.buy-books-link {
		display: flex;
		justify-content: flex-end;
		align-items: center;
		width: 100%;
		margin-right: 0;
		box-sizing: border-box;
		background-color: #3faea0; 
		border-bottom: 1px solid #ffffff;
		position: static;
	}

	.buy-books-link .cta-button {
		background-color: #3faea0 !important;
		color: #FFF000 !important;
		margin-right: 20px;
		font-weight: normal !important;
		font-size: 18px !important;
	}

	.buy-books-link .cta-button:hover {
		background-color: #5fc1b0 !important;
		color: #FFF000 !important;
		font-weight: normal !important;
		font-size: 18px !important;
	}
	  
	nav li {
		width: 100%;
		text-align: center;
		padding: 10px;
		border-bottom: 1px solid #ccc;
	}

	nav li a {
		width: 100%;
		padding: 10px;
		text-align: center;
	}

	/* Hover Effect */
	nav li a:hover {
		background-color: #6ad7c2 !important;
		color: #ffffff !important;
		transition: 0.3s ease-in-out;
	}

	/* Remove border from the last item */
	nav li:last-child {
		border-bottom: none;
	}

    /* Remove left padding from nav so border extends to edge - Start */
    nav {
        padding-left: 0 !important;
    }
    
    /* Add the padding back to the menu icon and menu items */
    .menu-icon {
        margin-left: 5px;
    }
    
    nav ul {
        padding-left: 5px;
    }
    
    /* If you have any other direct children of nav, add padding to them too */
    nav > * {
        padding-left: 5px;
    }
    /* Remove left padding from nav so border extends to edge - End */

	/* Ensure dropdown menu items are visible */
	.dropdown-menu {
		display: none;
		width: 100%;
		background-color: #f5f5f5;
		border: none;
		margin: 0;
		padding: 0;
	}

	.dropdown-menu.show {
		display: block;
	}

	.dropdown-menu li {
		border-bottom: 1px solid #e0e0e0;
	}

	.dropdown-menu li a {
		padding-left: 32px;
		background-color: #f5f5f5;
		font-size: 13px; 
		color: #3faea0; 
	}		

	.dropdown-menu li:last-child {
		border-bottom: none;
	}			

	.dropdown {
		position: relative;
		z-index: 1001;
	}
			
	.dropdown > a {
		color: #3faea0 !important;
		background-color: #ffffff !important;
	}
	
	.dropdown-menu.show {
		display: block;
	}
	
	.dropdown-trigger {
		display: flex !important;
		justify-content: center;
		align-items: center;
		width: 100%;
		text-align: center;
		padding: 10px 0;
	}

	.dropdown-trigger::after {
		content: '▾';
		margin-left: 5px;
		float: right;
	}
			
	nav ul li a:hover,
	nav ul li a.active,
	nav ul li .dropdown-trigger:hover,
	nav ul li .dropdown-trigger.active,
	.dropdown-menu li a:hover,
	.dropdown-menu li a.active {
		background-color: #3faea0;
		color: #ffffff;
	}
}

@media (max-width: 786px) {	
	.buy-books-link {
		display: flex;
		justify-content: flex-end;
		align-items: center;
		width: 100%;
		padding: 5px 15px 0 15px;
		margin-right: 0;
		box-sizing: border-box;
		background-color: #3faea0; 
		border-bottom: 1px solid #ffffff;
	  }

	  .buy-books-link a.cta-button {
		font-size: 18px;
		font-weight: 600;
		padding: 8px 12px;
		margin-right: 10px; 
		background-color: #3faea0;
		color: #FFF000 !important;
		text-align: center;
		width: auto;
		border: none;
	  }
	  
	  	
	nav ul li a.cta-color,
    nav ul li a.cta-color.active {
        color: #FF9900 !important;
        background-color: #ffffff;
    }
    
    nav ul li a.cta-color:hover {
        background-color: #6ad7c2 !important;
        color: #FFF000 !important;
    }
}

/* Form Groups and Fields */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #2C8B80;
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 139, 128, 0.1);
}

/* Submit Button */
.submit-btn {
    background-color: #2C8B80;
    color: white;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    margin-top: 1.5rem;
    transition: background-color 0.2s;
}

.submit-btn:hover {
    background-color: #236e65;
}

.submit-btn:disabled {
    background-color: #cbd5e1;
    cursor: not-allowed;
}

/* Email Validation Styles */
.email-group {
    display: grid;
    gap: 15px;
}

.email-mismatch {
    color: #dc2626;
    font-size: 0.9em;
    display: none;
}

input.error {
    border-color: #dc2626;
    background-color: #fff5f5;
}

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
}

/* Form Container */
.form-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    animation: floatIn 0.5s ease-out;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.form-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.15);
}

.social-icons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.social-icons a {
  font-size: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.social-icons a:hover {
  transform: scale(1.2);
}


/* Responsive Adjustments */
@media (max-width: 640px) {
    .modal-content {
        margin: 1rem;
        padding: 1.5rem;;
        width: 95%;
    }

    .form-group {
        margin-bottom: 15px;
    }
}

/* Cookies */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    z-index: 1000;
    border-top: 1px solid #eee;
    display: none;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cookie-content p {
    margin: 0;
    line-height: 1.5;
}

.cookie-types {
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cookie-type {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.cookie-type label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cookie-type label span {
    font-size: 0.875rem;
    color: #666;
}

.cookie-type input[type="checkbox"] {
    margin-top: 0.25rem;
}

.cookie-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.cookie-button {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.cookie-button.accept {
    background-color: #4CAF50;
    color: white;
}

.cookie-button.accept:hover {
    background-color: #45a049;
}

.cookie-button.decline {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.cookie-button.decline:hover {
    background-color: #e8e8e8;
}

.cookie-link {
    color: #2196F3;
    text-decoration: underline;
}

.cookie-preferences-btn {
    padding: 0.5rem 1rem;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.3s ease;
}

.cookie-preferences-btn:hover {
    background-color: #e8e8e8;
}

@media (max-width: 920px) {
    .cookie-content {
        text-align: center;
    }
    
    .cookie-buttons {
        flex-direction: column;
    }
    
    .cookie-button {
        width: 100%;
    }
}

/* Flooting growth notice */
.floating-notice {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 1rem;
    max-width: 24rem;
    width: 90%; 
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 1;
    transition: all 0.3s ease-in-out;
    z-index: 1000;
}

.floating-notice.hiding {
    opacity: 0;
    transform: translate(-50%, -40%); 
}

.notice-content {
    display: flex;
    align-items: center;
    justify-content: center; 
    gap: 1rem;
    position: relative;
}

.notice-text {
    font-size: 1rem;
    color: black;
    text-align: center; 
    line-height: 1.5;
    margin: 0; 
}

.notice-close {
    position: absolute; 
    right: -0.5rem; 
    top: -0.5rem; 
    background: none;
    border: none;
    color: #718096;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.25rem;
    transition: color 0.2s;
}

.notice-close:hover {
    color: #4a5568;
}

.notice-footer {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    color: #3182ce;
}

.pulse-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: currentColor;
    border-radius: 50%;
    margin-right: 0.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

/* Add backdrop overlay */
.notice-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
    z-index: 999;
}

.notice-backdrop.hiding {
    opacity: 0;
}