/**
 * Main Styles - Refactored for Maintainability & Efficiency
 * Core styling for SubmitMyShit
 */

/* ===================================================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   =================================================================== */
:root {
	/* Colors */
	--color-primary-start: #667eea;
	--color-primary-end: #764ba2;
	--color-secondary-success: #10b981;
	--color-secondary-success-dark: #059669;
	--color-alert-danger: #ef4444;
	--color-alert-danger-dark: #dc2626;
	--color-text-light: #f8f6f3;
	--color-bg-glass: rgba(248, 246, 243, 0.95);
	--color-border-glass: rgba(200, 195, 188, 0.3);

	/* Gradients */
	--primary-gradient: linear-gradient(135deg, var(--color-primary-start) 0%, var(--color-primary-end) 100%);
	--success-gradient: linear-gradient(135deg, var(--color-secondary-success), var(--color-secondary-success-dark));
	--danger-gradient: linear-gradient(135deg, var(--color-alert-danger) 0%, var(--color-alert-danger-dark) 100%);

	/* Sizing */
	--invitation-banner-height: 40px;
}

/* ===================================================================
   CORE LAYOUT & BACKGROUND
   =================================================================== */
.grecaptcha-badge {
	visibility: hidden;
}

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

/* Dashboard-style polkadot background */
body {
	background: var(--primary-gradient);
	min-height: 100vh;
	position: relative;
}

body::before {
	content: '';
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
	z-index: -1;
}

#authModal,
#passwordResetModal {
	z-index: 999;
	backdrop-filter: blur(10px);
}

/* Target specific utility classes without using '!important' */
.alert-banner {
	z-index: 40;
}

/* ===================================================================
   INVITATION MODE BANNER
   =================================================================== */

/* Fix the gap issue with your current implementation */
body.has-invitation-banner,
body.invitation-mode-active {
	margin-top: var(--invitation-banner-height);
	padding: 0;
}

/* Adjust navigation positioning */
.has-invitation-banner nav,
.invitation-mode-active nav {
	position: relative;
	z-index: 999;
}

/* Ensure any red banner is properly positioned */
.invitation-banner {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	height: var(--invitation-banner-height);
	margin: 0;
	padding: 0;
}

/* Mobile adjustments */
@media (max-width: 768px) {
	:root {
		--invitation-banner-height: 48px;
	}
}

/* ===================================================================
   GLASS EFFECTS & CARDS
   =================================================================== */

.glass-effect {
	background: var(--color-bg-glass);
	backdrop-filter: blur(10px);
	border: 1px solid var(--color-border-glass);
}

.feature-card:hover {
	transform: translateY(-5px);
	transition: all 0.3s ease;
}

/* Animations are wrapped in a media query for accessibility */
@media (prefers-reduced-motion: no-preference) {
	.floating-card {
		animation: float 3s ease-in-out infinite;
	}
}

@keyframes float {
	0%,
	100% {
		transform: translateY(0px);
	}
	50% {
		transform: translateY(-10px);
	}
}

.api-card {
	transition: all 0.3s ease;
	border: 2px solid transparent;
}

.api-card:hover {
	border-color: #e5e7eb;
	transform: translateY(-2px);
}

.api-card.featured {
	border-color: var(--color-secondary-success);
	box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

/* ===================================================================
   BUTTONS & INTERACTIVE ELEMENTS
   =================================================================== */

.btn-primary {
	background: var(--primary-gradient);
	transition: all 0.3s ease;
}

.btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

/* ===================================================================
   API & STATUS BADGES
   =================================================================== */

.api-badge {
	display: inline-flex;
	align-items: center;
	padding: 0.5rem 1rem;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 2rem;
	color: white;
	font-size: 0.875rem;
	margin: 0.25rem;
	backdrop-filter: blur(10px);
}

.source-indicator {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	background: var(--primary-gradient);
	color: white;
	padding: 0.25rem 0.5rem;
	border-radius: 0.375rem;
	font-size: 0.75rem;
	font-weight: 600;
}

.source-indicator.bg-red-500 {
	background: var(--danger-gradient);
}

.feature-badge {
	background: var(--success-gradient);
}

/* ===================================================================
   USAGE BARS & PROGRESS
   =================================================================== */

.usage-bar {
	height: 6px;
	border-radius: 3px;
	overflow: hidden;
}

.live-counter {
	font-family: 'Courier New', monospace;
	font-weight: bold;
	color: var(--color-secondary-success);
}

/* ===================================================================
   STEP INDICATORS & WORKFLOW
   =================================================================== */

.step-indicator {
	background: var(--primary-gradient);
	width: 4rem;
	height: 4rem;
	min-width: 4rem;
	min-height: 4rem;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-weight: bold;
	font-size: 1.5rem;
	flex-shrink: 0;
}

/* ===================================================================
   PROBLEM/SOLUTION CARDS
   =================================================================== */

.problem-card {
	background: rgba(var(--color-alert-danger), 0.1);
	border: 2px solid rgba(var(--color-alert-danger), 0.2);
	border-radius: 1rem;
	padding: 1.5rem;
	margin: 1rem 0;
}

.solution-card {
	background: rgba(var(--color-secondary-success), 0.1);
	border: 2px solid rgba(var(--color-secondary-success), 0.2);
	border-radius: 1rem;
	padding: 1.5rem;
	margin: 1rem 0;
}

/* ===================================================================
   COMPARISON TABLES
   =================================================================== */

.comparison-table {
	overflow-x: auto;
}

.comparison-table table {
	width: 100%;
	border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
	padding: 1rem;
	text-align: left;
	border-bottom: 1px solid #e5e7eb;
}

.comparison-table th {
	background: #f9fafb;
	font-weight: 600;
}

.check-mark {
	color: var(--color-secondary-success);
	font-size: 1.25rem;
}

.x-mark {
	color: var(--color-alert-danger);
	font-size: 1.25rem;
}

/* ===================================================================
   TESTIMONIALS
   =================================================================== */

.testimonial-card {
	background: white;
	border-radius: 1rem;
	padding: 2rem;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
	margin: 1rem;
}

/* ===================================================================
   MOBILE MENU & NAVIGATION
   =================================================================== */

#mobile-menu {
	position: relative;
	z-index: 60;
}

#hamburger-icon {
	transition: transform 0.2s ease;
}

/* Better visual hierarchy on mobile */
@media (max-width: 768px) {
	.glass-effect {
		backdrop-filter: blur(12px);
	}

	h1 {
		font-weight: 800;
	}
}

/* ===================================================================
   STATUS INDICATORS
   =================================================================== */

.status-active { color: var(--color-secondary-success-dark); }
.status-inactive { color: var(--color-alert-danger-dark); }
.status-disabled { color: #6b7280; }
.status-not_configured { color: #d97706; }

/* ===================================================================
   FORM INPUTS
   =================================================================== */

.key-input {
	font-family: 'Courier New', monospace;
	letter-spacing: 1px;
}

/* ===================================================================
   SECURITY BADGES
   =================================================================== */

.security-badge-google {
	display: inline-flex;
	align-items: center;
	padding: 8px 14px;
	background: #f8f9fa;
	border: 1px solid #dadce0;
	border-radius: 8px;
	font-size: 12px;
	color: #5f6368;
	text-decoration: none;
	transition: all 0.2s ease;
}

.security-badge-google:hover {
	background: #e8eaed;
	text-decoration: none;
	color: #5f6368;
}

/* ===================================================================
   RESPONSIVE UTILITIES
   =================================================================== */

/* Ensure responsive behavior */
@media (max-width: 640px) {
	.api-badge {
		font-size: 0.75rem;
		padding: 0.375rem 0.75rem;
	}

	.floating-card {
		animation-duration: 4s; /* Slower animation on mobile */
	}
}

/* High contrast mode support */
@media (prefers-contrast: high) {
	.glass-effect {
		background: rgba(255, 255, 255, 0.98);
		border: 2px solid #000;
	}

	.gradient-bg {
		background: linear-gradient(135deg, #000080 0%, #4b0082 100%);
	}
}

/* Google Button Container Styling */
#google-signin-login,
#google-signin-register {
	position: relative;
	margin: 20px auto;
	max-width: 100%;
	transform: scale(1.05);
	transition: all 0.3s ease;
}

/* Add hover effect to the container */
#google-signin-login:hover,
#google-signin-register:hover {
	transform: scale(1.08);
	filter: drop-shadow(0 4px 12px rgba(66, 133, 244, 0.3));
}

/* Style the iframe container that Google creates */
#google-signin-login > div,
#google-signin-register > div {
	width: 100% !important;
	display: flex !important;
	justify-content: center !important;
}

/* Enhance the Google button iframe */
#google-signin-login iframe,
#google-signin-register iframe {
	border-radius: 8px !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
	transition: all 0.3s ease !important;
}

#google-signin-login iframe:hover,
#google-signin-register iframe:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
}

/* Beautiful dividers */
.auth-divider {
	position: relative;
	margin: 30px 0;
	text-align: center;
}

.auth-divider::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 1px;
	background: linear-gradient(to right, transparent, #cbd5e1, transparent);
}

.auth-divider span {
	position: relative;
	padding: 0 20px;
	background: white;
	color: #64748b;
	font-size: 14px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Add shimmer effect */
@keyframes shimmer {
	0% { background-position: -1000px 0; }
	100% { background-position: 1000px 0; }
}

.google-button-shimmer {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border-radius: 8px;
	background: linear-gradient(
		90deg,
		transparent,
		rgba(255, 255, 255, 0.1),
		transparent
	);
	background-size: 1000px 100%;
	animation: shimmer 3s infinite;
	pointer-events: none;
	z-index: 1;
}
/* One-Tap Loading Overlay */
.one-tap-loading {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(5px);
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: fadeIn 0.3s ease;
}

.one-tap-loading-content {
	background: white;
	padding: 40px;
	border-radius: 16px;
	text-align: center;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.one-tap-spinner {
	width: 50px;
	height: 50px;
	margin: 0 auto 20px;
	border: 4px solid #f3f3f3;
	border-top: 4px solid #4285F4;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

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

/* One-Tap Success Message */
.one-tap-success {
	position: fixed;
	top: 20px;
	right: 20px;
	background: white;
	padding: 20px 30px;
	border-radius: 12px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
	z-index: 10001;
	animation: slideInRight 0.5s ease;
}

.one-tap-success-content {
	display: flex;
	align-items: center;
	gap: 15px;
}

.one-tap-success i {
	color: #10b981;
	font-size: 24px;
}

.one-tap-success p {
	margin: 0;
	font-weight: 600;
	color: #1f2937;
}

@keyframes slideInRight {
	from {
		transform: translateX(100%);
		opacity: 0;
	}
	to {
		transform: translateX(0);
		opacity: 1;
	}
}

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

/* Customize Google One-Tap prompt position and style */
#credential_picker_container {
	z-index: 9999 !important;
}

/* Style for the One-Tap iframe */
iframe[src*="accounts.google.com"] {
	border-radius: 12px !important;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
}
/* ============================================
   GOOGLE ONE-TAP LOADING ANIMATIONS
   ============================================ */

/* Loading Overlay with Blur Effect */
.one-tap-loading {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: fadeIn 0.3s ease;
}

/* Dark mode version */
@media (prefers-color-scheme: dark) {
	.one-tap-loading {
		background: rgba(17, 24, 39, 0.95);
	}
}

.one-tap-loading-content {
	text-align: center;
	animation: slideUp 0.5s ease;
}

/* Google Colors Spinner */
.google-colors-spinner {
	width: 60px;
	height: 60px;
	margin: 0 auto 30px;
	position: relative;
	animation: rotate 2s linear infinite;
}

.google-spinner-blade {
	position: absolute;
	top: 0;
	left: 28px;
	width: 4px;
	height: 30px;
	border-radius: 2px;
	transform-origin: center 30px;
	animation: fade 1s linear infinite;
}

.blade-1 {
	background: #4285F4;
	transform: rotate(0deg);
	animation-delay: 0s;
}

.blade-2 {
	background: #EA4335;
	transform: rotate(90deg);
	animation-delay: 0.25s;
}

.blade-3 {
	background: #FBBC05;
	transform: rotate(180deg);
	animation-delay: 0.5s;
}

.blade-4 {
	background: #34A853;
	transform: rotate(270deg);
	animation-delay: 0.75s;
}

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

@keyframes fade {
	0%, 100% { opacity: 0.3; }
	50% { opacity: 1; }
}

/* Loading Text with Typing Effect */
.loading-text {
	font-size: 18px;
	font-weight: 500;
	color: #5f6368;
	margin: 0 0 20px 0;
	letter-spacing: 0.5px;
	position: relative;
}

.loading-text::after {
	content: '';
	position: absolute;
	right: -10px;
	top: 50%;
	transform: translateY(-50%);
	width: 2px;
	height: 20px;
	background: #5f6368;
	animation: blink 1s infinite;
}

@keyframes blink {
	0%, 50% { opacity: 1; }
	51%, 100% { opacity: 0; }
}

/* Progress Bar */
.loading-progress {
	width: 200px;
	height: 4px;
	background: #e8eaed;
	border-radius: 2px;
	overflow: hidden;
	margin: 0 auto;
}

.progress-bar {
	height: 100%;
	background: linear-gradient(90deg, #4285F4, #34A853, #FBBC05, #EA4335);
	background-size: 300% 100%;
	animation: progress 2s ease-in-out infinite;
	border-radius: 2px;
}

@keyframes progress {
	0% {
		width: 0%;
		background-position: 0% 50%;
	}
	50% {
		width: 70%;
		background-position: 50% 50%;
	}
	100% {
		width: 100%;
		background-position: 100% 50%;
	}
}

/* ============================================
   SUCCESS ANIMATION
   ============================================ */

.one-tap-success {
	position: fixed;
	top: 30px;
	right: 30px;
	background: white;
	border-radius: 16px;
	box-shadow: 
		0 10px 40px rgba(0, 0, 0, 0.1),
		0 2px 10px rgba(0, 0, 0, 0.05);
	z-index: 10001;
	animation: slideInBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
	min-width: 300px;
	border: 1px solid rgba(0, 0, 0, 0.05);
}

.one-tap-success-content {
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 20px 25px;
}

/* Animated Checkmark */
.success-icon {
	flex-shrink: 0;
}

.checkmark {
	width: 40px;
	height: 40px;
	stroke-width: 3;
	stroke: #34A853;
	stroke-miterlimit: 10;
}

.checkmark-circle {
	stroke-dasharray: 166;
	stroke-dashoffset: 166;
	animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
	transform-origin: 50% 50%;
	stroke-dasharray: 48;
	stroke-dashoffset: 48;
	animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes stroke {
	100% {
		stroke-dashoffset: 0;
	}
}

.one-tap-success p {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: #202124;
	animation: fadeInText 0.5s ease 0.3s backwards;
}

@keyframes fadeInText {
	from {
		opacity: 0;
		transform: translateX(-10px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

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

@keyframes slideInBounce {
	from {
		opacity: 0;
		transform: translateX(400px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

/* ============================================
   GLOBAL NOTIFICATION (Errors/Info)
   ============================================ */

.global-notification {
	position: fixed;
	bottom: 30px;
	left: 50%;
	transform: translateX(-50%);
	background: white;
	border-radius: 12px;
	box-shadow: 
		0 10px 40px rgba(0, 0, 0, 0.15),
		0 2px 10px rgba(0, 0, 0, 0.05);
	z-index: 10002;
	min-width: 320px;
	max-width: 500px;
	animation: slideUpNotification 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.notification-content {
	display: flex;
	align-items: center;
	gap: 15px;
	padding: 16px 20px;
}

.notification-icon {
	width: 24px;
	height: 24px;
	flex-shrink: 0;
}

.notification-icon.success::before {
	content: '✓';
	color: #34A853;
	font-size: 20px;
	font-weight: bold;
}

.notification-icon.error::before {
	content: '✕';
	color: #EA4335;
	font-size: 20px;
	font-weight: bold;
}

.notification-icon.info::before {
	content: 'ℹ';
	color: #4285F4;
	font-size: 20px;
	font-weight: bold;
}

.notification-message {
	flex: 1;
	font-size: 14px;
	color: #5f6368;
	line-height: 1.4;
}

@keyframes slideUpNotification {
	from {
		opacity: 0;
		transform: translateX(-50%) translateY(100px);
	}
	to {
		opacity: 1;
		transform: translateX(-50%) translateY(0);
	}
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 640px) {
	.one-tap-success {
		top: 20px;
		right: 20px;
		left: 20px;
		min-width: auto;
	}
	
	.global-notification {
		bottom: 20px;
		left: 20px;
		right: 20px;
		transform: none;
		min-width: auto;
	}
	
	@keyframes slideUpNotification {
		from {
			opacity: 0;
			transform: translateY(100px);
		}
		to {
			opacity: 1;
			transform: translateY(0);
		}
	}
}

/* ============================================
   HOVER EFFECTS
   ============================================ */

.one-tap-success:hover {
	transform: scale(1.02);
	box-shadow: 
		0 15px 50px rgba(0, 0, 0, 0.15),
		0 5px 15px rgba(0, 0, 0, 0.08);
	transition: all 0.3s ease;
}

/* ============================================
   INVITATION MODAL STYLING
   ============================================ */

.one-tap-invitation-modal {
	animation: fadeIn 0.3s ease;
}

.one-tap-invitation-content {
	animation: slideUp 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Pulse effect for Google Sign-In buttons when they appear */
@keyframes pulseOnce {
	0% {
		box-shadow: 0 0 0 0 rgba(66, 133, 244, 0.4);
	}
	50% {
		box-shadow: 0 0 0 20px rgba(66, 133, 244, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(66, 133, 244, 0);
	}
}

#google-signin-login > div,
#google-signin-register > div {
	animation: pulseOnce 1s ease-out;
}
/* ====== PRICING SECTION (glass cards & badges) ====== */
.pricing-wrap{position:relative;left:50%;right:50%;margin-left:-50vw;margin-right:-50vw;width:100vw;max-width:100vw;background:
  radial-gradient(1100px 500px at 50% -50px, rgba(236,72,153,.25), transparent),
  radial-gradient(1100px 500px at 50% 100%, rgba(99,102,241,.25), transparent),
  #0b0b14;}
.pricing-card{
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 1rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.45);
}
.pricing-badge{font-size:10px;font-weight:800;padding:.25rem .5rem;border-radius:9999px}
.pricing-pill{font-size:.75rem;font-weight:800;padding:.25rem .5rem;border-radius:9999px;border:1px solid rgba(255,255,255,.25)}
.pricing-faq{background: rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.1);border-radius:.75rem}
.pricing-cta{
  border-radius: .75rem; font-weight: 800; padding: .85rem 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.pricing-cta--primary{background:#fde047;color:#111}
.pricing-cta--primary:hover{filter:brightness(1.05)}
.pricing-cta--ghost{background:rgba(255,255,255,.08);color:#fff;border:1px solid rgba(255,255,255,.2)}
.pricing-cta--ghost:hover{background:rgba(255,255,255,.12)}
/* Ensure list icons align nicely */
.pricing-li{display:flex;gap:.75rem}
.pricing-li i{margin-top:.2rem}
/* Dark text fixes specifically for the pricing section */
.pricing-dark h1,
.pricing-dark h2,
.pricing-dark h3,
.pricing-dark h4,
.pricing-dark h5,
.pricing-dark h6 { color:#fff !important; }

.pricing-dark p,
.pricing-dark li,
.pricing-dark .copy { color: rgba(255,255,255,. Nine)!important; } /* 0.9 opacity */

/* Override common Tailwind text utilities that are causing black text */
.pricing-dark .text-black,
.pricing-dark .text-gray-900,
.pricing-dark .text-gray-800,
.pricing-dark .text-gray-700 { color:#ffffff !important; }

.pricing-dark .text-gray-600,
.pricing-dark .text-gray-500,
.pricing-dark .text-gray-400 { color: rgba(255,255,255,.75) !important; }

/* Keep contrast correct on light buttons inside dark area */
.pricing-dark .bg-white,
.pricing-dark .bg-yellow-300 { color:#111 !important; }

.pricing-dark .pricing-card p { color: rgba(255,255,255,.85) !important; }
.pricing-dark .pricing-faq p { color: rgba(255,255,255,.85) !important; }
