/* Modern CSS with Mobile-First Design and Multi-language Support */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Noto+Sans+Thai:wght@100..900&display=swap');

:root {
	/* Color Palette */
	--primary-color: #007bff;
	--primary-dark: #0056b3;
	--secondary-color: #6c757d;
	--success-color: #28a745;
	--danger-color: #dc3545;
	--warning-color: #ffc107;
	--info-color: #17a2b8;
	--light-color: #f8f9fa;
	--dark-color: #343a40;

	/* Typography */
	--font-family-en: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	--font-family-th: 'Noto Sans Thai', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	--font-size-base: 1rem;
	--line-height-base: 1.6;

	/* Spacing */
	--spacing-xs: 0.25rem;
	--spacing-sm: 0.5rem;
	--spacing-md: 1rem;
	--spacing-lg: 1.5rem;
	--spacing-xl: 3rem;

	/* Shadows */
	--shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
	--shadow-md: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
	--shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);

	/* Border Radius */
	--border-radius-sm: 0.25rem;
	--border-radius-md: 0.375rem;
	--border-radius-lg: 0.5rem;
	--border-radius-xl: 1rem;

	/* Transitions */
	--transition-fast: 0.15s ease-in-out;
	--transition-normal: 0.3s ease-in-out;
	--transition-slow: 0.5s ease-in-out;

	/* Additional Colors */
	--white: #ffffff;
	--gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	--gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);

	/* Legacy Variables for Compatibility */
	--border-radius: 8px;
	--box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	--transition: all 0.3s ease;
}

* {
	box-sizing: border-box;
}

.section {
	padding: 5rem 0;
}

.url-shortener-form {
	scroll-margin-top: 120px;
}

#resultContainer {
	scroll-margin-top: 150px;
	/* Adjust based on your header height */
}

body {
	font-family: 'Noto Sans Thai', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	line-height: 1.6;
	color: var(--dark-color);
	background-color: #f8fafc;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
	font-weight: 600;
	line-height: 1.2;
	margin-bottom: 1rem;
}

.hero-title {
	font-size: 3.5rem;
	font-weight: 700;
	background: var(--gradient-primary);
	background-clip: text;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	margin-bottom: 1.5rem;
}

.hero-subtitle {
	font-size: 1.25rem;
	color: var(--secondary-color);
	margin-bottom: 2rem;
}

/* Navigation */
.navbar {
	background: var(--white) !important;
	box-shadow: var(--box-shadow);
	padding: 1rem 0;
}

.navbar-brand {
	font-size: 1.75rem;
	font-weight: 700;
	background: var(--gradient-primary);
	background-clip: text;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

.navbar-nav .nav-link {
	font-weight: 500;
	color: var(--dark-color) !important;
	margin: 0 0.5rem;
	padding: 0.5rem 1rem !important;
	border-radius: var(--border-radius);
	transition: var(--transition);
}

.navbar-nav .nav-link:hover {
	background-color: var(--light-color);
	color: var(--primary-color) !important;
}

.navbar-nav .nav-link.active {
	background: var(--gradient-primary);
	color: var(--white) !important;
}

/* Buttons */
.btn {
	font-weight: 500;
	border-radius: var(--border-radius);
	padding: 0.75rem 1.5rem;
	transition: var(--transition);
	border: none;
}

.btn-primary {
	background: var(--gradient-primary);
	border: none;
	color: var(--white);
}

.btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-outline-primary {
	border: 2px solid var(--primary-color);
	color: var(--primary-color);
	background: transparent;
}

.btn-outline-primary:hover {
	background: var(--primary-color);
	color: var(--white);
	transform: translateY(-2px);
}

.btn-social {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.75rem 1.5rem;
	border-radius: var(--border-radius);
	font-weight: 500;
	text-decoration: none;
	transition: var(--transition);
	margin-bottom: 0.5rem;
}

.btn-google {
	background-color: #db4437;
	color: var(--white);
}

.btn-facebook {
	background-color: #3b5998;
	color: var(--white);
}

.btn-line {
	background-color: #00c300;
	color: var(--white);
}

.btn-social:hover {
	transform: translateY(-2px);
	text-decoration: none;
	color: var(--white);
}

.btn-outline-danger.btn-social {
	border: 2px solid var(--danger-color);
}

#togglePassword, #toggleConfirmPassword {
	border: 2px solid #e2e8f0;
	border-left: none;
}

#togglePassword:hover, #toggleConfirmPassword:hover {
	border: 2px solid #e2e8f0;
	border-left: none;
}

input#password, input#confirm_password {
	border-right: none;
}

.content section {
	scroll-margin-top: 120px;
}

/* Forms */
.form-control {
	border-radius: var(--border-radius);
	border: 2px solid #e2e8f0;
	padding: 0.75rem 1rem;
	font-size: 1rem;
	transition: var(--transition);
}

.form-control:focus {
	border-color: var(--primary-color);
	box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-label {
	font-weight: 500;
	margin-bottom: 0.5rem;
	color: var(--dark-color);
}

/* Hero Section */
.hero-section {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: var(--white);
	padding: 5rem 0;
	text-align: center;
}

.hero-section .hero-title {
	-webkit-text-fill-color: var(--white);
}

.hero-section .hero-subtitle {
	color: rgba(255, 255, 255, 0.9);
}

/* URL Shortener Form */
.url-shortener-form {
	background: var(--white);
	border-radius: var(--border-radius);
	box-shadow: var(--box-shadow);
	padding: 2rem;
	margin-top: -3rem;
	position: relative;
	z-index: 10;
}

.url-input-group {
	position: relative;
}

.url-input {
	font-size: 1.1rem;
	padding: 1rem;
	border-radius: var(--border-radius);
}

.shorten-btn {
	padding: 1rem 2rem;
	font-size: 1.1rem;
	font-weight: 600;
}

/* Features Section */
.features-section {
	padding: 5rem 0;
	background: var(--white);
}

.feature-card {
	background: var(--white);
	border-radius: var(--border-radius);
	box-shadow: var(--box-shadow);
	padding: 2rem;
	text-align: center;
	transition: var(--transition);
	height: 100%;
	border: 1px solid #e2e8f0;
}

.feature-card:hover {
	transform: translateY(-10px);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.feature-icon {
	font-size: 3rem;
	background: var(--gradient-primary);
	background-clip: text;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	margin-bottom: 1rem;
}

/* Stats Cards */
.stats-card {
	background: var(--white);
	border-radius: var(--border-radius);
	box-shadow: var(--box-shadow);
	padding: 1.5rem;
	text-align: center;
	border-left: 4px solid var(--primary-color);
}

.stats-number {
	font-size: 2.5rem;
	font-weight: 700;
	color: var(--primary-color);
	margin: 0;
}

.stats-label {
	color: var(--secondary-color);
	font-weight: 500;
	margin: 0;
}

/* Link Cards */
.link-card {
	background: var(--white);
	border-radius: var(--border-radius);
	box-shadow: var(--box-shadow);
	padding: 1.5rem;
	margin-bottom: 1rem;
	border-left: 4px solid var(--primary-color);
	transition: var(--transition);
}

.link-card:hover {
	box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.link-original {
	color: var(--secondary-color);
	font-size: 0.9rem;
	word-break: break-all;
}

.link-short {
	color: var(--primary-color);
	font-weight: 600;
	font-size: 1.1rem;
}

.link-stats {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-top: 0.5rem;
}

.link-clicks {
	color: var(--success-color);
	font-weight: 500;
}

.link-date {
	color: var(--secondary-color);
	font-size: 0.85rem;
}

/* Auth Forms */
.auth-container {
	max-width: 400px;
	margin: 2rem auto;
	padding: 2rem;
	background: var(--white);
	border-radius: var(--border-radius);
	box-shadow: var(--box-shadow);
}

.auth-title {
	text-align: center;
	margin-bottom: 2rem;
	color: var(--dark-color);
}

.auth-divider {
	text-align: center;
	margin: 1.5rem 0;
	position: relative;
}

.auth-divider::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 1px;
	background: #e2e8f0;
}

.auth-divider span {
	background: var(--white);
	padding: 0 1rem;
	color: var(--secondary-color);
}

/* Alert Messages */
.alert {
	border-radius: var(--border-radius);
	border: none;
	padding: 1rem 1.5rem;
	margin-bottom: 1rem;
}

.alert-success {
	background-color: #d4edda;
	color: #155724;
}

.alert-danger {
	background-color: #f8d7da;
	color: #721c24;
}

.alert-info {
	background-color: #d1ecf1;
	color: #0c5460;
}

/* Footer */
.footer {
	background-color: var(--dark-color);
	color: var(--white);
	padding: 3rem 0 1rem;
	margin-top: 3rem;
}

.footer-title {
	font-size: 1.5rem;
	font-weight: 700;
	margin-bottom: 1rem;
}

.footer-link {
	color: rgba(255, 255, 255, 0.8);
	text-decoration: none;
	transition: var(--transition);
}

.footer-link:hover {
	color: var(--white);
	text-decoration: none;
}

.footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.2);
	padding-top: 1rem;
	margin-top: 2rem;
	text-align: center;
	color: rgba(255, 255, 255, 0.6);
}

/* Language Switcher */
.language-switcher {
	position: relative;
}

.language-flag {
	width: 24px;
	height: 18px;
	border-radius: 2px;
	margin-right: 0.5rem;
}

/* Loading Spinner */
.spinner {
	width: 20px;
	height: 20px;
	border: 2px solid #f3f3f3;
	border-top: 2px solid var(--primary-color);
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}

	100% {
		transform: rotate(360deg);
	}
}

/* Copy Button */
.copy-btn {
	background: var(--light-color);
	border: 1px solid #e2e8f0;
	color: var(--secondary-color);
	padding: 0.5rem 1rem;
	border-radius: var(--border-radius);
	cursor: pointer;
	transition: var(--transition);
}

.copy-btn:hover {
	background: var(--primary-color);
	color: var(--white);
	border-color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
	.hero-title {
		font-size: 2.5rem;
	}

	.hero-subtitle {
		font-size: 1.1rem;
	}

	.url-shortener-form {
		margin: 1rem;
		padding: 1.5rem;
	}

	.feature-card {
		margin-bottom: 2rem;
	}

	.navbar-nav {
		text-align: center;
	}

	.navbar-nav .nav-link {
		margin: 0.25rem 0;
	}
}

@media (max-width: 576px) {
	.hero-section {
		padding: 3rem 0;
	}

	.hero-title {
		font-size: 2rem;
	}

	.url-shortener-form {
		margin: 0.5rem;
		padding: 1rem;
	}

	.btn {
		padding: 0.65rem 1.25rem;
	}
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
	.theme-dark {
		--white: #1a1a1a;
		--light-color: #2d2d2d;
		--dark-color: #ffffff;
		--secondary-color: #a0a0a0;
	}
}

/* Animation Classes */
.fade-in {
	animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.slide-up {
	animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
	from {
		transform: translateY(30px);
		opacity: 0;
	}

	to {
		transform: translateY(0);
		opacity: 1;
	}
}

/* Utility Classes */
.text-gradient {
	background: var(--gradient-primary);
	background-clip: text;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

.bg-gradient {
	background: var(--gradient-primary);
}

.border-gradient {
	border: 2px solid;
	border-image: var(--gradient-primary) 1;
}

.shadow-sm {
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.shadow-lg {
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}