@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&family=Orbitron:wght@400;700;900&display=swap');

:root {
  --neon-primary: #00f0ff;
  --neon-secondary: #ff0055;
  --neon-accent: #ffe600;
  --bg-dark: #050508;
  --bg-card: rgba(10, 10, 15, 0.75);
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: #e2e8f0;
  overflow-x: hidden;
}

.orbitron {
  font-family: 'Orbitron', 'Inter', sans-serif;
  letter-spacing: 0.05em;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.02em;
}

/* Glassmorphism */
.glass {
  background: rgba(5, 5, 8, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 240, 255, 0.1);
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.3), transparent, rgba(255, 0, 85, 0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.5;
  transition: opacity 0.4s ease;
}

.glass-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 15px 35px -10px rgba(0, 240, 255, 0.3);
}

.glass-card:hover::before {
  opacity: 1;
}

/* Gradients */
.text-gradient {
  background: linear-gradient(to right, var(--neon-primary), var(--neon-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Buttons */
.btn-primary {
  background: transparent;
  color: var(--neon-primary);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.75rem 2rem;
  border: 1px solid var(--neon-primary);
  border-radius: 4px;
  text-transform: uppercase;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2), inset 0 0 10px rgba(0, 240, 255, 0.1);
}

.btn-primary:hover {
  background: var(--neon-primary);
  color: var(--bg-dark);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.6), inset 0 0 20px rgba(0, 240, 255, 0.6);
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

/* AI Background Elements */
.cyber-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.08) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -2;
  transform: perspective(500px) rotateX(60deg) translateY(100px) translateZ(-200px);
  animation: gridMove 20s linear infinite;
  transform-origin: bottom center;
}

@keyframes gridMove {
  0% {
    transform: perspective(500px) rotateX(60deg) translateY(0) translateZ(-200px);
  }

  100% {
    transform: perspective(500px) rotateX(60deg) translateY(40px) translateZ(-200px);
  }
}

.bg-glow {
  position: absolute;
  top: 20%;
  left: 50%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 0, 85, 0.15) 0%, transparent 60%);
  transform: translate(-50%, -50%);
  z-index: -1;
  filter: blur(40px);
}

.bg-glow-2 {
  position: absolute;
  bottom: 0%;
  right: 10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.15) 0%, transparent 60%);
  z-index: -1;
  filter: blur(40px);
}

/* Micro-animations */
@keyframes glitch {
  0% {
    clip-path: inset(50% 0 30% 0);
    transform: translate(-2px, 2px);
  }

  20% {
    clip-path: inset(15% 0 60% 0);
    transform: translate(2px, -2px);
  }

  40% {
    clip-path: inset(80% 0 5% 0);
    transform: translate(-2px, 0);
  }

  60% {
    clip-path: inset(40% 0 40% 0);
    transform: translate(2px, 2px);
  }

  80% {
    clip-path: inset(10% 0 80% 0);
    transform: translate(-2px, -2px);
  }

  100% {
    clip-path: inset(30% 0 50% 0);
    transform: translate(0, 0);
  }
}

.glitch-hover:hover {
  animation: glitch 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
  color: var(--neon-secondary);
}

/* Articles */
.article-thumbnail {
  aspect-ratio: 16/9;
  object-fit: cover;
  width: 100%;
  border-bottom: 2px solid var(--neon-primary);
}

.ad-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(45deg,
      rgba(255, 255, 255, 0.02),
      rgba(255, 255, 255, 0.02) 10px,
      rgba(255, 255, 255, 0.05) 10px,
      rgba(255, 255, 255, 0.05) 20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #64748b;
  text-align: center;
  padding: 2rem;
  min-height: 250px;
  border-radius: 4px;
  margin: 2rem 0;
  position: relative;
}

.ad-placeholder::before {
  content: 'AD';
  position: absolute;
  top: 0;
  left: 0;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  font-size: 10px;
  font-family: monospace;
}

/* Markdown styling inside articles */
.markdown-body {
  color: #e2e8f0;
  font-family: 'Inter', sans-serif;
  line-height: 1.8;
  font-size: 1.05rem;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  font-family: inherit;
  line-height: 1.4;
  color: #fff;
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
}

.markdown-body h1 {
  font-size: 2.5rem;
  font-weight: 800;
  text-transform: uppercase;
  text-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.markdown-body h1:first-child {
  display: none;
}

.markdown-body h2 {
  font-size: 1.75rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(0, 240, 255, 0.3);
  padding-bottom: 0.5rem;
  display: inline-block;
  padding-right: 2rem;
}

.markdown-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--neon-secondary);
}

.markdown-body p {
  margin-bottom: 1.5rem;
}

.markdown-body a {
  color: var(--neon-primary);
  text-decoration: none;
  border-bottom: 1px dashed var(--neon-primary);
  transition: all 0.2s;
}

.markdown-body a:hover {
  color: var(--neon-secondary);
  border-bottom-color: var(--neon-secondary);
  text-shadow: 0 0 8px rgba(255, 0, 85, 0.5);
}

.markdown-body code {
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.2);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
  color: var(--neon-primary);
  font-size: 0.9em;
}

.markdown-body pre {
  background: #0a0a0f;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  border: 1px solid rgba(0, 240, 255, 0.1);
  border-left: 4px solid var(--neon-primary);
  margin-bottom: 1.5rem;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.markdown-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: #a8b2c1;
}

.markdown-body ul,
.markdown-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.markdown-body ul {
  list-style-type: square;
}

.markdown-body ul li::marker {
  color: var(--neon-primary);
}

.markdown-body ol {
  list-style-type: decimal-leading-zero;
  font-family: 'Orbitron', sans-serif;
}

.markdown-body li {
  margin-bottom: 0.75rem;
}

.markdown-body blockquote {
  border-left: 4px solid var(--neon-secondary);
  background: linear-gradient(90deg, rgba(255, 0, 85, 0.1), transparent);
  padding: 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
  font-style: italic;
}

/* Responsive overrides for Affiliate Ads (Rakuten etc.) */
.ad-placeholder table,
.rakuten-ad-wrapper table,
.ad-placeholder div,
.rakuten-ad-wrapper div,
.ad-placeholder td,
.rakuten-ad-wrapper td {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.ad-placeholder img,
.rakuten-ad-wrapper img {
  max-width: 100% !important;
  height: auto !important;
}

/* Force Rakuten's side-by-side layout to stack on smaller screens */
@media (max-width: 768px) {

  .ad-placeholder table table tr,
  .rakuten-ad-wrapper table table tr {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }

  .ad-placeholder table table td,
  .rakuten-ad-wrapper table table td {
    width: 100% !important;
    display: block !important;
    text-align: center !important;
  }

  /* Reset floats for buttons and images */
  .ad-placeholder div[style*="float:right"],
  .ad-placeholder div[style*="float: right"],
  .rakuten-ad-wrapper div[style*="float:right"],
  .rakuten-ad-wrapper div[style*="float: right"] {
    float: none !important;
    display: inline-block !important;
    margin: 10px auto 0 auto !important;
    width: auto !important;
  }

  .ad-placeholder img[style*="float:left"],
  .ad-placeholder img[style*="float: left"],
  .rakuten-ad-wrapper img[style*="float:left"],
  .rakuten-ad-wrapper img[style*="float: left"] {
    float: none !important;
    display: block !important;
    margin: 0 auto 10px auto !important;
  }
}