:root{
  --bg-light:#f8fafc;--bg-dark:#0f172a;
  --surface-light:#ffffff;--surface-dark:#1e293b;
  --border-light:#e2e8f0;--border-dark:#334155;
  --text-primary-light:#0f172a;--text-primary-dark:#f8fafc;
  --text-secondary-light:#64748b;--text-secondary-dark:#94a3b8;
  --accent:#3b82f6;--accent-hover:#2563eb;--accent-glow:rgba(59,130,246,0.4);
  --success:#10b981;--warning:#f59e0b;--danger:#ef4444;
  --gradient:linear-gradient(135deg,#667eea 0%,#764ba2 100%);
  --shadow-sm:0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow:0 4px 6px -1px rgba(0,0,0,0.1),0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg:0 20px 25px -5px rgba(0,0,0,0.1),0 10px 10px -5px rgba(0,0,0,0.04);
  --radius:.75rem;  --transition:all 0.2s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="dark"]{
  --bg:var(--bg-dark);--surface:var(--surface-dark);
  --border:var(--border-dark);--text-primary:var(--text-primary-dark);
  --text-secondary:var(--text-secondary-dark);
}

[data-theme="light"]{
  --bg:var(--bg-light);--surface:var(--surface-light);
  --border:var(--border-light);--text-primary:var(--text-primary-light);
  --text-secondary:var(--text-secondary-light);
}

*{margin:0;padding:0;box-sizing:border-box}

body{
  font-family:'Inter',system-ui,-apple-system,sans-serif;
  background:var(--bg);color:var(--text-primary);
  line-height:1.5;transition:var(--transition);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  min-height:100vh;
  position:relative;
  overflow-x:hidden;
}

/* Animated background */
.bg-animation{
  position:fixed;inset:0;z-index:-1;
  background:var(--bg);
  overflow:hidden;
}
.bg-animation::before{
  content:'';position:absolute;width:200%;height:200%;
  top:-50%;left:-50%;
  background-image:radial-gradient(circle at 20% 80%,var(--accent-glow) 0%,transparent 50%),
                   radial-gradient(circle at 80% 20%,rgba(139,92,246,0.3) 0%,transparent 50%),
                   radial-gradient(circle at 40% 40%,rgba(236,72,153,0.2) 0%,transparent 50%);
  animation:float 20s ease-in-out infinite;
  -webkit-animation:float 20s ease-in-out infinite;
  -moz-animation:float 20s ease-in-out infinite;
  opacity:0.7;
}
@media(min-width:1200px){
  .bg-animation::before{opacity:0.4;}
}
@keyframes float{
  0%,100%{transform:translate(0,0) rotate(0deg);}
  33%{transform:translate(-30px,-30px) rotate(120deg);}
  66%{transform:translate(30px,-30px) rotate(240deg);}
}
@-webkit-keyframes float{
  0%,100%{-webkit-transform:translate(0,0) rotate(0deg);}
  33%{-webkit-transform:translate(-30px,-30px) rotate(120deg);}
  66%{-webkit-transform:translate(30px,-30px) rotate(240deg);}
}
@-moz-keyframes float{
  0%,100%{-moz-transform:translate(0,0) rotate(0deg);}
  33%{-moz-transform:translate(-30px,-30px) rotate(120deg);}
  66%{-moz-transform:translate(30px,-30px) rotate(240deg);}
}

/* Glass morphism cards */
.glass{
  background:rgba(255,255,255,0.03);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  border:1px solid rgba(255,255,255,0.08);
  box-shadow:0 4px 24px 0 rgba(31,38,135,0.1);
}
/* Fallback for browsers without backdrop-filter support */
@supports not (backdrop-filter: blur(8px)) {
  .glass {
    background:rgba(255,255,255,0.1);
  }
}
[data-theme="light"] .glass{
  background:rgba(255,255,255,0.6);
  border:1px solid rgba(255,255,255,0.2);
}
/* Fallback for light theme without backdrop-filter support */
@supports not (backdrop-filter: blur(8px)) {
  [data-theme="light"] .glass {
    background:rgba(255,255,255,0.85);
  }
}
@media(min-width:1200px){
  .glass{
    backdrop-filter:blur(6px);
    -webkit-backdrop-filter:blur(6px);
  }
}

/* Container */
.container{max-width:1200px;margin:0 auto;padding:1.5rem;position:relative;z-index:1;}
@media(min-width:1400px){
  .container{max-width:1400px;}
}

/* Header */
header{
  display:flex;justify-content:space-between;align-items:center;
  margin-bottom:1.5rem;
  animation:fadeInDown 0.6s ease-out 0s 1 normal both;
  -webkit-animation:fadeInDown 0.6s ease-out 0s 1 normal both;
  -moz-animation:fadeInDown 0.6s ease-out 0s 1 normal both;
  /* Firefox fix for initial opacity */
  opacity:1;
}
.logo{
  font-size:1.125rem;font-weight:800;
  background:var(--gradient);-webkit-background-clip:text;
  -webkit-text-fill-color:transparent;background-clip:text;
  text-decoration:none;display:flex;align-items:center;gap:0.3rem;
}
.logo span{font-size:1.25rem;}
.header-nav{display:flex;align-items:center;gap:1.5rem;}
.alt-link{
  color:var(--text-secondary);text-decoration:none;
  font-size:0.8rem;font-weight:500;
  transition:var(--transition);display:flex;align-items:center;gap:0.2rem;
}
.alt-link:hover{
  color:var(--accent);
  transform:translateX(2px);
  -webkit-transform:translateX(2px);
  -moz-transform:translateX(2px);
}

/* Theme toggle */
.theme-toggle{
  background:var(--surface);border:2px solid var(--border);
  border-radius:2rem;padding:0.25rem;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  width:36px;height:36px;transition:var(--transition);
}
.theme-toggle:hover{
  border-color:var(--accent);
  transform:scale(1.05);
  -webkit-transform:scale(1.05);
  -moz-transform:scale(1.05);
}
.theme-toggle svg{width:16px;height:16px;color:var(--text-primary);}

/* JSON toggle */
.json-toggle{
  background:var(--surface);border:2px solid var(--border);
  border-radius:2rem;padding:0.25rem;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  width:36px;height:36px;transition:var(--transition);
  text-decoration:none;color:var(--text-primary);
  font-weight:700;font-size:0.75rem;
  font-family:ui-monospace,monospace;
}
.json-toggle:hover{
  border-color:var(--accent);
  transform:scale(1.05);
  -webkit-transform:scale(1.05);
  -moz-transform:scale(1.05);
}

/* Hero section */
.hero{
  text-align:center;margin-bottom:2rem;
  /* Firefox workaround: use both instead of backwards */
  animation:fadeIn 0.8s ease-out 0.2s 1 normal both;
  -webkit-animation:fadeIn 0.8s ease-out 0.2s 1 normal both;
  -moz-animation:fadeIn 0.8s ease-out 0.2s 1 normal both;
  /* Initial state for Firefox */
  opacity:0;
  transform:translateY(0);
}
.hero h1{
  font-size:clamp(1.75rem,4vw,2.5rem);font-weight:900;
  line-height:1.1;margin-bottom:0.5rem;
  background:linear-gradient(135deg,var(--text-primary) 0%,var(--accent) 100%);
  -webkit-background-clip:text;-webkit-text-fill-color:transparent;
  background-clip:text;
}
.hero-ip{
  font-family:ui-monospace,monospace;font-size:clamp(1.25rem,3vw,1.75rem);
  font-weight:700;margin:0.75rem 0;
  padding:0.6rem 1.25rem;border-radius:var(--radius);
  background:var(--surface);border:2px solid var(--border);
  display:inline-flex;align-items:center;gap:0.5rem;
  position:relative;
  transition:var(--transition);
}
.hero-ip:hover{
  transform:translateY(-2px);
  -webkit-transform:translateY(-2px);
  -moz-transform:translateY(-2px);
  box-shadow:var(--shadow-lg);
}
.location-text{
  font-size:1rem;color:var(--text-secondary);
  display:flex;align-items:center;justify-content:center;gap:0.5rem;
}

/* Search bar */
.search-section{
  margin-bottom:2rem;
  animation:fadeInUp 0.8s ease-out 0.4s 1 normal both;
  -webkit-animation:fadeInUp 0.8s ease-out 0.4s 1 normal both;
  -moz-animation:fadeInUp 0.8s ease-out 0.4s 1 normal both;
  /* Initial state for Firefox */
  opacity:0;
  transform:translateY(20px);
}
.search-container{
  max-width:700px;margin:0 auto;position:relative;
}
.search-form{display:flex;gap:0.6rem;}
.search-input{
  flex:1;padding:0.6rem 1rem;font-size:0.9rem;
  border:2px solid var(--border);border-radius:var(--radius);
  background:var(--surface);color:var(--text-primary);
  transition:var(--transition);font-family:ui-monospace,monospace;
}
.search-input:focus{
  outline:none;border-color:var(--accent);
  box-shadow:0 0 0 3px var(--accent-glow);
}
.search-btn{
  padding:0.6rem 1.25rem;background:var(--accent);color:white;
  border:none;border-radius:var(--radius);font-weight:600;font-size:0.9rem;
  cursor:pointer;transition:var(--transition);
  display:flex;align-items:center;gap:0.4rem;
}
.search-btn:hover{
  background:var(--accent-hover);
  transform:translateY(-1px);
  -webkit-transform:translateY(-1px);
  -moz-transform:translateY(-1px);
  box-shadow:var(--shadow);
}
.search-btn svg{width:16px;height:16px;}

/* Main grid */
.main-grid{
  display:grid;gap:1.25rem;grid-template-columns:1fr;
  margin-bottom:1.5rem;
}
@media(min-width:900px){
  .main-grid{grid-template-columns:minmax(0,2fr) minmax(0,1fr);}
}
@media(min-width:900px) and (max-width:1200px){
  .main-grid{gap:1rem;}
  .info-card{padding:1rem;}
  .detail-grid{gap:0.6rem;}
}

/* Info cards */
.info-card{
  border-radius:var(--radius);padding:1.5rem;
  animation:fadeInUp 0.8s ease-out 0.6s 1 normal both;
  -webkit-animation:fadeInUp 0.8s ease-out 0.6s 1 normal both;
  -moz-animation:fadeInUp 0.8s ease-out 0.6s 1 normal both;
  /* Initial state for Firefox */
  opacity:0;
  transform:translateY(20px);
  /* Separate transition for hover effects */
  transition:transform 0.2s ease,box-shadow 0.2s ease;
}
.info-card:hover{
  transform:translateY(-2px);
  -webkit-transform:translateY(-2px);
  -moz-transform:translateY(-2px);
  box-shadow:var(--shadow-lg);
}

.card-title{
  font-size:1.125rem;font-weight:700;margin-bottom:1rem;
  display:flex;align-items:center;gap:0.5rem;
}
.card-title svg{width:20px;height:20px;color:var(--accent);}

.detail-grid{display:grid;gap:0.75rem;}
.detail-item{
  display:flex;justify-content:space-between;align-items:center;
  padding:0.6rem;background:var(--bg);border-radius:0.5rem;
  transition:var(--transition);
}
.detail-item:hover{
  background:var(--surface);
  transform:translateX(2px);
  -webkit-transform:translateX(2px);
  -moz-transform:translateX(2px);
}
.detail-label{
  font-size:0.75rem;color:var(--text-secondary);
  font-weight:500;text-transform:uppercase;letter-spacing:0.025em;
}
.detail-value{
  display:flex;align-items:center;gap:0.4rem;
  font-weight:600;color:var(--text-primary);
  font-size:0.85rem;word-break:break-word;
  max-width:60%;
}
@media(max-width:640px){
  .detail-value{max-width:100%;}
}
/* ASN link styling */
.detail-value a[href*="bgp.he.net"]{
  transition:var(--transition);
  border-bottom:1px dashed transparent;
}
.detail-value a[href*="bgp.he.net"]:hover{
  color:var(--accent-hover);
  border-bottom-color:var(--accent-hover);
}
.copy-btn{
  background:none;border:none;padding:0.4rem;
  cursor:pointer;color:var(--text-secondary);
  border-radius:0.375rem;transition:var(--transition);
}
.copy-btn:hover{background:var(--accent-glow);color:var(--accent);}
.copy-btn svg{width:14px;height:14px;}

/* Badges */
.badge-container{display:flex;gap:0.3rem;flex-wrap:wrap;align-items:center;}
.badge{
  display:inline-flex;align-items:center;gap:0.25rem;padding:0.25rem 0.5rem;
  font-size:0.75rem;font-weight:500;border-radius:9999px;
  white-space:nowrap;
}
.badge-success{background:rgba(16,185,129,0.1);color:#10b981;}
.badge-warning{background:rgba(245,158,11,0.1);color:#f59e0b;}
.badge-danger{background:rgba(239,68,68,0.1);color:#ef4444;}
.badge-info{background:rgba(59,130,246,0.1);color:#3b82f6;}
.badge-neutral{background:var(--bg);color:var(--text-secondary);}

/* Badge Tooltips */
.badge {
  position: relative;
  cursor: help;
}

.badge[data-tooltip]::before,
.badge[data-tooltip]::after {
  content: "";
  position: absolute;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 100;
}

.badge[data-tooltip]::before {
  content: attr(data-tooltip);
  background: var(--text-primary);
  color: var(--bg);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 400;
  white-space: normal;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 150px;
  max-width: 250px;
  line-height: 1.4;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.badge[data-tooltip]::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--text-primary);
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
}

.badge[data-tooltip]:hover::before,
.badge[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Mobile touch support for tooltips */
@media (hover: none) {
  .badge[data-tooltip]:active::before,
  .badge[data-tooltip]:active::after {
    opacity: 1;
    visibility: visible;
  }
}

/* Mobile tooltip positioning adjustments */
@media (max-width: 640px) {
  .badge[data-tooltip]::before {
    left: 0;
    transform: translateX(0);
    min-width: auto;
    max-width: calc(100vw - 2rem);
    white-space: normal;
  }
  
  .badge:nth-child(2)[data-tooltip]::before,
  .badge:nth-child(3)[data-tooltip]::before {
    left: auto;
    right: 0;
  }
}

/* Map */
.map-card{
  border-radius:var(--radius);overflow:hidden;
  animation:fadeInUp 0.8s ease-out 0.8s 1 normal both;
  -webkit-animation:fadeInUp 0.8s ease-out 0.8s 1 normal both;
  -moz-animation:fadeInUp 0.8s ease-out 0.8s 1 normal both;
  box-shadow:var(--shadow-lg);
  /* Initial state for Firefox */
  opacity:0;
  transform:translateY(20px);
}
.map-container{
  position:relative;width:100%;aspect-ratio:16/5;
  background:var(--surface);
}
@media(min-width:1200px){
  .map-container{aspect-ratio:16/4.5;}
}
@media(max-width:900px){
  .map-container{aspect-ratio:16/8;}
}
.map-container iframe{
  position:absolute;inset:0;width:100%;height:100%;
  border:0;filter:var(--map-filter);
}
[data-theme="dark"] .map-container iframe{filter:invert(90%) hue-rotate(180deg);}

/* API section */
.api-section{
  animation:fadeInUp 0.8s ease-out 1s 1 normal both;
  -webkit-animation:fadeInUp 0.8s ease-out 1s 1 normal both;
  -moz-animation:fadeInUp 0.8s ease-out 1s 1 normal both;
  /* Initial state for Firefox */
  opacity:0;
  transform:translateY(20px);
}
.api-tabs{
  display:flex;gap:0.3rem;margin-bottom:0.75rem;
  border-bottom:2px solid var(--border);
}
.api-tab{
  padding:0.5rem 1rem;background:none;border:none;
  color:var(--text-secondary);font-weight:600;font-size:0.8rem;
  cursor:pointer;transition:var(--transition);
  position:relative;
}
.api-tab:hover{color:var(--text-primary);}
.api-tab.active{color:var(--accent);}
.api-tab.active::after{
  content:'';position:absolute;bottom:-2px;left:0;right:0;
  height:2px;background:var(--accent);
}

.code-example{
  background:var(--bg-dark);color:#e2e8f0;
  padding:0.75rem;border-radius:0.5rem;
  font-family:ui-monospace,monospace;font-size:0.75rem;
  position:relative;overflow-x:auto;
  margin-bottom:0.5rem;
}
@media(min-width:1200px){
  .code-example{font-size:0.7rem;padding:0.6rem;}
}
.code-example pre{margin:0;white-space:pre-wrap;line-height:1.3;}
.code-copy{
  position:absolute;top:0.4rem;right:0.4rem;
  background:rgba(255,255,255,0.1);color:#e2e8f0;
  padding:0.3rem;border-radius:0.3rem;
  cursor:pointer;transition:var(--transition);
}
.code-copy:hover{background:rgba(255,255,255,0.2);}
.code-copy svg{width:12px;height:12px;}

/* Footer */
footer{
  text-align:center;padding:1.5rem 0 1rem;
  border-top:1px solid var(--border);
  color:var(--text-secondary);font-size:0.8rem;
}
footer a{color:var(--accent);text-decoration:none;}
footer a:hover{text-decoration:underline;}

/* Animations */
@keyframes fadeIn{from{opacity:0;}to{opacity:1;}}
@-webkit-keyframes fadeIn{from{opacity:0;}to{opacity:1;}}
@-moz-keyframes fadeIn{from{opacity:0;}to{opacity:1;}}

@keyframes fadeInUp{from{opacity:0;transform:translateY(20px);}to{opacity:1;transform:translateY(0);}}
@-webkit-keyframes fadeInUp{from{opacity:0;-webkit-transform:translateY(20px);}to{opacity:1;-webkit-transform:translateY(0);}}
@-moz-keyframes fadeInUp{from{opacity:0;-moz-transform:translateY(20px);}to{opacity:1;-moz-transform:translateY(0);}}

@keyframes fadeInDown{from{opacity:0;transform:translateY(-20px);}to{opacity:1;transform:translateY(0);}}
@-webkit-keyframes fadeInDown{from{opacity:0;-webkit-transform:translateY(-20px);}to{opacity:1;-webkit-transform:translateY(0);}}
@-moz-keyframes fadeInDown{from{opacity:0;-moz-transform:translateY(-20px);}to{opacity:1;-moz-transform:translateY(0);}}

/* Toast */
.toast{
  position:fixed;bottom:2rem;left:50%;
  transform:translateX(-50%) translateY(100px);
  -webkit-transform:translateX(-50%) translateY(100px);
  -moz-transform:translateX(-50%) translateY(100px);
  background:var(--accent);color:white;
  padding:0.75rem 1.25rem;border-radius:var(--radius);
  box-shadow:var(--shadow-lg);font-weight:600;
  opacity:0;transition:all 0.3s ease;
  pointer-events:none;z-index:1000;
}
.toast.show{
  opacity:1;
  transform:translateX(-50%) translateY(0);
  -webkit-transform:translateX(-50%) translateY(0);
  -moz-transform:translateX(-50%) translateY(0);
}

/* Mobile optimizations */
@media(max-width:640px){
  .detail-item{flex-direction:column;align-items:flex-start;gap:0.4rem;}
  .api-tabs{overflow-x:auto;-webkit-overflow-scrolling:touch;}
  .search-form{flex-direction:column;}
  .search-btn{width:100%;justify-content:center;}
  .hero h1{font-size:2rem;}
  .hero-ip{font-size:1.25rem;padding:0.5rem 1rem;}
  .json-toggle{width:32px;height:32px;font-size:0.65rem;}
}

/* Viewport height optimizations for large screens */
@media(min-height:800px) and (min-width:900px){
  .hero{margin-bottom:1.25rem;}
  .search-section{margin-bottom:1.25rem;}
  .main-grid{margin-bottom:1.25rem;}
  footer{padding:1.25rem 0 0.75rem;}
}
@media(min-height:900px) and (min-width:1200px){
  .container{padding:0.75rem 1.5rem;}
  header{margin-bottom:0.75rem;}
  .hero{margin-bottom:1rem;}
  .search-section{margin-bottom:1rem;}
  .detail-item{padding:0.5rem;}
  .info-card{padding:1rem;}
}

/* Loading animation */
.loading{
  display:inline-block;width:20px;height:20px;
  border:3px solid var(--border);border-radius:50%;
  border-top-color:var(--accent);
  animation:spin 1s ease-in-out infinite;
  -webkit-animation:spin 1s ease-in-out infinite;
  -moz-animation:spin 1s ease-in-out infinite;
}
.loading-spinner{
  display:inline-block;
  width:16px;
  height:16px;
  border:2px solid rgba(255,255,255,0.3);
  border-radius:50%;
  border-top-color:white;
  animation:spin 0.8s linear infinite;
}

/* Invalid input styles */
.search-input[aria-invalid="true"]{
  border-color:var(--danger);
}
.search-input[aria-invalid="true"]:focus{
  box-shadow:0 0 0 3px rgba(239,68,68,0.3);
}

/* Validation error message */
.validation-error{
  color:var(--danger);
  font-size:0.875rem;
  margin-top:0.5rem;
  padding:0.5rem 0.75rem;
  background:rgba(239,68,68,0.1);
  border-radius:0.375rem;
  border:1px solid rgba(239,68,68,0.2);
  animation:fadeInDown 0.3s ease-out;
  -webkit-animation:fadeInDown 0.3s ease-out;
  -moz-animation:fadeInDown 0.3s ease-out;
}

/* Dark mode validation error */
@media(prefers-color-scheme:dark){
  .validation-error{
    background:rgba(239,68,68,0.15);
    border-color:rgba(239,68,68,0.3);
  }
}

/* Improved button states */
.search-btn:disabled{
  opacity:0.7;
  cursor:not-allowed;
}
.copy-btn{
  position:relative;
}
.copy-btn.copied::after{
  content:"Copied!";
  position:absolute;
  bottom:100%;
  left:50%;
  transform:translateX(-50%);
  background:var(--accent);
  color:white;
  padding:0.25rem 0.5rem;
  border-radius:0.25rem;
  font-size:0.75rem;
  white-space:nowrap;
  pointer-events:none;
  animation:fadeInOut 2s ease;
}
@keyframes fadeInOut{
  0%{opacity:0;transform:translateX(-50%) translateY(0.5rem);}
  20%{opacity:1;transform:translateX(-50%) translateY(0);}
  80%{opacity:1;transform:translateX(-50%) translateY(0);}
  100%{opacity:0;transform:translateX(-50%) translateY(-0.5rem);}
}
@keyframes spin{to{transform:rotate(360deg);}}
@-webkit-keyframes spin{to{-webkit-transform:rotate(360deg);}}
@-moz-keyframes spin{to{-moz-transform:rotate(360deg);}}

/* Syntax highlighting */
.hl-key{color:#7dd3fc;}
.hl-string{color:#a7f3d0;}
.hl-number{color:#fde047;}
.hl-boolean{color:#c084fc;}
.hl-comment{color:#6b7280;}

/* Donation Button */
.donation-btn {
  background: var(--gradient);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow);
}

.donation-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.donation-btn svg {
  width: 16px;
  height: 16px;
}

/* Donation Modal */
.donation-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: contain;
}

.donation-modal.show {
  opacity: 1;
  visibility: visible;
}

.donation-content {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-secondary);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.close-btn:hover {
  background: var(--border);
  color: var(--text-primary);
}

.donation-content h2 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.donation-intro {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.crypto-addresses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.crypto-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
}

.crypto-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.crypto-item h3 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

.crypto-item h3 svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.crypto-logo {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: bold;
  flex-shrink: 0;
}

.btc-logo {
  background: #f7931a;
  color: white;
  font-size: 16px;
  font-family: Arial, sans-serif;
}

.eth-logo {
  background: transparent;
  color: white;
  font-size: 18px;
  font-family: Arial, sans-serif;
}

svg.eth-logo {
  background: none;
}

svg.eth-logo path {
  transition: opacity 0.3s ease;
}

.qr-code-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 1.5rem;
  transition: transform 0.3s ease;
}

.qr-label {
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.crypto-item:hover .qr-label {
  opacity: 1;
}

/* Remove the scale effect on hover */
.crypto-item:hover .qr-code-wrapper {
  /* transform: scale(1.05); */
}

.qr-code {
  width: 100%;
  height: 100%;
  background: white;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  position: relative;
}

/* Remove the shine effect animation too */
.qr-code::before {
  display: none;
}

/* Remove the animated gradient border styles completely */
.qr-code-border {
  display: none;
}

/* Remove the rotation animation */
@keyframes rotateGradient {
  /* removed */
}

/* Keep the corner decoration but make it subtle */
.qr-code::after {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  pointer-events: none;
}

.qr-code canvas,
.qr-code img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

/* Style the generated QR code table if using the library */
.qr-code table {
  border-collapse: collapse;
  margin: 0;
}

.qr-code td {
  padding: 0;
  border: none;
}

.address-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) / 2);
  padding: 0.5rem;
  width: 100%;
  max-width: 100%;
}

.crypto-address {
  font-family: monospace;
  font-size: 0.75rem;
  word-break: break-all;
  flex: 1;
  color: var(--text-secondary);
  text-align: left;
}

.copy-btn.small {
  padding: 0.5rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: calc(var(--radius) / 2);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.copy-btn.small:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
}

.copy-btn.small svg {
  width: 14px;
  height: 14px;
}

/* Mobile optimization for donation modal */
@media(max-width: 640px) {
  .donation-content {
    padding: 1.5rem;
    max-height: calc(100vh - 2rem);
    margin: 1rem auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .close-btn {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
  }
  
  .crypto-addresses {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .qr-code-wrapper {
    width: 160px;
    height: 160px;
  }
  
  .crypto-address {
    font-size: 0.65rem;
  }
  
  .donation-content h2 {
    font-size: 1.5rem;
  }
}

/* Dark mode adjustments for QR codes */
[data-theme="dark"] .qr-code {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Dark mode adjustments for tooltips */
[data-theme="dark"] .badge[data-tooltip]::before {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

[data-theme="dark"] .badge[data-tooltip]::after {
  border-top-color: var(--surface);
}

 