/* ============================================================
   Site-Specific Overrides for whykusanagi.xyz
   These styles extend @whykusanagi/corrupted-theme
   ============================================================ */
@import url('./corrupted-theme/theme.css');

/* ========== DEFAULT BACKGROUND ========== */
/* Background image will be set via JavaScript to allow env-config URL conversion */
body {
  background: linear-gradient(180deg, rgba(5, 0, 16, 0.8), rgba(10, 10, 10, 0.8) 50%, rgba(15, 10, 25, 0.9));
  background-size: cover;
  background-attachment: fixed;
  min-height: 100vh;
  position: relative;
}

/* Background image layer - behind overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image: url('https://s3.whykusanagi.xyz/hero_image.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  pointer-events: none;
}

/* Overlay should be ABOVE the background image but BELOW content */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2; /* above background image but below content */
  background: linear-gradient(180deg, rgba(5, 0, 16, 0.8), rgba(10, 10, 10, 0.8) 50%, rgba(15, 10, 25, 0.9));
  backdrop-filter: blur(3px);
  pointer-events: none;
}

/* Ensure content is above both background layers */
.app-shell,
main.app-shell {
  position: relative;
  z-index: 5; /* ensure content is above video/backdrop */
}

/* ========== VIDEO BACKGROUND (Package Structure) ========== */
body.has-video-bg {
  background-image: none;
}

body.has-video-bg::before {
  display: none; /* Hide default overlay when video is present */
}

body.has-video-bg::after {
  display: none; /* Hide background image when video is present */
}

/* Package structure: .background-media and .glass-backdrop */
#bg-video,
.background-media {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -3;
  filter: blur(4px);
  opacity: 1;
  pointer-events: none;
}

.glass-backdrop {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 0, 16, 0.85), rgba(10, 10, 10, 0.9));
  z-index: -1;
  backdrop-filter: blur(3px);
  pointer-events: none;
}

.navbar {
  position: relative;
  z-index: 10;
}

/* ========== NAVBAR ========== */
/* Navbar styles are now in package components.css (v0.1.1+) */
/* No overrides needed - package includes complete navbar styling */

/* ========== APP-SHELL (Package Structure) ========== */
.app-shell {
  position: relative;
  z-index: 1; /* Package default */
  padding: clamp(1.5rem, 3vw, 3rem);
  backdrop-filter: blur(0);
}

/* ========== HOMEPAGE SPECIFIC LAYOUTS ========== */
/* Most styles (.container, .content, .character, .logo, .intro, .social-icons) are in theme.css */
/* Only site-specific adjustments below */

.container {
  /* Override: Add navbar height adjustment */
  min-height: calc(100vh - 80px);
  padding-top: 6rem; /* Extra top padding to clear navbar */
}

.content {
  /* Override: Use specific border-radius value */
  border-radius: 20px;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

/* ========== GLITCH EFFECT (Site Version) ========== */
.glitch-word {
  position: relative;
  display: inline-block;
  color: var(--text);
  transition: all 0.3s ease;
}

.glitch-word::before,
.glitch-word::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  color: var(--accent);
  z-index: -1;
  opacity: 0;
}

.glitch-word:hover::before,
.glitch-word:hover::after {
  opacity: 0.6;
}

.glitch-word::before {
  animation: glitchShift1 0.3s linear alternate;
}

.glitch-word::after {
  animation: glitchShift2 0.25s linear alternate;
}

.glitch-word:hover::before {
  animation: glitchShift1 0.3s infinite linear alternate-reverse;
}

.glitch-word:hover::after {
  animation: glitchShift2 0.25s infinite linear alternate;
}

@keyframes glitchShift1 {
  0% { transform: translate(0px, 0px); }
  20% { transform: translate(-1px, 1px); }
  40% { transform: translate(-1px, -1px); }
  60% { transform: translate(1px, 1px); }
  80% { transform: translate(1px, -1px); }
  100% { transform: translate(0px, 0px); }
}

@keyframes glitchShift2 {
  0% { transform: translate(0px, 0px); }
  25% { transform: translate(1px, -1px); }
  50% { transform: translate(-1px, 1px); }
  75% { transform: translate(1px, 1px); }
  100% { transform: translate(0px, 0px); }
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes slideIn {
  0% { transform: translateY(40px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ========== RESPONSIVE ========== */
/* Most responsive styles are in theme.css */
/* Only site-specific responsive overrides below */

@media screen and (max-width: 768px) {
  .container {
    padding-top: 4rem; /* Adjust for mobile navbar */
  }

  .buttons {
    gap: 0.75rem;
    margin-bottom: 2rem;
  }
}

/* ========== FOOTER ========== */
/* Footer styles are in theme.css */
/* Only site-specific overrides if needed */

/* ========== GALLERY SYSTEM ========== */
/* Gallery, lightbox, nsfw-content, and filter-bar styles are in corrupted-theme/extensions.css */
/* Only site-specific gallery section wrapper needed */
.gallery-section {
  position: relative;
  z-index: 1;
  padding: 4rem 2rem;
  text-align: center;
}

.gallery-title {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--text);
}

/* ========== SOCIAL LINKS (Linktree Style) ========== */
/* Styles are now in corrupted-theme/extensions.css */
/* Using .social-links-container, .profile-avatar, .profile-name, .link-item */

/* ========== REFERENCE GALLERY ========== */
.reference-section {
  position: relative;
  z-index: 1;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--spacing-xl);
  max-width: 1000px;
  margin: 4rem auto 2rem auto;
  box-shadow: 0 0 20px rgba(217, 79, 144, 0.3);
  backdrop-filter: blur(10px);
}

.reference-title {
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: var(--spacing-xl);
  color: var(--text);
}

.reference-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
}

.reference-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.reference-item img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 12px rgba(217, 79, 144, 0.4);
  cursor: zoom-in;
  transition: transform var(--transition-normal);
}

.reference-item img:hover {
  transform: scale(1.05);
}

.reference-caption {
  margin-top: var(--spacing-md);
  font-size: 1rem;
  color: var(--text-secondary);
  text-align: center;
}

/* ========== DOUJIN/Tool CARDS ========== */
.doujin-section,
.tools-section {
  position: relative;
  z-index: 1;
  padding: 4rem 2rem;
  text-align: center;
}

.doujin-title,
.tools-title {
  font-size: 2rem;
  margin-bottom: var(--spacing-xl);
  color: var(--text);
}

.doujin-grid,
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-xl);
  max-width: 1200px;
  margin: 0 auto;
}

.doujin-card,
.tool-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--spacing-xl);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 20px rgba(217, 79, 144, 0.2);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.doujin-card:hover,
.tool-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 30px rgba(217, 79, 144, 0.4);
  border-color: var(--border-light);
}

.doujin-icon,
.tool-icon {
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
  color: var(--accent);
}

.doujin-card h3,
.tool-card h3 {
  font-size: 1.75rem;
  margin-bottom: var(--spacing-sm);
  color: var(--text);
  font-weight: 700;
}

.doujin-price {
  font-size: 1.25rem;
  color: #fbc531;
  margin-bottom: var(--spacing-md);
  font-weight: 600;
}

.doujin-card p,
.tool-card p {
  color: var(--text-secondary);
  margin-bottom: var(--spacing-lg);
  flex-grow: 1;
  text-align: left;
  line-height: 1.6;
}

.doujin-button,
.tool-button {
  display: inline-block;
  background: var(--gradient-accent);
  color: #fff;
  text-decoration: none;
  padding: var(--spacing-md) var(--spacing-xl);
  border-radius: var(--radius-lg);
  font-weight: 600;
  transition: all var(--transition-normal);
  border: 1px solid rgba(217, 79, 144, 0.3);
  align-self: center;
  letter-spacing: 0.3px;
}

.doujin-button:hover,
.tool-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(217, 79, 144, 0.3);
}

/* ========== CONTENT PAGES ========== */
.privacy-container {
  position: relative;
  z-index: 1;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--spacing-xl);
  max-width: 900px;
  margin: 4rem auto 2rem auto;
  box-shadow: 0 0 20px rgba(217, 79, 144, 0.3);
  backdrop-filter: blur(10px);
}

.privacy-container h1,
.privacy-container h2,
.privacy-container h3 {
  color: var(--accent);
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
}

/* ========== WALLPAPER GRID ========== */
.wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--spacing-xl);
}

.wallpaper-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  backdrop-filter: blur(10px);
  transition: transform var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.wallpaper-card:hover {
  transform: translateY(-4px);
}

.wallpaper-card img {
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
  display: block;
}

/* ========== COUNTDOWN WIDGET ========== */
/* Countdown widget uses dedicated countdown-widget.css, not these styles */

/* ========== RESPONSIVE GALLERY ========== */
@media screen and (max-width: 768px) {
  .gallery-container,
  .reference-container {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
  }

  .doujin-grid,
  .tools-grid {
    grid-template-columns: 1fr;
  }


  .link-item {
    font-size: 1rem;
  }
}

/* ========== BLOG PAGES ========== */
.blog-page .container {
  max-width: 1200px;
  margin: 0 auto;
}

.blog-index header {
  text-align: center;
  margin-bottom: 3rem;
}

.blog-index header h1 {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 1rem;
  text-shadow: 0 0 20px rgba(217, 79, 144, 0.3);
}

.blog-index header p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* Single column blog layout - positioned on right */
.blog-layout {
  display: flex;
  justify-content: flex-end;
  margin-top: 2rem;
}

.blog-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 800px;
  width: 100%;
}

.scrollable-column {
  max-height: calc(100vh - 300px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 1rem;
  scroll-behavior: smooth;
  /* Improve scrolling performance */
  -webkit-overflow-scrolling: touch;
  will-change: scroll-position;
}

/* Custom scrollbar for scrollable column */
.scrollable-column::-webkit-scrollbar {
  width: 8px;
}

.scrollable-column::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.scrollable-column::-webkit-scrollbar-thumb {
  background: rgba(217, 79, 144, 0.5);
  border-radius: 4px;
  transition: background 0.3s ease;
}

.scrollable-column::-webkit-scrollbar-thumb:hover {
  background: rgba(217, 79, 144, 0.7);
}

.blog-index .card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.blog-index .card {
  display: flex;
  flex-direction: column;
}

.blog-index .card h2 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.blog-index .card h2 a {
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition-normal);
}

.blog-index .card h2 a:hover {
  color: var(--accent);
}

.blog-index .card p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.blog-index .card small {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Blog Article Styles */
.blog-article-content {
  max-width: 900px;
  margin: 2rem auto;
}

.blog-article-content.card {
  padding: 2.5rem;
}

.blog-article-content header {
  margin-bottom: 3rem;
  text-align: center;
}

.blog-article-content .eyebrow {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: rgba(217, 79, 144, 0.15);
  border: 1px solid rgba(217, 79, 144, 0.3);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.blog-article-content h1 {
  font-size: 2.5rem;
  color: var(--text);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.blog-article-content .meta {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.blog-article-content section {
  margin-bottom: 2.5rem;
}

.blog-article-content section h2 {
  color: var(--accent);
  font-size: 1.75rem;
  margin-bottom: 1rem;
  margin-top: 2rem;
}

.blog-article-content section p {
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.blog-article-content section ul,
.blog-article-content section ol {
  color: var(--text);
  line-height: 1.8;
  margin-left: 2rem;
  margin-bottom: 1rem;
}

.blog-article-content section li {
  margin-bottom: 0.5rem;
}

.blog-article-content section strong {
  color: var(--accent);
}

.blog-article-content .tldr {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin: 2rem 0;
  backdrop-filter: blur(15px);
}

.blog-article-content .tldr h2 {
  color: var(--accent);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  margin-top: 0;
}

.blog-article-content .tldr ul {
  margin-left: 1.5rem;
}

.blog-article-content .cta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 3rem;
  margin-bottom: 2rem;
}

.blog-article-content code {
  background: rgba(217, 79, 144, 0.1);
  border: 1px solid rgba(217, 79, 144, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.5rem;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: var(--accent-light);
}

@media screen and (max-width: 768px) {
  .blog-article-content {
    padding: 1rem;
  }

  .blog-article-content h1 {
    font-size: 2rem;
  }

  .blog-layout {
    justify-content: center;
  }

  .blog-column {
    max-width: 100%;
  }

  .scrollable-column {
    max-height: none;
    overflow-y: visible;
  }

  .blog-index .card-grid {
    grid-template-columns: 1fr;
  }

  .blog-article-content .cta-grid {
    grid-template-columns: 1fr;
  }

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

