/* Font and Typography */
html, body {
  font-family: 'Inter', 'Montserrat', 'Fira Mono', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}
.main-title {
  font-family: 'Montserrat', ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.04em;
  text-shadow: 0 0 16px #22d3ee88, 0 2px 8px #a78bfa55;
}
.main-subtitle {
  font-family: 'Fira Mono', 'Montserrat', monospace, sans-serif;
  letter-spacing: 0.04em;
}
.section-title {
  font-family: 'Montserrat', ui-sans-serif, system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Navbar underline animation */
.nav-link {
  position: relative;
  overflow: hidden;
}
.nav-underline {
  display: block;
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #22d3ee 0%, #22c55e 100%);
  transition: width 0.3s cubic-bezier(.4,0,.2,1), left 0.3s cubic-bezier(.4,0,.2,1);
}
.nav-link:hover .nav-underline,
.nav-link:focus .nav-underline {
  width: 100%;
  left: 0;
}

/* Discord dropdown */
#discordProfile .dropdown-visible {
  opacity: 1 !important;
  pointer-events: auto !important;
  transition: opacity 0.2s;
  z-index: 100;
  display: block !important;
}
#discordProfile .dropdown-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.2s;
  z-index: 100;
  display: none !important;
}

/* Fade page animation */
.fade-page {
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(.4,0,.2,1);
}
.fade-page.loaded {
  opacity: 1;
}
.fade-page.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* Focus outline */
button:focus, a:focus, input:focus {
  outline: 2px solid #22d3ee;
  outline-offset: 2px;
}

/* Animated background gradient */
body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  background: linear-gradient(120deg, #1e293b 0%, #232323 50%, #10151c 100%);
  animation: gradientMove 12s ease-in-out infinite alternate;
  opacity: 0.7;
}
@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* Blob Animations */
@keyframes blobMove {
  0%,100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.08) translateY(30px); }
}
@keyframes blobMove2 {
  0%,100% { transform: scale(1) translateY(0); }
  50% { transform: scale(0.95) translateY(-30px); }
}
.animate-blob-move { animation: blobMove 12s ease-in-out infinite; }
.animate-blob-move2 { animation: blobMove2 14s ease-in-out infinite; }

/* Card glassmorphism & hover */
.main-grid > div {
  backdrop-filter: blur(8px) saturate(140%);
  background: rgba(25, 25, 34, 0.85);
  border: 1.5px solid rgba(60, 60, 80, 0.25);
  box-shadow: 0 8px 32px 0 rgba(34,197,94,0.10), 0 1.5px 8px 0 rgba(0,0,0,0.12);
  transition: 
    transform 0.18s cubic-bezier(.4,0,.2,1), 
    box-shadow 0.18s cubic-bezier(.4,0,.2,1),
    border-color 0.18s cubic-bezier(.4,0,.2,1),
    background 0.18s cubic-bezier(.4,0,.2,1);
  opacity: 0;
  transform: translateY(40px) scale(0.98);
  animation: cardFadeIn 1s cubic-bezier(.4,0,.2,1) forwards;
  animation-delay: 0.5s;
}
.main-grid > div:nth-child(2) { animation-delay: 0.7s; }
.main-grid > div:nth-child(3) { animation-delay: 0.9s; }
.main-grid > div:nth-child(4) { animation-delay: 1.1s; }
@keyframes cardFadeIn {
  to {
    opacity: 1;
    transform: none;
  }
}
.main-grid > div:hover {
  transform: translateY(-10px) scale(1.035);
  box-shadow: 0 20px 48px 0 rgba(34,197,94,0.22), 0 2px 12px 0 rgba(0,0,0,0.22), 0 0 32px 8px #a78bfa55;
  border-color: #22d3ee;
  background: rgba(34, 34, 54, 0.93);
}

/* Fade-in for main content */
main > section {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInMain 0.9s cubic-bezier(.4,0,.2,1) 0.2s forwards;
}
@keyframes fadeInMain {
  to {
    opacity: 1;
    transform: none;
  }
}

/* Back to Top button */
#backToTopBtn {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 50;
  background: linear-gradient(90deg, #22d3ee 0%, #a78bfa 100%);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  box-shadow: 0 4px 24px 0 rgba(34,197,94,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
#backToTopBtn.show {
  opacity: 1 !important;
  pointer-events: auto !important;
  animation: bounceIn 0.7s;
}

/* Sparkle animation for main title */
.sparkle {
  position: absolute;
  top: 0.18em;
  right: 0.18em;
  width: 1.2em;
  height: 1.2em;
  pointer-events: none;
  z-index: 2;
  animation: sparkleTwinkle 1.8s infinite;
}
@keyframes sparkleTwinkle {
  0%, 100% { opacity: 0.7; transform: scale(1) rotate(0deg);}
  50% { opacity: 1; transform: scale(1.18) rotate(20deg);}
}

/* "New" badge for repo */
.repo-new-badge {
  display: inline-block;
  background: linear-gradient(90deg, #22d3ee 0%, #22c55e 100%);
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
  border-radius: 0.5em;
  padding: 0.15em 0.7em;
  margin-left: 0.5em;
  vertical-align: middle;
  animation: badgePulse 1.2s infinite alternate;
}
@keyframes badgePulse {
  0% { box-shadow: 0 0 0 0 #22d3ee44; }
  100% { box-shadow: 0 0 8px 4px #22c55e33; }
}

/* Responsive grid for main cards */
@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: 1fr !important;
  }
}
@media (max-width: 600px) {
  .main-grid > div {
    padding: 1.2rem 0.7rem !important;
    min-width: unset !important;
    max-width: unset !important;
  }
  .main-title {
    font-size: 2.2rem !important;
  }
  .main-subtitle {
    font-size: 1.1rem !important;
  }
}

/* Improve focus visibility for accessibility */
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid #22d3ee;
  outline-offset: 2px;
}

/* Neon glow for social icons on hover */
a:hover img[alt="Discord"] { box-shadow: 0 0 12px 2px #22d3ee88; }
a:hover img[alt="Twitch"] { box-shadow: 0 0 12px 2px #a78bfa88; }
a:hover img[alt="YouTube"] { box-shadow: 0 0 12px 2px #f8717188; }
a:hover img[alt="GitHub"] { box-shadow: 0 0 12px 2px #60a5fa88; }

/* Sticky navbar blur */
header {
  backdrop-filter: blur(12px) saturate(120%);
}

/* Footer glow and style */
footer {
  box-shadow: 0 -8px 32px 0 #22d3ee22, 0 -1.5px 8px 0 #a78bfa22;
  border-top: 2px solid #232323;
  background: linear-gradient(180deg, #18181b 80%, #232323 100%);
  padding-top: 2.5rem !important;
  padding-bottom: 2.5rem !important;
  border-radius: 1.5rem 1.5rem 0 0 !important;
}


footer .flex {
  gap: 2.5rem !important;
}

footer .flex.gap-6 {
  gap: 2.5rem !important;
}

footer .flex.gap-6 > a {
  display: flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  padding-left: 0.9rem !important;
  padding-right: 0.9rem !important;
}

footer .flex.items-center.gap-4 {
  gap: 1.25rem !important;
}

footer .text-xs {
  font-size: 0.85rem !important;
}

/* Skin/Head Generator Preview Fade-in */
img[id$="Preview"] {
  transition: opacity 0.3s;
  opacity: 0;
}
img[id$="Preview"].shown {
  opacity: 1;
}
img:not(.hidden) {
  opacity: 1;
  transition: opacity 0.3s;
}
img.hidden {
  opacity: 0;
}

/* Form elements transition */
input, select, textarea {
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus {
  border-color: #22d3ee;
  box-shadow: 0 0 0 2px #22d3ee44;
}
button, .rounded-lg {
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}
button:active {
  transform: scale(0.97);
}

/* Tooltip styles */
.tooltip {
  position: relative;
  cursor: pointer;
}
.tooltip .tooltip-text {
  visibility: hidden;
  opacity: 0;
  width: max-content;
  background: #232323;
  color: #fff;
  text-align: center;
  border-radius: 0.5em;
  padding: 0.3em 0.8em;
  position: absolute;
  z-index: 100;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  transition: opacity 0.2s;
  font-size: 0.85em;
  pointer-events: none;
}
.tooltip:hover .tooltip-text, .tooltip:focus .tooltip-text {
  visibility: visible;
  opacity: 1;
}
.section-divider {
  width: 100%;
  height: 2px;
  margin: 2.5rem 0;
  background: linear-gradient(90deg, #22d3ee33 0%, #a78bfa33 100%);
  border: none;
  border-radius: 1px;
}

/* Loader animation */
.loader {
  border: 4px solid #232323;
  border-top: 4px solid #22d3ee;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  100% { transform: rotate(360deg);}
}

/* Add this to your mctools.css */
[id$="Tool"] {
  scroll-margin-top: 120px;
}

/* --- Make tool cards more compact and modern --- */
.tool-card {
  padding: 1.5rem 1.25rem !important;
  border-radius: 1rem !important;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.12);
  background: rgba(25,25,34,0.92);
  border: 1px solid #232323;
  transition: box-shadow 0.18s, transform 0.18s, background 0.18s;
  max-width: 600px;
}

.tool-card:hover {
  box-shadow: 0 4px 32px 0 rgba(34,197,94,0.12), 0 2px 16px 0 rgba(0,0,0,0.18);
  background: rgba(30,30,40,0.97);
  transform: translateY(-2px) scale(1.012);
}

.section-title {
  font-size: 1.25rem !important;
  margin-bottom: 0.25rem !important;
  letter-spacing: 0.01em;
}

.tool-card p,
.tool-card label,
.tool-card input,
.tool-card textarea,
.tool-card select {
  font-size: 0.97rem !important;
}

.tool-card form,
.tool-card .flex,
.tool-card .flex-col {
  gap: 0.5rem !important;
}

.tool-card textarea,
.tool-card input,
.tool-card select {
  padding: 0.5rem 0.75rem !important;
  border-radius: 0.5rem !important;
  font-size: 0.97rem !important;
}

.tool-card button,
.tool-card .rounded-lg {
  border-radius: 0.5rem !important;
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
  font-size: 0.97rem !important;
}

.tool-card .mt-2 {
  margin-top: 0.5rem !important;
}

.tool-card .mb-4 {
  margin-bottom: 0.5rem !important;
}

.tool-card .mb-2 {
  margin-bottom: 0.25rem !important;
}

/* --- Accordion style for tool cards --- */
.tool-card {
  max-width: 100% !important;
  width: 100%;
  margin: 0 auto 1.25rem auto;
  padding: 0 !important;
  border-radius: 1rem !important;
  overflow: hidden;
}

.tool-card-toggle {
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 700;
  padding: 1.2rem 1.5rem;
  width: 100%;
  text-align: left;
  background: rgba(25,25,34,0.97);
  color: #60a5fa;
  transition: background 0.18s;
}

.tool-card-toggle:hover,
.tool-card-toggle:focus {
  background: rgba(34,197,94,0.10);
}

.toggle-arrow {
  font-size: 1.2em;
  margin-left: 0.5em;
  transition: transform 0.2s;
  display: flex;
  align-items: center;
}

.tool-card.open .toggle-arrow {
  transform: rotate(180deg);
}

.tool-card-content {
  padding: 1.2rem 1.5rem 1.5rem 1.5rem;
  background: rgba(25,25,34,0.92);
  border-top: 1px solid #232323;
  animation: fadeInAccordion 0.3s;
}

@keyframes fadeInAccordion {
  from { opacity: 0; transform: translateY(-10px);}
  to { opacity: 1; transform: none;}
}

/* --- Sidebar improvements --- */
aside nav {
  padding: 1.25rem 0.5rem !important;
  border-radius: 1rem !important;
  background: rgba(25,25,34,0.92) !important;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.10);
}

.sidebar-link {
  font-size: 1rem !important;
  padding: 0.4rem 0.8rem !important;
  border-radius: 0.5rem !important;
  transition: background 0.15s, color 0.15s;
}

.sidebar-link:hover {
  background: rgba(34,197,94,0.09);
  color: #34d399 !important;
}

/* --- Reduce gap between tool cards --- */
.flex.flex-col.gap-8.items-center.w-full {
  gap: 1.25rem !important;
}

/* --- Make preview images smaller and more uniform --- */
#skinTool .flex-col.items-center img {
  width: 5.5rem !important;
  height: 5.5rem !important;
  min-width: 4.5rem;
  min-height: 4.5rem;
  max-width: 6rem;
  max-height: 8rem;
}

/* --- Responsive tweaks for large screens --- */
@media (min-width: 1024px) {
  .tool-card {
    max-width: 520px;
    padding: 1.5rem 2rem !important;
  }
  .flex.flex-col.gap-8.items-center.w-full {
    gap: 1.5rem !important;
  }
}

@media (max-width: 600px) {
  .tool-card-toggle {
    font-size: 1.05rem;
    padding: 1rem 1rem;
  }
  .tool-card-content {
    padding: 1rem 1rem 1.2rem 1rem;
  }
  .sidebar-link {
    font-size: 1.1rem !important;
    padding: 0.7rem 1.1rem !important;
  }
}

/* --- Make footer more compact --- */
footer {
  padding-top: 2.5rem !important;
  padding-bottom: 2.5rem !important;
  border-radius: 1.5rem 1.5rem 0 0 !important;
}

footer .flex {
  gap: 2.5rem !important;
}

footer .flex.items-center.gap-4 {
  gap: 1.25rem !important;
}

footer .text-xs {
  font-size: 0.85rem !important;
}

/* --- Back to Top button smaller --- */
#backToTopBtn {
  width: 2.75rem !important;
  height: 2.75rem !important;
  font-size: 1.5rem !important;
}

/* --- Misc: reduce main title size on desktop --- */
@media (min-width: 768px) {
  .main-title {
    font-size: 3.5rem !important;
  }
  .main-subtitle {
    font-size: 1.25rem !important;
  }

}

/* Generator box improvements */
.tool-card {
  background: linear-gradient(120deg, #18181b 80%, #232323 100%);
  border: 1.5px solid #232323;
  box-shadow: 0 4px 32px 0 #22d3ee11, 0 2px 16px 0 #0008;
  transition: box-shadow 0.18s, transform 0.18s, background 0.18s;
}

.tool-card.open {
  box-shadow: 0 6px 36px 0 #34d39933, 0 2px 16px 0 #000a;
  background: linear-gradient(120deg, #232323 80%, #18181b 100%);
  border-color: #34d399;
}

.tool-card-toggle {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: rgba(25,25,34,0.97);
  color: #fff;
  border-bottom: 1px solid #232323;
}

.tool-card-content {
  padding: 1.5rem 1.5rem 1.7rem 1.5rem;
  background: rgba(25,25,34,0.96);
  border-radius: 0 0 1rem 1rem;
}

/* Friendlier generator input/output */
.tool-card input,
.tool-card textarea,
.tool-card select {
  background: #191922;
  border: 2px solid #232323;
  color: #e0e0e0;
  border-radius: 0.7rem !important;
  padding: 0.85rem 1.1rem !important;
  font-size: 1.08rem !important;
  margin-bottom: 0.2rem;
  transition: border 0.18s, box-shadow 0.18s;
}
.tool-card input:focus,
.tool-card textarea:focus,
.tool-card select:focus {
  border-color: #34d399;
  box-shadow: 0 0 0 2px #34d39944;
  background: #232323;
}
.tool-card textarea[readonly],
.tool-card input[readonly] {
  background: #232323;
  color: #a7f3d0;
  border: 2px solid #34d399;
  font-weight: 600;
  font-size: 1.08rem;
}
.tool-card label {
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: #a7f3d0;
  font-size: 1rem;
  display: block;
}
.tool-card small,
.tool-card .helper-text {
  color: #a1a1aa;
  font-size: 0.93rem;
  margin-bottom: 0.5rem;
  display: block;
}
.tool-card button[type="submit"] {
  margin-top: 0.7rem;
  font-size: 1.08rem;
  padding: 0.8rem 1.3rem;
  border-radius: 0.7rem;
}