
/* Notification Styles */
.notification {
	position: fixed;
	bottom: 80px;
	right: 20px;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 24px;
	border-radius: 12px;
	font-size: 0.95rem;
	font-weight: 500;
	z-index: 999999;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	transform: translateX(120%);
	opacity: 0;
	transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.notification-show {
	transform: translateX(0);
	opacity: 1;
}

.notification-hide {
	transform: translateX(120%);
	opacity: 0;
}

.notification-icon {
	font-size: 1.3rem;
}

.notification-message {
	color: white;
}

.notification-info {
	background: linear-gradient(135deg, rgba(52, 152, 219, 0.95), rgba(41, 128, 185, 0.95));
	border: 1px solid rgba(52, 152, 219, 0.3);
}

.notification-success {
	background: linear-gradient(135deg, rgba(39, 174, 96, 0.95), rgba(46, 204, 113, 0.95));
	border: 1px solid rgba(39, 174, 96, 0.3);
}

.notification-warning {
	background: linear-gradient(135deg, rgba(243, 156, 18, 0.95), rgba(230, 126, 34, 0.95));
	border: 1px solid rgba(243, 156, 18, 0.3);
}

.notification-error {
	background: linear-gradient(135deg, rgba(231, 76, 60, 0.95), rgba(192, 57, 43, 0.95));
	border: 1px solid rgba(231, 76, 60, 0.3);
}

@media (max-width: 480px) {
	.notification {
		right: 10px;
		left: 10px;
		bottom: 70px;
		justify-content: center;
	}
}

/**
 * Daxi Speed Test - Stylesheet
 * @version 3.0.0
 * Modern, beautiful design with glassmorphism effects
 */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* CSS Variables */
:root {
	--primary-color: #6366f1;
	--primary-light: #818cf8;
	--primary-dark: #4f46e5;
	--accent-color: #06b6d4;
	--success-color: #10b981;
	--warning-color: #f59e0b;
	--danger-color: #ef4444;
	--text-color: #1e293b;
	--text-muted: #64748b;
	--bg-color: #f8fafc;
	--bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	--card-bg: rgba(255, 255, 255, 0.8);
	--card-border: rgba(255, 255, 255, 0.3);
	--glass-bg: rgba(255, 255, 255, 0.25);
	--glass-border: rgba(255, 255, 255, 0.18);
	--border-radius: 16px;
	--border-radius-lg: 24px;
	--border-radius-full: 9999px;
	--transition-fast: 0.15s ease;
	--transition-normal: 0.3s ease;
	--transition-slow: 0.5s ease;
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
	--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
	--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
	--shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
	--shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
}

/* Base Reset */
*, *::before, *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	scroll-behavior: smooth;
}

body {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	background: var(--bg-gradient);
	min-height: 100vh;
	height: 100vh;
	color: var(--text-color);
	line-height: 1.6;
	text-align: center;
	overflow-x: hidden;
	overflow-y: hidden;
	position: relative;
}

/* Animated Background */
body::before {
	content: '';
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: 
		radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.3) 0%, transparent 50%),
		radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.3) 0%, transparent 50%),
		radial-gradient(circle at 40% 40%, rgba(236, 72, 153, 0.2) 0%, transparent 50%);
	z-index: -1;
	animation: bgPulse 15s ease-in-out infinite;
}

@keyframes bgPulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: 0.8; transform: scale(1.1); }
}

/* Floating Orbs */
body::after {
	content: '';
	position: fixed;
	width: 300px;
	height: 300px;
	background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 70%);
	border-radius: 50%;
	top: -100px;
	right: -100px;
	z-index: -1;
	animation: float 20s ease-in-out infinite;
}

@keyframes float {
	0%, 100% { transform: translate(0, 0) rotate(0deg); }
	25% { transform: translate(-50px, 50px) rotate(90deg); }
	50% { transform: translate(-100px, 0) rotate(180deg); }
	75% { transform: translate(-50px, -50px) rotate(270deg); }
}

/* Typography */
h1 {
	font-size: clamp(1.8rem, 4vw, 2.5rem);
	font-weight: 700;
	background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	margin: 1rem 0 0.75rem;
	text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	letter-spacing: -0.02em;
}

/* Focus Styles */
*:focus-visible {
	outline: 3px solid var(--primary-light);
	outline-offset: 3px;
	border-radius: 4px;
}

/* Controls Bar */
#controls {
	position: fixed;
	top: 0.75rem;
	right: 0.75rem;
	z-index: 10000;
	display: flex;
	gap: 0.4rem;
	padding: 0.4rem;
	background: var(--glass-bg);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid var(--glass-border);
	border-radius: 12px;
	box-shadow: var(--shadow-md);
}

#themeToggle {
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.9);
	cursor: pointer;
	font-size: 1.1rem;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all var(--transition-normal);
	box-shadow: var(--shadow-sm);
}

#themeToggle:hover {
	transform: scale(1.1) rotate(15deg);
	box-shadow: var(--shadow-md);
}

#styleSelect {
	padding: 0.5rem 0.8rem;
	border: none;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.9);
	font-family: inherit;
	font-size: 0.8rem;
	font-weight: 500;
	cursor: pointer;
	transition: all var(--transition-normal);
	box-shadow: var(--shadow-sm);
}

#styleSelect:hover {
	box-shadow: var(--shadow-md);
}

#langToggle {
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.9);
	cursor: pointer;
	font-size: 1rem;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all var(--transition-normal);
	box-shadow: var(--shadow-sm);
}

#langToggle:hover {
	transform: scale(1.1);
	box-shadow: var(--shadow-md);
}

/* Footer - Fixed at bottom */
footer {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 0.6rem;
	text-align: center;
	font-size: 0.75rem;
	color: rgba(255, 255, 255, 0.7);
	background: rgba(0, 0, 0, 0.3);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	z-index: 1000;
}

/* Body padding for fixed footer */
body {
	padding-bottom: 50px;
}
.light-theme footer {
    color: #000 !important;
    background: rgba(255, 255, 255, 0.8) !important;
}

footer a {
	color: rgba(255, 255, 255, 0.85);
	text-decoration: none;
	margin: 0 0.5rem;
	transition: color var(--transition-fast);
}

.light-theme footer a {
	color: #222;
}

footer a:hover {
	color: var(--accent-color);
}

.light-theme footer a:hover {
	color: var(--accent-color);
}

footer span {
	margin: 0 0.4rem;
}

/* Loading State */
#loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 40vh;
	padding: 1rem;
}

#loading.hidden {
	display: none;
}

#loading.visible {
	display: flex;
}

#message {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	font-size: 1rem;
	font-weight: 500;
	color: white;
	background: var(--glass-bg);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	padding: 1rem 1.8rem;
	border-radius: var(--border-radius-full);
	border: 1px solid var(--glass-border);
	box-shadow: var(--shadow-lg);
}

span.loadCircle {
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: white;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

/* Test Wrapper */
#testWrapper {
	padding: 0.75rem;
	max-width: 720px;
	margin: 0 auto;
}

#testWrapper.hidden {
	display: none;
}

#testWrapper.visible {
	display: block;
	animation: slideUp 0.6s ease;
}

@keyframes slideUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Start/Stop Button */
#startStopBtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 130px;
	height: 130px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
	color: white;
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	cursor: pointer;
	border: none;
	position: relative;
	overflow: hidden;
	box-shadow: 
		0 8px 30px rgba(99, 102, 241, 0.35),
		inset 0 -3px 15px rgba(0, 0, 0, 0.1),
		inset 0 3px 15px rgba(255, 255, 255, 0.2);
	transition: all var(--transition-normal);
	user-select: none;
}

#startStopBtn::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	transform: translate(-50%, -50%);
	transition: all 0.5s ease;
}

#startStopBtn:hover {
	transform: scale(1.05);
	box-shadow: 
		0 15px 50px rgba(99, 102, 241, 0.5),
		inset 0 -5px 20px rgba(0, 0, 0, 0.1),
		inset 0 5px 20px rgba(255, 255, 255, 0.3);
}

#startStopBtn:hover::before {
	width: 300px;
	height: 300px;
}

#startStopBtn:active {
	transform: scale(0.98);
}

/* Running State */
#startStopBtn.running {
	background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
	box-shadow: 
		0 10px 40px rgba(239, 68, 68, 0.4),
		inset 0 -5px 20px rgba(0, 0, 0, 0.1),
		inset 0 5px 20px rgba(255, 255, 255, 0.2);
	animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
	0%, 100% {
		box-shadow: 
			0 10px 40px rgba(239, 68, 68, 0.4),
			inset 0 -5px 20px rgba(0, 0, 0, 0.1),
			inset 0 5px 20px rgba(255, 255, 255, 0.2),
			0 0 0 0 rgba(239, 68, 68, 0.4);
	}
	50% {
		box-shadow: 
			0 10px 40px rgba(239, 68, 68, 0.4),
			inset 0 -5px 20px rgba(0, 0, 0, 0.1),
			inset 0 5px 20px rgba(255, 255, 255, 0.2),
			0 0 0 30px rgba(239, 68, 68, 0);
	}
}

/* Finished State */
#startStopBtn.finished {
	background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
	box-shadow: 
		0 10px 40px rgba(16, 185, 129, 0.4),
		inset 0 -5px 20px rgba(0, 0, 0, 0.1),
		inset 0 5px 20px rgba(255, 255, 255, 0.2);
}

/* Server Area */
#serverArea {
	margin: 1rem 0;
	color: white;
	font-weight: 500;
	font-size: 0.85rem;
}

#server {
	margin-left: 0.4rem;
	padding: 0.5rem 1rem;
	border: none;
	border-radius: 10px;
	background: var(--glass-bg);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	color: white;
	font-family: inherit;
	font-size: 0.85rem;
	cursor: pointer;
	transition: all var(--transition-normal);
}

#server:hover {
	background: rgba(255, 255, 255, 0.3);
}

#server option {
	background: #1e293b;
	color: white;
}

/* Test Area */
#test {
	margin: 1.25rem auto 3.5rem;
	padding: 0 0.75rem;
}

.testGroup {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.75rem;
	margin: 0.75rem 0;
}

/* Ping/Jitter Cards */
div.testArea2 {
	flex: 1;
	min-width: 110px;
	max-width: 145px;
	padding: 1rem 0.75rem;
	background: var(--glass-bg);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid var(--glass-border);
	border-radius: 12px;
	box-shadow: var(--shadow-md);
	transition: all var(--transition-normal);
}

div.testArea2:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-lg);
}

div.testArea2 .testName {
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: rgba(255, 255, 255, 0.7);
	margin-bottom: 0.3rem;
}

div.testArea2 .meterText {
	font-family: 'JetBrains Mono', monospace;
	font-size: 1.6rem;
	font-weight: 700;
	color: white;
	line-height: 1.2;
}

div.testArea2 .unit {
	font-size: 0.65rem;
	color: rgba(255, 255, 255, 0.6);
	margin-top: 0.2rem;
}

/* Download/Upload Cards */
div.testArea {
	flex: 1;
	min-width: 180px;
	max-width: 240px;
	height: 200px;
	position: relative;
	padding: 1rem;
	background: var(--glass-bg);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid var(--glass-border);
	border-radius: 16px;
	box-shadow: var(--shadow-md);
	transition: all var(--transition-normal);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
}

div.testArea:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-lg);
}

div.testArea .testName {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: rgba(255, 255, 255, 0.7);
	margin-bottom: 0.5rem;
	position: relative;
	z-index: 10;
}

/* Gauge Container */
.gauge-container {
	width: 100%;
	height: 90px;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
}

.gauge {
	width: 100%;
	max-width: 160px;
	height: auto;
	overflow: visible;
}

.gauge-bg {
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.gauge-fill {
	transition: stroke-dashoffset 0.3s ease-out;
	filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.5));
}

.gauge-needle {
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
	transition: transform 0.3s ease-out;
	transform-origin: 100px 100px;
}

/* Gauge container */
.gauge-container {
	position: relative;
}

/* Gauge scale labels */
.gauge-min,
.gauge-max {
	position: absolute;
	bottom: 8px;
	font-size: 0.6rem;
	color: rgba(255, 255, 255, 0.6);
	font-weight: 600;
	font-family: 'JetBrains Mono', monospace;
	transition: all 0.3s ease;
}

.gauge-min {
	left: 5%;
}

.gauge-max {
	right: 2%;
}

.gauge-unit {
	position: absolute;
	top: 10%;
	left: 50%;
	transform: translateX(-50%);
	font-size: 0.55rem;
	color: rgba(255, 255, 255, 0.5);
	font-weight: 600;
	font-family: 'JetBrains Mono', monospace;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Gauge running animation */
@keyframes gaugeGlow {
	0%, 100% { filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.5)); }
	50% { filter: drop-shadow(0 0 16px rgba(99, 102, 241, 0.8)); }
}

.running .gauge-fill {
	animation: gaugeGlow 1.5s ease-in-out infinite;
}

div.testArea .meterText {
	font-family: 'JetBrains Mono', monospace;
	font-size: 2rem;
	font-weight: 700;
	color: white;
	position: relative;
	z-index: 10;
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

div.testArea .unit {
	font-size: 0.9rem;
	color: rgba(255, 255, 255, 0.6);
	margin-left: 0.3rem;
	position: relative;
	z-index: 10;
	font-weight: 500;
}

.speed-display {
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: 0.2rem;
	margin-top: 0.25rem;
}

/* Remove old canvas meter styles */
div.testArea canvas.meter {
	display: none;
}

/* Empty State */
div.meterText:empty::before {
	content: "0.00";
	opacity: 0.4;
}

/* IP Area */
#ipArea {
	margin-top: 1rem;
	display: inline-block;
	padding: 0.5rem 1.2rem;
	background: var(--glass-bg);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid var(--glass-border);
	border-radius: var(--border-radius-full);
	box-shadow: var(--shadow-sm);
	font-size: 0.8rem;
}

#ip {
	font-family: 'JetBrains Mono', monospace;
	font-size: 0.8rem;
	color: white;
}

/* Share Area */
#shareArea {
	max-width: 420px;
	margin: 1.25rem auto;
	padding: 1.5rem;
	background: var(--glass-bg);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid var(--glass-border);
	border-radius: 16px;
	box-shadow: var(--shadow-lg);
}

#shareArea h3 {
	color: white;
	font-size: 1.1rem;
	margin-bottom: 0.75rem;
}

#shareArea p {
	color: rgba(255, 255, 255, 0.8);
	margin-bottom: 0.75rem;
	font-size: 0.85rem;
}

#testId {
	font-family: 'JetBrains Mono', monospace;
	background: rgba(255, 255, 255, 0.1);
	padding: 0.2rem 0.5rem;
	border-radius: 4px;
}

#resultsURL {
	width: 100%;
	padding: 0.75rem;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.1);
	color: white;
	font-family: 'JetBrains Mono', monospace;
	font-size: 0.75rem;
	cursor: pointer;
	transition: all var(--transition-normal);
}

#resultsURL:hover {
	background: rgba(255, 255, 255, 0.2);
	border-color: rgba(255, 255, 255, 0.4);
}

#resultsImg {
	max-width: 100%;
	border-radius: 8px;
	margin-top: 0.6rem;
}

/* Privacy Policy */
#privacyPolicy {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 90%;
	max-width: 480px;
	max-height: 75vh;
	overflow-y: auto;
	background: rgba(30, 41, 59, 0.95);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 16px;
	padding: 1.2rem;
	z-index: 999999;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
	color: white;
	text-align: left;
	animation: modalPop 0.3s ease;
	font-size: 0.85rem;
}

@keyframes modalPop {
	from {
		opacity: 0;
		transform: translate(-50%, -50%) scale(0.9);
	}
	to {
		opacity: 1;
		transform: translate(-50%, -50%) scale(1);
	}
}

#privacyPolicy h2 {
	font-size: 1.1rem;
	margin-bottom: 0.6rem;
	padding-bottom: 0.4rem;
	border-bottom: 2px solid var(--primary-color);
}

#privacyPolicy h4 {
	color: var(--primary-light);
	margin-top: 1rem;
	margin-bottom: 0.35rem;
	font-size: 0.9rem;
}

#privacyPolicy ul {
	padding-left: 1.2rem;
}

#privacyPolicy li {
	margin-bottom: 0.3rem;
}

a.privacy {
	display: inline-block;
	padding: 0.5rem 1.4rem;
	background: var(--primary-color);
	color: white;
	text-decoration: none;
	border-radius: 8px;
	font-weight: 600;
	font-size: 0.85rem;
	transition: all var(--transition-normal);
}

a.privacy:hover {
	background: var(--primary-dark);
	transform: translateY(-2px);
}

div.closePrivacyPolicy {
	text-align: center;
	margin-top: 2rem;
}

/* ========================================
   DARK THEME
   ======================================== */

.dark-theme {
	--bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
	--glass-bg: rgba(15, 23, 42, 0.8);
	--glass-border: rgba(255, 255, 255, 0.1);
}

.dark-theme::before {
	background: 
		radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.2) 0%, transparent 50%),
		radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.2) 0%, transparent 50%),
		radial-gradient(circle at 40% 40%, rgba(236, 72, 153, 0.15) 0%, transparent 50%);
}

.dark-theme #themeToggle,
.dark-theme #styleSelect,
.dark-theme #langToggle {
	background: rgba(30, 41, 59, 0.9);
	color: white;
}

.dark-theme #ipArea {
	color: rgba(255, 255, 255, 0.9);
}

.dark-theme #resultsURL {
	background: rgba(30, 41, 59, 0.8);
}

.dark-theme footer {
	color: rgba(255, 255, 255, 0.85);
}

.dark-theme footer a {
	color: rgba(255, 255, 255, 0.9);
}

.dark-theme footer a:hover {
	color: var(--primary-light);
}

/* ========================================
   LIGHT THEME
   ======================================== */

.light-theme {
	--bg-gradient: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
	--glass-bg: rgba(255, 255, 255, 0.7);
	--glass-border: rgba(255, 255, 255, 0.5);
}

.light-theme::before {
	background: 
		radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
		radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.15) 0%, transparent 50%),
		radial-gradient(circle at 40% 40%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
}

.light-theme h1 {
	background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.light-theme div.testArea2 .testName,
.light-theme div.testArea .testName {
	color: var(--text-muted);
}

.light-theme div.testArea2 .meterText,
.light-theme div.testArea .meterText {
	color: var(--text-color);
}

.light-theme div.testArea2 .unit,
.light-theme div.testArea .unit {
	color: var(--text-muted);
}

/* Light theme gauge improvements */
.light-theme .gauge-bg {
	stroke: rgba(0, 0, 0, 0.15) !important;
}

.light-theme .gauge-min,
.light-theme .gauge-max {
	color: rgba(0, 0, 0, 0.5);
}

.light-theme .gauge-unit {
	color: rgba(0, 0, 0, 0.4);
}

.light-theme .gauge-needle {
	fill: #333 !important;
}

.light-theme #serverArea {
	color: var(--text-color);
}

.light-theme #server {
	background: rgba(255, 255, 255, 0.8);
	color: var(--text-color);
}

.light-theme #server option {
	background: white;
	color: var(--text-color);
}

.light-theme #ip {
	color: var(--text-color);
}

.light-theme #shareArea h3,
.light-theme #shareArea p {
	color: var(--text-color);
}

.light-theme #resultsURL {
	background: rgba(255, 255, 255, 0.9);
	color: var(--text-color);
	border-color: rgba(0, 0, 0, 0.1);
}

.light-theme #message {
	color: var(--text-color);
}

.light-theme span.loadCircle {
	border-color: rgba(99, 102, 241, 0.3);
	border-top-color: var(--primary-color);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
	#controls {
		position: fixed;
		top: auto;
		bottom: 0.75rem;
		left: 50%;
		transform: translateX(-50%);
		right: auto;
	}
	
	h1 {
		font-size: 1.6rem;
		margin-top: 0.75rem;
	}
	
	#startStopBtn {
		width: 115px;
		height: 115px;
		font-size: 0.85rem;
	}
	
	.testGroup {
		gap: 0.6rem;
	}
	
	div.testArea {
		min-width: 140px;
		max-width: 180px;
		height: 130px;
	}
	
	div.testArea .meterText {
		font-size: 1.8rem;
	}
	
	div.testArea2 {
		min-width: 100px;
		max-width: 135px;
		padding: 0.75rem 0.6rem;
	}
	
	div.testArea2 .meterText {
		font-size: 1.4rem;
	}
	
	#test {
		margin-bottom: 4.5rem;
	}
}

@media (max-width: 480px) {
	#controls {
		width: calc(100% - 1.5rem);
		justify-content: center;
	}
	
	#startStopBtn {
		width: 100px;
		height: 100px;
		font-size: 0.8rem;
	}
	
	div.testArea .meterText {
		font-size: 1.6rem;
	}
}

/* ========================================
   STYLE VARIATIONS
   ======================================== */

/* Modern Style */
.style-modern #startStopBtn {
	border-radius: 16px;
	width: 150px;
	height: 60px;
}

.style-modern div.testArea,
.style-modern div.testArea2 {
	border-radius: 6px;
}

/* Pretty Style */
.style-pretty {
	--primary-color: #ec4899;
	--primary-light: #f472b6;
	--primary-dark: #db2777;
}

.style-pretty::before {
	background: 
		radial-gradient(circle at 20% 80%, rgba(236, 72, 153, 0.3) 0%, transparent 50%),
		radial-gradient(circle at 80% 20%, rgba(168, 85, 247, 0.3) 0%, transparent 50%);
}

.style-pretty #startStopBtn {
	background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
	box-shadow: 0 10px 40px rgba(236, 72, 153, 0.4);
}

/* Gauges Style */
.style-gauges div.testArea {
	border-radius: 50%;
	width: 150px;
	height: 150px;
	max-width: 150px;
}

/* Basic Style */
.style-basic {
	--border-radius: 4px;
	--border-radius-lg: 8px;
}

.style-basic #startStopBtn {
	border-radius: 4px;
	width: 140px;
	height: 50px;
}

.style-basic div.testArea,
.style-basic div.testArea2 {
	border-radius: 4px;
}

/* Chart Style */
.style-chart div.testArea {
	border-left: 4px solid var(--primary-color);
	border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

/* Progress Style */
.style-progress div.testArea::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	height: 4px;
	background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
	border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
	animation: progressWave 2s ease-in-out infinite;
	width: 100%;
}

@keyframes progressWave {
	0%, 100% { transform: scaleX(0.3); transform-origin: left; }
	50% { transform: scaleX(1); transform-origin: left; }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
	body::before,
	body::after,
	#controls,
	#startStopBtn,
	#privacyPolicy {
		display: none !important;
	}
	
	body {
		background: white !important;
		color: black !important;
	}
	
	div.testArea,
	div.testArea2 {
		background: #f5f5f5 !important;
		border: 1px solid #ddd !important;
		color: black !important;
	}
	
	div.testArea .meterText,
	div.testArea2 .meterText,
	div.testArea .testName,
	div.testArea2 .testName {
		color: black !important;
	}
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes slideIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Card entrance animations */
div.testArea,
div.testArea2 {
	animation: slideIn 0.5s ease backwards;
}

div.testArea:nth-child(1),
div.testArea2:nth-child(1) { animation-delay: 0.1s; }
div.testArea:nth-child(2),
div.testArea2:nth-child(2) { animation-delay: 0.2s; }

/* ========================================
   TEST PROGRESS INDICATOR
   ======================================== */

.test-progress {
	max-width: 400px;
	margin: 1rem auto;
	padding: 1rem 1.5rem;
	background: var(--glass-bg);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid var(--glass-border);
	border-radius: var(--border-radius);
	box-shadow: var(--shadow-lg);
	animation: slideIn 0.3s ease;
}

.progress-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.75rem;
}

.progress-title {
	font-weight: 600;
	color: white;
	font-size: 0.9rem;
}

.progress-phase {
	font-size: 0.8rem;
	color: var(--primary-light);
	font-weight: 500;
}

.progress-bar-container {
	width: 100%;
	height: 8px;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 4px;
	overflow: hidden;
}

.progress-bar {
	height: 100%;
	background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
	border-radius: 4px;
	transition: width 0.3s ease;
	animation: progressPulse 1.5s ease-in-out infinite;
}

@keyframes progressPulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.7; }
}

.progress-time {
	margin-top: 0.75rem;
	text-align: center;
	font-size: 0.8rem;
	color: rgba(255, 255, 255, 0.7);
}

/* ========================================
   CONNECTION ANALYSIS MODAL
   ======================================== */

.connection-analysis {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
	display: none;
	justify-content: center;
	align-items: center;
	z-index: 999999;
	padding: 1rem;
	animation: fadeIn 0.3s ease;
}

.analysis-content {
	background: rgba(30, 41, 59, 0.95);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: var(--border-radius-lg);
	padding: 2rem;
	max-width: 450px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	text-align: center;
	animation: modalPop 0.4s ease;
}

.analysis-content h2 {
	color: white;
	font-size: 1.4rem;
	margin-bottom: 1.5rem;
	font-weight: 700;
}

.quality-badge {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	padding: 1.5rem 2rem;
	border-radius: var(--border-radius-lg);
	margin-bottom: 1.5rem;
}

.quality-badge.excellent {
	background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(6, 182, 212, 0.3));
	border: 2px solid var(--success-color);
}

.quality-badge.good {
	background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(16, 185, 129, 0.3));
	border: 2px solid var(--primary-color);
}

.quality-badge.average {
	background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(99, 102, 241, 0.3));
	border: 2px solid var(--warning-color);
}

.quality-badge.poor {
	background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(245, 158, 11, 0.3));
	border: 2px solid var(--danger-color);
}

.quality-badge.very-poor {
	background: linear-gradient(135deg, rgba(127, 29, 29, 0.3), rgba(239, 68, 68, 0.3));
	border: 2px solid #7f1d1d;
}

.quality-icon {
	font-size: 3rem;
	margin-bottom: 0.5rem;
}

.quality-text {
	font-size: 1.5rem;
	font-weight: 700;
	color: white;
}

.quality-description {
	color: rgba(255, 255, 255, 0.8);
	font-size: 0.95rem;
	line-height: 1.6;
	margin-bottom: 1.5rem;
}

.stats-summary {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.75rem;
	margin-bottom: 1.5rem;
}

.stat-item {
	background: rgba(255, 255, 255, 0.1);
	padding: 0.75rem;
	border-radius: var(--border-radius);
}

.stat-label {
	display: block;
	font-size: 0.7rem;
	color: rgba(255, 255, 255, 0.6);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 0.25rem;
}

.stat-value {
	display: block;
	font-family: 'JetBrains Mono', monospace;
	font-size: 1rem;
	font-weight: 600;
	color: white;
}

.suitable-for {
	background: rgba(255, 255, 255, 0.05);
	padding: 1rem;
	border-radius: var(--border-radius);
	margin-bottom: 1.5rem;
}

.suitable-for h4 {
	color: rgba(255, 255, 255, 0.8);
	font-size: 0.85rem;
	margin-bottom: 0.75rem;
}

.activities {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
}

.activity {
	background: rgba(99, 102, 241, 0.2);
	color: white;
	padding: 0.4rem 0.8rem;
	border-radius: var(--border-radius-full);
	font-size: 0.8rem;
}

.close-analysis {
	width: 100%;
	padding: 0.9rem 1.5rem;
	background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
	color: white;
	border: none;
	border-radius: var(--border-radius);
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: all var(--transition-normal);
}

.close-analysis:hover {
	transform: translateY(-2px);
	box-shadow: 0 5px 20px rgba(99, 102, 241, 0.4);
}

/* Responsive Analysis Modal */
@media (max-width: 480px) {
	.analysis-content {
		padding: 1.5rem;
	}
	
	.quality-badge {
		padding: 1rem 1.5rem;
	}
	
	.quality-icon {
		font-size: 2.5rem;
	}
	
	.quality-text {
		font-size: 1.2rem;
	}
	
	.stats-summary {
		grid-template-columns: repeat(2, 1fr);
		gap: 0.5rem;
	}
}