/* === NEXBOT Theme Custom CSS === */

/* Base */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', 'Noto Sans SC', sans-serif;
  background: #161421;
  color: #fff;
  overflow-x: hidden;
}

/* Noise Texture Overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.035;
  pointer-events: none;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

/* Grid Background */
.grid-bg {
  background-image:
    linear-gradient(rgba(95,187,182,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(95,187,182,0.04) 1px, transparent 1px);
  background-size: 80px 80px;
}

/* Gradient Utilities */
.gradient-text {
  background: linear-gradient(45deg, #5FBBB6, #1D3C87);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-border {
  position: relative;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(95,187,182,0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.gradient-border:hover {
  border-color: rgba(95,187,182,0.4);
  box-shadow: 0 0 40px rgba(95,187,182,0.08), inset 0 0 40px rgba(95,187,182,0.03);
  transform: translateY(-4px);
}

/* Infinity Curve Drawing Animation */
.infinity-path {
  stroke-dasharray: var(--path-length);
  stroke-dashoffset: var(--path-length);
  animation: drawCurve 3s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
}
@keyframes drawCurve {
  to { stroke-dashoffset: 0; }
}

/* Hero Text Stagger */
.hero-stagger { opacity: 0; transform: translateY(40px); }
.hero-stagger.visible {
  animation: fadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-stagger.d1 { animation-delay: 1.2s; }
.hero-stagger.d2 { animation-delay: 1.7s; }
.hero-stagger.d3 { animation-delay: 2.2s; }
.hero-stagger.d4 { animation-delay: 2.6s; }
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Infinity Float */
.infinity-float {
  animation: floatSlow 8s ease-in-out infinite;
}
@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(2deg); }
}

/* Pulse Glow */
.pulse-glow {
  animation: pulseGlow 4s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(95,187,182,0.15)); }
  50% { filter: drop-shadow(0 0 40px rgba(95,187,182,0.3)); }
}

/* Nav */
.nav-glass {
  background: rgba(22,20,33,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(95,187,182,0.08);
  transition: all 0.3s ease;
}
.nav-glass.scrolled {
  background: rgba(22,20,33,0.95);
  border-bottom-color: rgba(95,187,182,0.15);
}

/* Counter */
.counter-value {
  font-variant-numeric: tabular-nums;
}

/* Button Gradient */
.btn-gradient {
  background: linear-gradient(45deg, #5FBBB6, #1D3C87);
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}
.btn-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, #1D3C87, #5FBBB6);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.btn-gradient:hover::before {
  opacity: 1;
}
.btn-gradient span {
  position: relative;
  z-index: 1;
}

.btn-outline {
  border: 1px solid rgba(95,187,182,0.4);
  color: #5FBBB6;
  transition: all 0.4s ease;
}
.btn-outline:hover {
  background: rgba(95,187,182,0.1);
  border-color: #5FBBB6;
  box-shadow: 0 0 30px rgba(95,187,182,0.15);
}

/* Section Divider */
.section-glow { position: relative; }
.section-glow::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(95,187,182,0.3), transparent);
}

/* News Card Date Tag */
.date-tag {
  background: linear-gradient(45deg, #5FBBB6, #1D3C87);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  font-family: 'Syne', sans-serif;
}

/* Mobile Menu */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.mobile-menu.open {
  transform: translateX(0);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #161421; }
::-webkit-scrollbar-thumb { background: rgba(95,187,182,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(95,187,182,0.5); }

/* Card Icon Container */
.icon-ring {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(95,187,182,0.1), rgba(29,60,135,0.1));
  border: 1px solid rgba(95,187,182,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s ease;
}
.gradient-border:hover .icon-ring {
  border-color: rgba(95,187,182,0.4);
  box-shadow: 0 0 20px rgba(95,187,182,0.1);
}

/* Decorative Dots */
.dot-pattern {
  background-image: radial-gradient(rgba(95,187,182,0.08) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Footer Links */
.footer-link {
  color: #B0B8C8;
  transition: color 0.3s ease;
}
.footer-link:hover {
  color: #5FBBB6;
}

/* Line Clamp */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* WP Nav Menu styling for primary menu */
#navbar .menu-item a {
  font-size: 0.875rem;
  color: #B0B8C8;
  transition: color 0.3s;
  text-decoration: none;
}
#navbar .menu-item a:hover,
#navbar .menu-item.current-menu-item a {
  color: #fff;
}

/* WP Pagination styling */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-links .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 9999px;
  font-family: 'Syne', sans-serif;
  font-size: 0.875rem;
  color: #B0B8C8;
  border: 1px solid rgba(95,187,182,0.2);
  text-decoration: none;
  transition: all 0.3s ease;
}
.nav-links .page-numbers:hover {
  border-color: #5FBBB6;
  color: #fff;
}
.nav-links .page-numbers.current {
  background: linear-gradient(45deg, #5FBBB6, #1D3C87);
  border-color: transparent;
  color: #fff;
}
.nav-links .page-numbers.next,
.nav-links .page-numbers.prev {
  border-color: transparent;
}
.nav-links .page-numbers.next:hover,
.nav-links .page-numbers.prev:hover {
  color: #5FBBB6;
}

/* === Custom Logo — proportional scaling, zero crop === */

/* Nav bar: fit within 200px wide x 40px tall, scale down proportionally */
.custom-logo-link {
  display: flex;
  align-items: center;
}
.custom-logo-link img.custom-logo {
  max-width: 200px;
  max-height: 40px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.custom-logo-link:hover img.custom-logo {
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

/* Footer: smaller bounding box */
footer .custom-logo-link img.custom-logo {
  max-width: 160px;
  max-height: 32px;
}

/* Mobile: tighter limits */
@media (max-width: 768px) {
  .custom-logo-link img.custom-logo {
    max-width: 160px;
    max-height: 32px;
  }
  footer .custom-logo-link img.custom-logo {
    max-width: 120px;
    max-height: 28px;
  }
}
