@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --bg-primary: #050B17;
  --bg-secondary: #0A1730;
  --surface: #101E38;
  --surface-hover: #162747;
  --primary: #1473E6;
  --primary-light: #258BFF;
  --primary-glow: rgba(37, 139, 255, 0.25);
  --text-primary: #F5F7FA;
  --text-secondary: #94A3B8;
  --border: #263752;
  --border-hover: rgba(37, 139, 255, 0.5);
  --success: #22C55E;
  --danger: #EF4444;
  --warning: #F59E0B;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

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

html {
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 80% 10%, rgba(37, 139, 255, 0.12), transparent 40%),
    radial-gradient(circle at 20% 80%, rgba(20, 115, 230, 0.08), transparent 45%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main,
body > main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 100%;
}

header.sticky,
header {
  position: sticky;
  top: 0;
  z-index: 50;
}

img, svg, video, canvas, audio, iframe, embed, object {
  max-width: 100%;
  height: auto;
  display: block;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}

/* Container */
.web-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 0.75rem;
}

@media (min-width: 640px) {
  .web-container {
    padding: 0 1.5rem;
  }
}

/* Glassmorphism Cards */
.trx-card {
  background: rgba(16, 30, 56, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 640px) {
  .trx-card {
    border-radius: var(--radius-lg);
  }
}

.trx-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 20px 50px rgba(20, 115, 230, 0.15);
}

.trx-card-glow {
  position: relative;
  overflow: hidden;
}

.trx-card-glow::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(37, 139, 255, 0.12) 0%, transparent 60%);
  pointer-events: none;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #1473E6 0%, #258BFF 100%);
  color: #FFFFFF;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  padding: 10px 20px;
  font-size: 0.875rem;
  box-shadow: 0 8px 24px var(--primary-glow);
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 640px) {
  .btn-primary {
    padding: 12px 24px;
    font-size: 0.9375rem;
  }
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(37, 139, 255, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(16, 30, 56, 0.7);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 640px) {
  .btn-secondary {
    padding: 12px 24px;
    font-size: 0.9375rem;
  }
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--primary-light);
  color: var(--primary-light);
  transform: translateY(-2px);
}

/* Inputs */
.trx-input {
  width: 100%;
  background: rgba(10, 23, 48, 0.85);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

@media (min-width: 640px) {
  .trx-input {
    padding: 14px 18px;
    font-size: 0.95rem;
  }
}

.trx-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(37, 139, 255, 0.2);
}

.trx-input::placeholder {
  color: var(--text-secondary);
}

/* Ticker Marquee */
.ticker-wrap {
  width: 100%;
  background: rgba(10, 23, 48, 0.8);
  border: 1px solid var(--border);
  border-radius: 40px;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 8px 14px;
}

@media (min-width: 640px) {
  .ticker-wrap {
    padding: 10px 20px;
  }
}

.ticker-viewport {
  overflow: hidden;
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.ticker-content {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  animation: tickerScroll 120s linear infinite;
  will-change: transform;
}

.ticker-wrap:hover .ticker-content {
  animation-play-state: paused;
}

@keyframes tickerScroll {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

/* Badges */
.badge-vip {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #FFFFFF;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.badge-blue {
  background: rgba(37, 139, 255, 0.15);
  color: var(--primary-light);
  border: 1px solid rgba(37, 139, 255, 0.3);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Responsive Table Wrapper */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

/* Prevent auto-zooming on mobile iOS/Android to stop viewport clipping */
@media (max-width: 767px) {
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Modals & Dialogs Mobile Auto-Fit & Scrollability */
[id$="Modal"],
.modal-overlay {
  max-width: 100vw;
  width: 100%;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

[id$="Modal"] > div,
[id$="Modal"] .trx-card,
.modal-dialog {
  max-width: min(100%, calc(100vw - 1rem));
}

@media (max-width: 640px) {
  .trx-card {
    padding: 0.875rem !important;
  }

  [id$="Modal"]:not(.hidden),
  .modal-overlay:not(.hidden) {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0.75rem 0.5rem calc(2.5rem + env(safe-area-inset-bottom, 16px)) !important;
  }

  [id$="Modal"] > div,
  [id$="Modal"] .trx-card,
  .modal-dialog {
    max-height: none !important;
    margin: 0.5rem auto 1.5rem auto !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

[id$="Modal"] .overflow-y-auto,
.modal-dialog .overflow-y-auto,
[id$="RecordsList"],
[id$="PagesContainer"],
.task-rich-content {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

/* Text Wrapping & Hash Protection */
.font-mono, .wallet-address, .tx-hash, .break-all {
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
}

/* Fast Touch Response */
a, button, input, select, textarea {
  touch-action: manipulation;
}

/* Hide Scrollbar helper without breaking scroll */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Mobile Fixed Bottom Navigation Bar */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100vw;
  z-index: 50;
  background: rgba(10, 23, 48, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.5);
}

@media (min-width: 768px) {
  .mobile-bottom-nav {
    display: none !important;
  }
}

.nav-bottom-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 4px 2px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  flex: 1;
  text-align: center;
  cursor: pointer;
  min-width: 0;
  -webkit-tap-highlight-color: transparent;
}

.nav-bottom-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.nav-bottom-item * {
  pointer-events: none;
}

.nav-bottom-item.active, .nav-bottom-item:hover {
  color: var(--primary-light);
}

.nav-bottom-item.active i, .nav-bottom-item.active svg {
  color: var(--primary-light);
  transform: translateY(-1px);
}

/* Page bottom offset for mobile fixed bottom bar & floating buttons */
.pb-mobile-nav,
body.pb-mobile-nav,
body.pb-mobile-nav > main,
main.pb-mobile-nav {
  padding-bottom: calc(105px + env(safe-area-inset-bottom, 16px)) !important;
}

@media (max-width: 767px) {
  main,
  body > main,
  .pb-mobile-nav,
  body.pb-mobile-nav,
  body.pb-mobile-nav > main {
    padding-bottom: calc(105px + env(safe-area-inset-bottom, 16px)) !important;
  }
}

@media (min-width: 768px) {
  .pb-mobile-nav,
  body.pb-mobile-nav,
  body.pb-mobile-nav > main,
  main.pb-mobile-nav,
  body > main {
    padding-bottom: 2.5rem !important;
  }
}

