/* Root Variables */
:root {
  --primary: #00f0ff;
  --secondary: #00ff88;
  --dark: #0a0e27;
  --dark-light: #1a1f3a;
  --text: #ffffff;
  --text-muted: #a0aec0;
  --danger: #ff4444;
  --success: #00ff88;
  --warning: #ffaa00;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-content {
    text-align: center;
    color: white;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 300px;
}


.loading-text {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.loading-progress {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.loading-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00f0ff, #00ff88);
    border-radius: 3px;
    transition: width 0.3s ease;
    animation: progressPulse 2s ease-in-out infinite;
}

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

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Mobile Marquee Fixes */
@media (max-width: 768px) {
    .marquee-container {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        will-change: transform;
        overflow: hidden;
    }
    
    .marquee-content {
        animation-duration: 20s; /* Slower on mobile */
        animation-timing-function: linear;
        animation-iteration-count: infinite;
        animation-play-state: running;
        white-space: nowrap;
        will-change: transform;
    }
    
    .marquee-content.paused {
        animation-play-state: paused;
    }
    
    .marquee-container:hover .marquee-content {
        animation-play-state: paused;
    }
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--dark);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--dark);
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 240, 255, 0.5);
}

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

.btn-outline:hover {
  background: var(--primary);
  color: var(--dark);
}

.btn-large {
  padding: 16px 40px;
  font-size: 18px;
}

.btn-block {
  width: 100%;
  display: block;
}

/* Marquee Notification */
.marquee-container {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  padding: 12px 0;
  overflow: hidden;
  position: relative;
}

.marquee-content {
  will-change: transform;
  transform: translateZ(0);
  display: inline-block;
  white-space: nowrap;
  animation: marquee 30s linear infinite;
  color: var(--dark);
  font-weight: 600;
  font-size: 14px;
}

/* Homepage marquee responsiveness */
.homepage .marquee-container { border-radius: 0; }
.homepage .marquee-content { will-change: transform; transform: translateZ(0); }

/* Dashboard marquee responsiveness */
.dashboard-page .main-content {
  overflow-x: hidden; /* prevent horizontal scroll from marquee overflow */
}
.dashboard-page .marquee-container {
  border-radius: 10px;
  padding: 8px 0;
  margin-bottom: 16px;
}
.dashboard-page .marquee-content {
  font-size: 13px;
  padding: 0 20px; /* breathing room on sides */
  will-change: transform;
}
@media (max-width: 1024px) {
  .dashboard-page .marquee-content { font-size: 12px; }
}
@media (max-width: 640px) {
  .dashboard-page .marquee-container { padding: 6px 0; }
  .dashboard-page .marquee-content { font-size: 11px; animation-duration: 24s; }
}

@keyframes marquee {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Animated Background Orbs */
.bg-orbs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: float 20s infinite ease-in-out;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: var(--primary);
  top: -200px;
  left: -200px;
  animation-delay: 0s;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: var(--secondary);
  bottom: -150px;
  right: -150px;
  animation-delay: 5s;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: var(--primary);
  top: 50%;
  left: 50%;
  animation-delay: 10s;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(50px, -50px) scale(1.1);
  }
  66% {
    transform: translate(-50px, 50px) scale(0.9);
  }
}

/* Navigation */
.navbar {
  padding: 20px 0;
  position: relative;
  z-index: 100;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img {
  height: 85px;
}

.nav-buttons {
  display: flex;
  gap: 15px;
}

/* Hero Section */
.hero {
  padding: 100px 0;
  text-align: center;
  position: relative;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-size: 64px;
  font-weight: 700;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.typing-text {
  display: inline-block;
  border-right: 3px solid var(--primary);
  animation: blink 0.7s infinite;
}

@keyframes blink {
  0%,
  100% {
    border-color: transparent;
  }
  50% {
    border-color: var(--primary);
  }
}

.hero-subtitle {
  font-size: 20px;
  color: var(--text-muted);
  margin-bottom: 40px;
  line-height: 1.8;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 60px;
  margin: 60px 0;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 48px;
  font-weight: 700;
  color: var(--primary);
  font-family: "Space Grotesk", sans-serif;
}

.stat-label {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Sections */
.how-it-works,
.why-choose,
.cta-section {
  padding: 80px 0;
}

.section-title {
  font-size: 45px;
  text-align: center;
  margin-bottom: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Steps Grid */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.step-card {
  background: rgba(26, 31, 58, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 16px;
  padding: 30px;
  text-align: center;
  transition: all 0.3s ease;
  opacity: 1;
  transform: translateY(0);
}

.step-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.step-card:hover {
  transform: translateY(-10px);
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(0, 240, 255, 0.3);
}

.step-number {
  font-size: 48px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
  font-family: "Space Grotesk", sans-serif;
}

.step-card h3 {
  font-size: 24px;
  margin-bottom: 15px;
}

.step-card p {
  color: var(--text-muted);
  line-height: 1.8;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.feature-card {
  background: rgba(26, 31, 58, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 16px;
  padding: 30px;
  transition: all 0.3s ease;
  opacity: 1;
  transform: translateY(0);
}

.feature-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.feature-card:hover {
  transform: translateY(-10px);
  border-color: var(--secondary);
  box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3);
}

.feature-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 22px;
  margin-bottom: 15px;
}

.feature-card p {
  color: var(--text-muted);
  line-height: 1.8;
}

/* CTA Section */
.cta-section {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(0, 255, 136, 0.1));
  border-radius: 20px;
  margin: 0 20px;
}

.cta-content {
  text-align: center;
  padding: 60px 20px;
}

.cta-content h2 {
  font-size: 42px;
  margin-bottom: 20px;
}

.cta-content p {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 30px;
}

/* Footer */
.footer {
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 80px;
}

/* Auth Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--dark-light);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 20px;
  padding: 40px;
  max-width: 450px;
  width: 90%;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 32px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.3s;
}

.modal-close:hover {
  color: var(--primary);
}

.auth-form h2 {
  font-size: 32px;
  margin-bottom: 10px;
  text-align: center;
}

.form-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text);
  font-size: 16px;
  transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1);
}

.form-footer {
  text-align: center;
  margin-top: 20px;
  color: var(--text-muted);
}

.form-footer a {
  color: var(--primary);
  text-decoration: none;
}

.form-footer a:hover {
  text-decoration: underline;
}

.wallet-display {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary);
  font-family: "Space Grotesk", monospace;
  padding: 15px;
  background: rgba(0, 240, 255, 0.1);
  border-radius: 8px;
  margin: 15px 0;
}

/* Toast Notifications */
#toastContainer {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* PWA install button */
.pwa-install-btn {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 10000;
  padding: 12px 16px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--dark);
  font-weight: 600;
  box-shadow: 0 6px 22px rgba(0,0,0,0.35);
  cursor: pointer;
}
.pwa-install-btn:hover { transform: translateY(-1px); }

/* PWA install banner */
.pwa-install-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  background: rgba(10,14,39,0.95);
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 10px 14px;
}
.pwa-install-banner .banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pwa-install-banner .banner-text { color: #cfeaff; font-weight: 500; }
.pwa-install-banner .banner-actions { display: flex; gap: 10px; }

/* Coin drop animation when reward is received */
.coin-drop {
  position: fixed;
  top: -40px;
  font-size: 24px;
  animation: coin-fall 1.2s ease-out forwards;
  pointer-events: none;
  z-index: 9999;
}
@keyframes coin-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

/* Search success note */
.search-success-note {
  background: rgba(0, 255, 136, 0.12);
  border: 1px solid rgba(0, 255, 136, 0.35);
  color: #bfffd8;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.toast {
  background: var(--dark-light);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 16px 20px;
  min-width: 300px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: translateX(400px);
  transition: transform 0.3s ease;
}

.toast.show {
  transform: translateX(0);
}

.toast-success {
  border-left: 4px solid var(--success);
}

.toast-error {
  border-left: 4px solid var(--danger);
}

.toast-warning {
  border-left: 4px solid var(--warning);
}

.toast-info {
  border-left: 4px solid var(--primary);
}

/* Dashboard Styles */
.dashboard-page {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 280px;
  background: var(--dark-light);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  transition: transform 0.3s ease;
  z-index: 1000;
}

.sidebar-header {
  padding: 30px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: -20px;
}

.sidebar-logo {
  height: 50px;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 32px;
  cursor: pointer;
}

.sidebar-nav {
  padding: 20px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.3s;
  position: relative;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(0, 240, 255, 0.1);
  color: var(--primary);
}

.nav-icon {
  font-size: 20px;
  margin-right: 12px;
}

.badge {
  position: absolute;
  right: 20px;
  background: var(--danger);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  position: absolute;
  bottom: 0;
  width: 100%;
}

.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: var(--dark-light);
  border-radius: 12px;
  margin-bottom: 30px;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}

.user-wallet {
  font-family: "Space Grotesk", monospace;
  color: var(--primary);
  font-weight: 600;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--dark-light);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 12px;
  padding: 25px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.stat-icon {
  font-size: 40px;
}

.stat-info {
  flex: 1;
}

.stat-label {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  font-family: "Space Grotesk", sans-serif;
}

.dashboard-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
}

.info-card {
  background: var(--dark-light);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 12px;
  padding: 25px;
}

.info-card h3 {
  margin-bottom: 20px;
  color: var(--primary);
}

.tier-progress {
  margin-top: 15px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
}

.progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.3s ease;
}

.quick-stats {
  list-style: none;
}

.quick-stats li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
}

.quick-stats li:last-child {
  border-bottom: none;
}

/* Search Section */
.search-container {
  max-width: 700px;
  margin: 0 auto;
}

/* Exhausted banner */
.exhausted-banner {
  background: rgba(255, 196, 0, 0.12);
  border: 1px solid rgba(255, 196, 0, 0.35);
  color: #ffe7a1;
  padding: 10px 12px;
  border-radius: 8px;
  margin: 10px 0 20px 0;
}

/* AI Answer box */
.ai-answer {
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid rgba(0, 240, 255, 0.25);
  color: #d8f7ff;
  padding: 12px 14px;
  border-radius: 10px;
  margin-top: 20px;
  margin-bottom: 20px;
}
.ai-answer-title {
  font-weight: 700;
  color: #8bf4ff;
  margin-bottom: 30px;
}
/*#aiAnswerText {*/
/*  white-space: pre-wrap;*/
/*}*/

/* Hide any generic related searches boxes if present */
.related,
.related-searches,
.related-box,
.related-results {
  display: none !important;
}

/* Question and Answer styles */
.search-question {
  display: block;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
}

.question-label {
  font-weight: 600;
  color: var(--secondary);
  font-size: 14px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.question-text {
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  background: rgba(0, 255, 136, 0.05);
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 3px solid var(--secondary);
}

.ai-response {
  display: block;
  margin-top: 6px;
}

.answer-label {
  font-weight: 600;
  color: var(--primary);
  font-size: 14px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.answer-text {
  color: #d8f7ff;
  line-height: 1.6;
  font-size: 15px;
  background: rgba(0, 240, 255, 0.03);
  padding: 12px 14px;
  border-radius: 8px;
  border-left: 3px solid var(--primary);
}

/* Referral share buttons */
.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: #e8f3ff;
  cursor: pointer;
  transition: transform .08s ease, background .2s ease, border-color .2s ease;
  font-weight: 500;
}
.share-btn .icon { display:inline-flex; width:16px; height:16px; align-items:center; justify-content:center; }
.share-btn .icon svg { width:16px; height:16px; display:block; }
.share-btn:hover { transform: translateY(-1px); background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.25); }
.share-btn:active { transform: translateY(0); }
.share-btn.share-whatsapp { border-color: rgba(37,211,102,0.5); }
.share-btn.share-facebook { border-color: rgba(24,119,242,0.5); }
.share-btn.share-tiktok { border-color: rgba(255,255,255,0.45); }
.share-btn.share-twitter { border-color: rgba(29,155,240,0.5); }
.share-btn.share-telegram { border-color: rgba(0,136,204,0.5); }
.share-btn.share-copy { border-color: rgba(255,255,255,0.25); }
.share-hint { margin-top: 6px; opacity: .75; font-size: 12px; }

.search-info-box {
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid var(--primary);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
}

.search-stats {
  margin-top: 10px;
  font-size: 16px;
}

.search-form {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.search-form input {
  flex: 1;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--text);
  font-size: 16px;
}

.search-form .btn,
.annotate-form .btn {
  padding: 14px 22px;
  border-radius: 10px;
  font-weight: 700;
  min-width: 170px;
}

.reward-info {
  text-align: center;
}

.reward-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--dark);
  padding: 12px 22px;
  border-radius: 25px;
  font-weight: 700;
}

.reward-label,
.reward-amount {
  font-size: 20px;
  line-height: 1;
}

.reward-amount {
  font-weight: 700;
}


/* Redirect Page */
.redirect-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.redirect-container {
  text-align: center;
  max-width: 500px;
  padding: 40px;
}

.redirect-content {
  background: var(--dark-light);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 20px;
  padding: 60px 40px;
}

.loader {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(0, 240, 255, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 30px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#countdown {
  font-size: 48px;
  font-weight: 700;
  color: var(--primary);
  font-family: "Space Grotesk", sans-serif;
}

.redirect-info {
  color: var(--text-muted);
  margin-top: 20px;
}

/* Table responsive wrapper */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}
.table-responsive table {
  width: 100%;
  border-collapse: collapse;
}

/* Annotate Section */
.annotate-container {
  max-width: 700px;
  margin: 0 auto;
}
.annotate-card {
  background: var(--dark-light);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 12px;
  padding: 20px;
}
.annotate-image {
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);
  margin-bottom: 12px;
}
.annotate-quote {
  font-size: 18px;
  line-height: 1.6;
  color: #e8f3ff;
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid rgba(0, 240, 255, 0.25);
  padding: 12px 14px;
  border-radius: 10px;
}
.annotate-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.annotate-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-top: 12px;
}
.annotate-form label {
  display: block;
  margin-bottom: 4px;
}
.annotate-form input {
  flex: 1;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--text);
  font-size: 16px;
}
.annotate-hint { display:block; opacity: .7; margin-top: 10px; font-size: 12px; }

/* Referral Section */
.referral-container {
  max-width: 700px;
  margin: 0 auto;
}

/* Profile (Payout) */
.profile-container {
  max-width: 700px;
  margin: 0 auto;
}

.referral-info-card {
  background: var(--dark-light);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 20px;
}

.referral-code-box {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.referral-code-box input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text);
  font-family: "Space Grotesk", monospace;
}

.referral-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.referral-list {
  margin-top: 30px;
}

.referral-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.referral-table th,
.referral-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.referral-table th {
  background: rgba(0, 240, 255, 0.1);
  color: var(--primary);
  font-weight: 600;
}

/* Tier Upgrade */
.upgrade-container {
  max-width: 700px;
  margin: 0 auto;
}

.upgrade-info {
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid var(--primary);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
  text-align: center;
}

.tiers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.tier-card {
  background: var(--dark-light);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 12px;
  padding: 25px;
  transition: all 0.3s;
}

.tier-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
}

.tier-card.current {
  border-color: var(--secondary);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.tier-card.locked {
  opacity: 0.5;
}

.tier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.tier-badge {
  background: var(--secondary);
  color: var(--dark);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.tier-details {
  margin-bottom: 20px;
}

.tier-details p {
  margin: 10px 0;
  color: var(--text-muted);
}

/* Tier requirements list */
.req-list {
  margin-top: 10px;
  list-style: none;
  padding: 0;
}
.req-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin: 6px 0;
}
.req-item .mark {
  width: 18px;
  height: 18px;
}
.req-item.ok {
  color: #9fe7b2;
}
.req-item.bad {
  color: #ffb3b3;
}

.btn-disabled {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Messages */
.messages-container {
  max-width: 700px;
  margin: 0 auto;
}

.message-card {
  background: var(--dark-light);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  width: 100%;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.message-card:hover {
  border-color: var(--primary);
}

.message-card.unread {
  border-color: var(--secondary);
  background: rgba(0, 255, 136, 0.05);
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.message-date {
  font-size: 14px;
  color: var(--text-muted);
}

.message-body {
  color: var(--text-muted);
  line-height: 1.8;
}

.unread-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--secondary);
  color: var(--dark);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

/* Leaderboard */
.leaderboard-container {
  max-width: 1000px;
  margin: 0 auto;
}

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

.leaderboard-table th,
.leaderboard-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-table th {
  background: rgba(0, 240, 255, 0.1);
  color: var(--primary);
  font-weight: 600;
}

.leaderboard-table .top-rank {
  background: rgba(0, 255, 136, 0.05);
}

/* Admin Styles */
.admin-login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.admin-login-container {
  max-width: 400px;
  width: 90%;
}

.admin-login-card {
  background: var(--dark-light);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 20px;
  padding: 40px;
}

.admin-login-card h2 {
  text-align: center;
  margin-bottom: 30px;
}

.error-message {
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
}

.admin-page {
  padding: 20px;
}

.admin-container {
  max-width: 1400px;
  margin: 0 auto;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.admin-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.tab-btn {
  padding: 15px 30px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.admin-stat-card {
  background: var(--dark-light);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 12px;
  padding: 25px;
  text-align: center;
}

.admin-section {
  background: var(--dark-light);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 12px;
  padding: 25px;
  margin-top: 30px;
}

.activity-item {
  padding: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.activity-time {
  color: var(--text-muted);
  font-size: 14px;
}

.admin-filters {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.filter-input {
  flex: 1;
  min-width: 200px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--dark-light);
  border-radius: 12px;
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-table th {
  background: rgba(0, 240, 255, 0.1);
  color: var(--primary);
  font-weight: 600;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.btn-small {
  padding: 6px 12px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-success {
  background: var(--success);
  color: var(--dark);
}

.btn-warning {
  background: var(--warning);
  color: var(--dark);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.badge-success {
  background: var(--success);
  color: var(--dark);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.badge-danger {
  background: var(--danger);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.admin-form {
  max-width: 600px;
  background: var(--dark-light);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 12px;
  padding: 30px;
}

.loading {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
}

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

  /* Annotate form: stack label, input, button vertically on mobile */
  .annotate-form {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .annotate-form label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
  }
  .annotate-form input {
    width: 100%;
  }
  .annotate-form .btn {
    width: 100%;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .hero-stats {
    flex-direction: column;
    gap: 30px;
  }

  .section-title {
    font-size: 32px;
  }

  .steps-grid,
  .features-grid {
    grid-template-columns: 1fr;
  }

  .nav-buttons {
    flex-direction: column;
  }

  /* Dashboard Mobile */
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  /* Click-outside backdrop for mobile sidebar */
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 900;
  }
  .sidebar.active + .sidebar-backdrop {
    display: block;
  }

  .sidebar-close {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .hamburger {
    display: flex;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-info {
    grid-template-columns: 1fr;
  }


  .admin-filters {
    flex-direction: column;
  }


  /* Admin Tabs Mobile */
  .admin-tabs {
    flex-wrap: wrap;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 10px;
  }

  .tab-btn {
    padding: 12px 20px;
    font-size: 14px;
    min-width: auto;
    white-space: nowrap;
  }

  .admin-table {
    font-size: 14px;
  }

  .admin-table th,
  .admin-table td {
    padding: 10px;
  }

  .action-buttons {
    flex-direction: column;
  }
}

/* SweetAlert v1 mobile-friendly sizing */
.sweet-alert {
  box-sizing: border-box !important;
  max-width: 90vw !important;
  width: 90vw !important;
  max-height: 80vh !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

.sweet-overlay { overflow-y: auto !important; }
@media (min-width: 481px) {
  .sweet-alert { max-width: 500px !important; width: auto !important; }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 28px;
  }

  .stat-value {
    font-size: 36px;
  }

  .modal-content {
    padding: 30px 20px;
  }

  #toastContainer {
    left: 10px;
    right: 10px;
  }

  .toast {
    min-width: auto;
  }

  /* Admin Mobile - Extra Small */
  .admin-header {
    flex-direction: column;
    gap: 15px;
  }

  .admin-tabs {
    justify-content: flex-start;
    margin-bottom: 20px;
  }

  .tab-btn {
    padding: 10px 15px;
    font-size: 13px;
    min-width: 0;
    flex-shrink: 0;
  }

  .admin-page {
    padding: 15px;
  }

  .admin-container {
    padding: 0;
  }
}
