/* =========================================
   1. GLOBAL LAYOUT & BACKGROUND
   ========================================= */
* {
	-ms-overflow-style: none !important;
	scrollbar-width: none !important;
	box-sizing: border-box;
}

*::-webkit-scrollbar {
	display: none !important;
}

html {
	scroll-behavior: smooth;
	scroll-snap-type: y mandatory; /* Ensure this is 'mandatory' */
}

body {
	margin: 0;
	padding: 0;
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	background-color: #f8f9fa;
	background-image: url("images/world_img.png");
	background-repeat: no-repeat;
	background-position: center center;
	background-attachment: scroll;
	background-size: cover;
	overflow-x: hidden;
	width: 100%;
}

/* =========================================
   2. VIEWPORT STRUCTURE
   ========================================= */

/* Default behavior for the Home Page */
.hero-viewport,
.content-viewport {
	height: 100vh;
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	position: relative;
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

/* OVERRIDE: Behavior for Country/Continent Pages */
.standard-page .hero-viewport,
.standard-page .content-viewport {
	height: auto; /* Let it grow as long as the content is */
	min-height: 100vh;
	scroll-snap-align: none; /* Disable the magnetic snap */
	padding-bottom: 50px; /* Space so it doesn't hit the footer */
}

/* Global snap disable for standard pages */
.standard-page {
	scroll-snap-type: none !important;
}

.hero-viewport {
	justify-content: center;
}

.content-viewport {
	padding-top: 20px;
}
/* =========================================
   3. HEADER & RAINBOW BRANDING
   ========================================= */
.main-header {
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.rainbow-text {
	font-size: clamp(2.2rem, 8vw, 4rem);
	font-weight: 900;
	margin: 0;
	background: linear-gradient(
		to right,
		#e40303,
		#ff8c00,
		#ffeb3b,
		#008026,
		#24408e,
		#732982,
		#e40303
	);
	background-size: 200% auto;
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	animation: rainbow-flow 8s linear infinite;
}

@keyframes rainbow-flow {
	from {
		background-position: 0% center;
	}
	to {
		background-position: 200% center;
	}
}

.subtitle-group {
	display: inline-block;
	text-align: center;
	margin: 0 auto 20px auto;
}

.rainbow-line {
	height: 4px;
	width: 100%;
	margin-top: 8px;
	border-radius: 10px;
	background: linear-gradient(
		90deg,
		#ff0000,
		#ff8000,
		#ffff00,
		#00ff00,
		#0000ff,
		#4b0082,
		#9400d3
	);
}

/* =========================================
   4. SEARCH & SCROLL HINTS
   ========================================= */
.landing-search-wrap {
	margin: 15px auto;
	width: 90%;
	max-width: 500px;
}

.landing-search-wrap input {
	width: 100%;
	padding: 14px 25px;
	border-radius: 50px;
	border: 2px solid #24408e;
	font-size: 1rem;
	background: rgba(255, 255, 255, 0.95);
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
	outline: none;
}

.dev-notice {
	margin-top: 15px;
	padding: 8px 20px;
	background: rgba(255, 255, 255, 0.25);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: 1px solid rgba(36, 64, 142, 0.3);
	border-radius: 50px;
	color: #24408e;
	font-size: 0.85rem;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	gap: 12px;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* The Red Live Pulse Dot */
.pulse-dot {
	width: 10px;
	height: 10px;
	background-color: #e40303; /* Matches your exit button red */
	border-radius: 50%;
	position: relative;
}

.pulse-dot::after {
	content: "";
	position: absolute;
	width: 100%;
	height: 100%;
	background-color: inherit;
	border-radius: 50%;
	/* Keep the ring red too */
	animation: pulse-ring 2s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}

@keyframes pulse-ring {
	0% {
		transform: scale(0.7);
		opacity: 0.8;
	}
	50% {
		opacity: 0.5; /* Smoother transition */
	}
	100% {
		transform: scale(2); /* Reduced from 3 to stop it hitting the chevron */
		opacity: 0;
	}
}
/* =========================================
   5. U=U BANNER (Restored and Fixed)
   ========================================= */
.u-u-link {
	text-decoration: none;
	display: flex;
	justify-content: center;
	width: 100%;
	margin-bottom: auto; /* Pushes everything below it (the cards) toward the center */
}

#u-u-notice {
	width: 90%;
	max-width: 900px;
	background-color: #f0f7ff;
	border: 1px solid #bcdffb;
	border-left: 6px solid #24408e;
	border-radius: 10px;
	padding: 12px 20px;
	text-align: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#u-u-notice h4 {
	font-size: 13px;
	margin: 0 0 4px 0;
	color: #24408e;
}
#u-u-notice p {
	font-size: 12px;
	margin: 0;
	color: #2c3e50;
	line-height: 1.4;
}

/* =========================================
   6. NAVIGATION GRIDS (Bento)
   ========================================= */
.bento-grid {
	display: grid;
	gap: 15px;
	width: 100%;
	max-width: 900px;
	grid-template-columns: repeat(3, 1fr); /* 3 columns on PC */
	margin: 0 auto; /* Keeps it horizontally centered */
}

.bento-card {
	background: rgba(255, 255, 255, 0.15);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 12px;
	padding: 25px 15px;
	text-align: center;
	text-decoration: none;
	color: #1a2b3c;
	font-weight: 700;
}

/* =========================================
   7. FOOTER & DOCK (Restored Logic)
   ========================================= */
.bottom-dock {
	position: relative;
	width: 100%;
	margin-top: auto; /* Pushes itself to the bottom, and everything above it toward the center */
	display: flex;
	flex-direction: column;
	align-items: center;
}

.bottom-nav {
	background: rgb(240, 247, 255);
	width: 100%;
	display: flex;
	justify-content: space-around;
	padding: 15px 10px;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.bottom-nav a {
	text-decoration: none;
	color: #24408e;
	font-size: 0.75rem;
	font-weight: 800;
	text-transform: uppercase;
}

.exit-btn {
	position: fixed; /* Keeps it visible regardless of scroll */
	top: 50%;
	right: 30px;
	padding: 12px 24px;
	background: rgba(
		228,
		3,
		3,
		0.9
	); /* Strong brand red with slight transparency */
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	color: white;
	text-decoration: none;
	font-size: 0.75rem;
	font-weight: 900;
	letter-spacing: 1.5px;
	border-radius: 50px; /* Modern pill shape */
	border: 1px solid rgba(255, 255, 255, 0.3);
	box-shadow: 0 8px 20px rgba(228, 3, 3, 0.4);
	z-index: 99999; /* Ensure it stays above everything */
	transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.exit-btn:hover {
	background: #e40303; /* Solid red on hover */
	transform: scale(1.05); /* Slight "pop" effect */
	box-shadow: 0 12px 25px rgba(228, 3, 3, 0.6);
}

/* Hide the back button in the bottom dock if on the landing page logic */
/* 1. Hide the back button by default (Home Page) */
.nav-back {
	display: none;
}

/* 2. Show the back button if we are on a 'standard-page' */
.standard-page .nav-back {
	display: inline-block;
}
/* Ensure the footer stays at the very bottom on scrolling pages */
.standard-page {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.standard-page .bottom-dock {
	margin-top: auto; /* Pushes the footer to the bottom of the page height */
	position: relative; /* Keeps it in the flow so it doesn't overlap text */
}

/* --- UNIVERSAL NAV CONTROLS --- */

.back-hint-wrap {
	position: fixed;
	top: 50%;
	left: 15px;
	transform: translateY(-50%);
	z-index: 10000;
	padding: 25px;
	cursor: pointer;
	outline: none;
	-webkit-tap-highlight-color: transparent;
}

.back-hint-wrap .chevron-shape {
	transform: rotate(135deg) !important;
	border-color: #ffffff !important;
	filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.4))
		drop-shadow(0 0 10px rgba(0, 0, 0, 0.2));
}

.back-hint-wrap:hover .chevron-shape {
	transform: rotate(135deg) scale(1.1) !important;
}

/* The Back Button Circle */
.fixed-back-chevron {
	position: fixed;
	bottom: 20px;
	left: 20px;
	z-index: 2000;
	background-color: #2c3e50; /* Your map-style dark color */
	width: 50px;
	height: 50px;
	border-radius: 50%;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* The Thick Chevron Shape */
.chevron-shape {
	display: inline-block;
	border-right: 8px solid white; /* Increased from 6px */
	border-bottom: 8px solid white; /* Increased from 6px */
	width: 22px; /* Slightly larger */
	height: 22px; /* Slightly larger */
	border-radius: 4px; /* More rounded corner */
	transition: all 0.2s ease;
}

/* Orientation for Back (Country Pages) */
.chevron-left {
	transform: rotate(135deg);
	margin-left: 6px;
}

/* Orientation for Scroll (Home Page) */
.chevron-down {
	transform: rotate(45deg);
	margin-top: 10px; /* Changed from -5px to sit better in the circle */
}

/* 1. The Section */
.hero-viewport {
	position: relative;
	height: 100vh;
	width: 100%;
	overflow: visible;
}

/* 2. The Container - Added 'outline: none' to kill the diamond flash */
.scroll-hint {
	position: absolute;
	bottom: 5vh;
	left: 50%;
	transform: translateX(-50%);
	cursor: pointer;
	z-index: 9999;

	/* Shield against background noise */
	background: rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
	padding: 20px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	filter: drop-shadow(0 0 15px rgba(0, 0, 0, 0.3));

	/* SOURCE FIX: Removes the flashing diamond on click */
	outline: none;
	-webkit-tap-highlight-color: transparent;
}

/* 3. The Shape - THE CLEANEST SOURCE FIX */
.hero-viewport .scroll-hint .chevron-shape {
	display: inline-block;
	width: 30px;
	height: 30px;

	/* Create the V using borders */
	border-right: 8px solid #ffffff;
	border-bottom: 8px solid #ffffff;
	border-radius: 4px;

	/* Rotate it */
	transform: rotate(45deg);

	/* THE MAGIC: This cuts off the top-left half of the box 
       so those phantom lines CANNOT flash. */
	clip-path: polygon(0% 100%, 100% 100%, 100% 0%, 40% 0%, 0% 60%);

	/* Hardware acceleration to keep it smooth */
	-webkit-font-smoothing: antialiased;
	pointer-events: none;
}

/* =========================================
   8. MOBILE RESPONSIVE
   ========================================= */
@media (max-width: 800px) {
	.bento-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.bento-grid {
		grid-template-columns: 1fr;
		width: 90%;
	}
	.hero-viewport {
		height: 100vh;
	}
}
/* BRIDGE: Apply Bento styles to Country List containers */
.list-container {
	display: grid;
	gap: 15px;
	width: 90%;
	max-width: 900px;
	grid-template-columns: repeat(3, 1fr); /* 3 columns on PC */
	margin: 20px auto;
	padding-bottom: 120px; /* Room for the footer/exit button */
}

/* Ensure the dynamically generated country links look like Bento Cards */
.list-container a,
.country-card {
	background: rgba(255, 255, 255, 0.15);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 12px;
	padding: 25px 15px;
	text-align: center;
	text-decoration: none;
	color: #1a2b3c;
	font-weight: 700;
	transition: transform 0.2s ease;
}

.list-container a:hover {
	transform: translateY(-5px);
	background: rgba(255, 255, 255, 0.25);
}

/* Mobile Responsive for Country Lists */
@media (max-width: 800px) {
	.list-container {
		grid-template-columns: repeat(2, 1fr);
	}
}
@media (max-width: 600px) {
	.list-container {
		grid-template-columns: 1fr;
	}
}
/* =========================================
   COUNTRY DETAIL PAGE STYLES (country.html)
   ========================================= */

/* Refined Standard Page Layout */
.standard-page {
	display: flex;
	flex-direction: column;
	/* height: auto is key here to prevent the 'hidden' overflow */
	height: auto !important;
	min-height: 100vh;
}

.country-detail-container {
	width: 90%;
	max-width: 800px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	/* Subtract the approximate height of your bottom-nav (70px) */
	min-height: calc(100vh - 70px);
	/* Reduce this padding so it doesn't push the footer away */
	padding-bottom: 60px;
	flex: 1 0 auto; /* This tells the container to grow, but not shrink */
}

.standard-page .bottom-dock {
	margin-top: auto;
	width: 100%;
	flex-shrink: 0; /* Prevents the footer from getting squashed */
}

.header-section {
	text-align: center;
	padding: 60px 20px 20px;
}

/* Status Badge Styling */
.status-badge {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	background: rgba(255, 255, 255, 0.2);
	padding: 8px 20px;
	border-radius: 50px;
	border: 1px solid rgba(255, 255, 255, 0.3);
	backdrop-filter: blur(10px);
	margin-top: 10px;
	font-weight: 800;
	font-size: 0.8rem;
	color: #24408e;
}

/* The Safety Dot Colors */
.status-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
}
.status-dot.safe {
	background-color: #008026;
	box-shadow: 0 0 10px #008026;
}
.status-dot.warning {
	background-color: #ff8c00;
	box-shadow: 0 0 10px #ff8c00;
}
.status-dot.danger {
	background-color: #e40303;
	box-shadow: 0 0 10px #e40303;
}

/* Quick Nav Buttons */
.country-quick-nav {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: center;
	margin: 20px 0;
}

.glass-btn {
	text-decoration: none;
	color: #24408e;
	background: rgba(255, 255, 255, 0.3);
	padding: 8px 16px;
	border-radius: 8px;
	font-size: 0.85rem;
	font-weight: 700;
	border: 1px solid rgba(255, 255, 255, 0.2);
	transition: 0.3s;
}

.glass-btn:hover {
	background: rgba(255, 255, 255, 0.5);
}

/* The Dynamic Info Cards */
.glass-card {
	background: rgba(255, 255, 255, 0.15);
	backdrop-filter: blur(15px);
	-webkit-backdrop-filter: blur(15px);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 15px;
	padding: 25px;
	margin-bottom: 20px;
	width: 100%;
	color: #1a2b3c;
}

.glass-card h3 {
	margin-top: 0;
	color: #24408e;
	border-bottom: 1px solid rgba(36, 64, 142, 0.1);
	padding-bottom: 10px;
}

@media (max-width: 480px) {
	/* Ensure both viewports are strictly 100% of the screen height */
	.hero-viewport,
	.content-viewport {
		height: 100dvh !important; /* 'dvh' is better for mobile browsers with toolbars */
		justify-content: flex-start !important; /* Force content to the top */
		padding-top: 10px !important;
		overflow: hidden;
	}

	/* Target the specific map containers */
	.map-container,
	#map-hero,
	#map-content {
		position: absolute;
		top: 0;
		left: 0;
		width: 100% !important;
		height: 100% !important;
		z-index: 1; /* Keep it behind your text/buttons */
	}

	/* Make sure your header and search sit ON TOP of the map */
	.main-header,
	.landing-search-wrap {
		position: relative;
		z-index: 10;
		margin-top: 20px;
	}
}
