html, body { height: 100%; overflow: hidden; }

/* Custom scrollbar styles */
.contact-container {
  scroll-behavior: smooth;
  /* Force scrollbar to always be visible on the right side */
  overflow-y: scroll;
}

.contact-container::-webkit-scrollbar {
  width: 14px;
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
}

.contact-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 7px 0 0 7px;
  margin: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 7px 0 0 7px;
  transition: background 0.2s ease;
  border: none;
  margin-right: 0;
}

.contact-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.7);
}

.contact-container::-webkit-scrollbar-corner {
  background: rgba(255, 255, 255, 0.05);
}

/* Firefox scrollbar */
.contact-container {
  scrollbar-width: auto;
  scrollbar-color: rgba(255, 255, 255, 0.5) rgba(255, 255, 255, 0.15);
}
body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #1e2329;
  color: #ffffff;
}

.contact-container {
  max-width: 840px;
  margin: 0 auto;
  padding: clamp(12px, 4vh, 24px) 16px clamp(20px, 6vh, 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* top-center layout */
  text-align: center;
  height: 100vh;
  min-height: 100vh; /* take full viewport height */
  overflow-y: auto; /* auto vertical scroll - only show when needed */
  overflow-x: hidden; /* hide horizontal scroll */
  margin-bottom: 100px; /* add bottom margin to avoid footer overlap */
  /* Ensure scrollbar appears on the right side when needed */
  scrollbar-width: auto;
  scrollbar-gutter: auto;
  /* Position scrollbar at the very right edge */
  position: relative;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 8px;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.back-btn {
  background: none;
  border: none;
  color: #ffd900;
  font-weight: bold;
  cursor: pointer;
  font-size: 12px;
}

.title {
  font-size: 16px;
  margin: 0;
}

.hint {
  font-size: 12px;
  opacity: 0.8;
  margin: clamp(4px, 1.5vh, 12px) 0 clamp(6px, 2vh, 14px) 0;
}

/* Language dropdown styles */
.language-dropdown {
  position: relative;
  display: inline-block;
}

.language-dropdown-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
  min-width: 120px;
  justify-content: center;
}

.language-dropdown-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.language-dropdown-btn:active {
  transform: translateY(0);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: #0f141a;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 8px 0;
  min-width: 150px;
  z-index: 1000;
  display: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  margin-top: 4px;
}

.dropdown-menu.show {
  display: block;
  animation: fadeInDown 0.2s ease;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  padding: 10px 16px;
  cursor: pointer;
  color: white;
  transition: background 0.2s ease;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.dropdown-item:active {
  background: rgba(255, 255, 255, 0.15);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  justify-content: center;
  align-content: flex-start;
  justify-items: center; /* center items horizontally */
  width: 100%;
  padding-bottom: 40px; /* increase bottom padding for better scrolling */
  min-height: auto; /* let content determine height naturally */
}

.card {
  background-color: #0f141a;
  border-radius: 12px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: clamp(240px, 60vmin, 360px);
}

.qr-img {
  width: clamp(160px, 40vmin, 320px);
  height: clamp(160px, 40vmin, 320px);
  border-radius: 10px;
  object-fit: cover;
  background: #222;
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: transform 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

.qr-img:hover {
  transform: scale(1.05);
}

/* Add smooth scrolling for QR images */
.qr-img {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Make QR images draggable */
.qr-img {
  cursor: grab;
}

.qr-img:active {
  cursor: grabbing;
}

/* Add touch scrolling support */
.card {
  overflow: hidden;
  touch-action: pan-x pan-y;
}

.line-id {
  font-size: 12px;
  word-break: break-all;
}

.actions {
  margin-top: 6px;
}

.copy-btn {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.copy-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.copy-btn:active {
  transform: translateY(0);
}

.loading, .error, .empty {
  text-align: center;
  padding: 20px;
  font-size: 14px;
  opacity: 0.8;
}

.error {
  color: #ef4444;
}

.empty {
  color: #9ca3af;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  cursor: pointer;
}

.overlay img {
  max-width: 95%;
  max-height: 95%;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

/* Footer styles */
.footer-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background-color: #0f141a;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;
  padding: 12px 0;
}

.footer-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 20px;
}

.footer-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #ffffff;
  text-decoration: none;
  font-size: 12px;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.footer-nav-item:hover {
  opacity: 1;
}

.footer-nav-item.active {
  opacity: 1;
  color: #3b82f6;
}

.footer-nav-item i {
  font-size: 18px;
}

/* Responsive design */
@media (min-width: 1200px) {
  .qr-img {
    width: clamp(200px, 50vmin, 400px);
    height: clamp(200px, 50vmin, 400px);
  }
  
  .card {
    padding: 20px 16px;
  }
}

@media (max-width: 768px) {
  .header-row {
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }
  
  .header-center {
    justify-content: center;
  }
  
  .header-actions {
    justify-content: center;
  }
  
  .language-dropdown-btn {
    min-width: 100px;
    font-size: 12px;
    padding: 6px 12px;
  }
  
  .dropdown-menu {
    right: 50%;
    transform: translateX(50%);
  }
  
  .qr-img {
    width: clamp(180px, 45vmin, 340px);
    height: clamp(180px, 45vmin, 340px);
  }
  
  .overlay img {
    max-width: 96%;
    max-height: 96%;
  }
}

@media (max-width: 480px) {
  .contact-container {
    padding: 12px 12px 0;
  }
  
  .card-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .card {
    width: 100%;
    max-width: 300px;
  }
  
  .qr-img {
    width: clamp(200px, 55vmin, 380px);
    height: clamp(200px, 55vmin, 380px);
  }
  
  .overlay img {
    max-width: 98%;
    max-height: 98%;
    border-radius: 4px;
  }
}

@media (max-width: 360px) {
  .qr-img {
    width: clamp(160px, 50vmin, 320px);
    height: clamp(160px, 50vmin, 320px);
  }
  
  .card {
    padding: 12px 8px;
  }
}


