/* Shared base styles for website */

/* Optional custom font (falls back if missing) */
@font-face {
  font-family: 'Minecraft';
  src: url('../data/Minecraft.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap; /* Prevent render-blocking - shows fallback font while loading */
}

/* Splash text animation */
@keyframes splashThrob {
  0% { transform: rotate(-25deg) scale(1); opacity: 0.85; }
  50% { transform: rotate(-25deg) scale(1.1); opacity: 1; }
  100% { transform: rotate(-25deg) scale(1); opacity: 0.85; }
}

/* Splash text styles */
#splash-text {
  position: absolute;
  left: clamp(2vw, 80%, 90vw);
  top: clamp(2vw, 80%, 90vh);
  transform: rotate(25deg);
  font-size: clamp(0.1rem, 2.5vw, 1.7rem);
  font-family: 'Minecraft', 'Arial Black', Arial, sans-serif;
  font-weight: 1000;
  color: #ffe600;
  text-shadow: 2px 2px 0 #222, 0 0 8px #000;
  opacity: 0.95;
  pointer-events: none;
  z-index: 2;
  animation: splashThrob 1.6s infinite;
  line-height: 1.2;
  min-width: 15ch
}

/* Page background image */
/* html { background-image: url('../assets/background.webp'); } */
/* Disabled - using ColorBends animated background instead */

/* Theme variables */
[data-theme="dark"] {
  --bg-main: #16161a;
  --bg-body: #222;
  --bg-container: linear-gradient(to bottom, rgba(14, 14, 16, 0.85) 0%, rgba(47, 47, 47, 0.85) 100%);
  --text-main: #d5e3ed;
  --text-secondary: #fff;
  --nav-bg: #29292e;
  --nav-hover: #44444b; /* lighter hover for dark mode */
  --nav-active: #2f2f36; /* lighter active for dark mode */
  --carousel-indicator-bg: rgba(20, 20, 30, 0.7);
  --carousel-indicator-color: #d5e3ed;
  --footer-bg: rgba(0, 0, 0, 0.5);
  --carousel-arrow-filter: none;
  --modpack-tag-bg: #23243a;
  --modpack-tag-color: #b3c6ff;
  --modpack-icon-filter: none;
}
[data-theme="light"] {
  --bg-main: #f5f5f5;
  --bg-body: #fff;
  --bg-container: linear-gradient(to bottom, rgba(255, 255, 255, 0.92) 0%, rgba(235, 235, 245, 0.92) 100%);
  --text-main: #222;
  --text-secondary: #29292e;
  --nav-bg: #e3e3ff;
  --nav-hover: #bfc9d6; /* darker hover for light mode */
  --nav-active: #9ba7b6; /* darker active for light mode */
  --carousel-indicator-bg: rgba(220, 230, 255, 0.85);
  --carousel-indicator-color: #29292e;
  --footer-bg: rgba(240, 240, 255, 0.7);
  --carousel-arrow-filter: invert(1) brightness(0.7);
  --modpack-tag-bg: #e3e3ff;
  --modpack-tag-color: #3b6cb7;
  --modpack-icon-filter: invert(1) brightness(0.7);
}

/* Themed surfaces and text */
html { background-color: var(--bg-main) !important; }
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-body) !important;
  color: var(--text-main) !important;
  font-family: Arial, Helvetica, sans-serif;
  transition: background-color 0.3s ease;
  text-align: center;
}
.container { background: var(--bg-container) !important; }
h1, h2, h3, p, span, footer { color: var(--text-main) !important; }

/* Top navigation */
.topnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  row-gap: 8px;
}
.topnav a {
  color: var(--text-main) !important;
  text-align: center;
  padding: 1% 1%;
  font-size: 1px; /* keep anchors compact when using only icons */
  aspect-ratio: 1 / 1;
  transition: color 0.3s ease, background-color 0.3s ease;
  border-radius: 999px; /* for hover/active */
}
.topnav a i { font-size: 120px; margin: 0 2px; }
.topnav a img { width: 40px; height: 40px; }
.topnav a:hover {
  background-color: var(--nav-hover) !important;
  color: var(--text-secondary) !important;
}
.topnav a.active {
  background-color: var(--nav-active) !important;
  color: var(--text-secondary) !important;
}

/* Theme toggle */
#theme-toggle {
  font-family: 'Noto Color Emoji', 'Segoe UI Emoji', 'Apple Color Emoji', Arial, Helvetica, sans-serif !important;
  color: #fff !important;
  border: 2px solid #fff !important;
  border-radius: 24px !important;
  box-shadow: 0 4px 16px rgba(252, 87, 94, 0.18), 0 1.5px 6px rgba(0,0,0,0.10) !important;
  padding: 10px 22px !important;
  font-weight: bold !important;
  font-size: 1.1rem !important;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s !important;
  display: flex;
  align-items: center;
  gap: 10px;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  cursor: pointer;
}
#theme-toggle #theme-label { font-weight: bold; }
.theme-toggle-light #theme-label { text-shadow: 0 0 2px #fff, 0 0 4px #00eaff, 0 0 2px #fff, 0 0 4px #00eaff; }
.theme-toggle-dark #theme-label { text-shadow: 0 0 2px #000, 0 0 4px #005bea, 0 0 2px #000, 0 0 4px #005bea; }
#theme-toggle:hover { color: #fff !important; box-shadow: 0 6px 24px rgba(252, 87, 94, 0.28), 0 2px 8px rgba(0,0,0,0.14) !important; }
.theme-toggle-light { background: linear-gradient(135deg, #00c6fb 0%, #005bea 100%) !important; }
.theme-toggle-dark { background: linear-gradient(135deg, #f7b42c 0%, #fc575e 100%) !important; }
.theme-toggle-light:hover { background: linear-gradient(135deg, #005bea 0%, #00c6fb 100%) !important; }
.theme-toggle-dark:hover { background: linear-gradient(135deg, #fc575e 0%, #f7b42c 100%) !important; }

/* Modpack cards */
.modpack-card { transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important; cursor: pointer !important; }
.modpack-card:hover { transform: translateY(-8px) scale(1.02) !important; cursor: pointer !important; }
[data-theme="dark"] .modpack-card:hover { box-shadow: 0 8px 32px rgba(126, 126, 139, 0.4), 0 4px 16px rgba(53, 53, 53, 0.3), 0 2px 8px rgba(0,0,0,0.15) !important; }
[data-theme="light"] .modpack-card:hover { box-shadow: 0 8px 32px rgba(227, 227, 255, 0.4), 0 4px 16px rgba(179, 198, 255, 0.3), 0 2px 8px rgba(0,0,0,0.12) !important; }

/* Footer surface */
footer { color: #fff; }

/* ===== RESPONSIVE IMAGES ===== */
/* Make all images responsive by default */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Ensure images maintain their aspect ratio */
img[style*="aspect-ratio"] {
  object-fit: cover;
}

/* Icons should maintain their fixed size on all screens */
.topnav a img,
#theme-icon,
img[id*="icon"] {
  display: inline-block;
  flex-shrink: 0;
}

/* Responsive adjustments for small screens */
@media screen and (max-width: 768px) {
  /* Adjust icon sizes for mobile */
  .topnav a img {
    width: 32px;
    height: 32px;
  }
  
  /* Ensure carousel images are responsive */
  #carousel-image {
    width: 100%;
    height: auto;
  }
  
  /* Make modpack banners responsive */
  img[id*="modpack-banner"] {
    height: auto;
    min-height: 80px;
    max-height: 110px;
  }
}

/* Extra small screens */
@media screen and (max-width: 480px) {
  .topnav a img {
    width: 28px;
    height: 28px;
  }
  
  img[id*="modpack-banner"] {
    min-height: 60px;
  }
}
