/* --- VARIABLES GLOBALES --- */
:root {
  /* Typographie */
  --font-title: "Nunito", sans-serif;
  --font-body: "Inter", sans-serif;

  /* Dimensions & UI */
  --border-width: 2px;
  --radius-btn: 16px; /* rounded-2xl */
  --radius-card: 24px; /* rounded-3xl */

  /* --- PALETTE LIGHT (Organic - Warm) --- */
  --color-bg: #aebcb0; /* Distinct Sage Green/Grey - Not White */
  --color-surface: #bac6bc; /* Slightly lighter surface for contrast */
  --color-primary: #4ade80; /* Vibrant Green */
  --color-primary-hover: #22c55e;
  --color-accent: #ffdd76; /* Keeping yellow for small accents if needed */

  --color-text: #0f391e; /* Darker text for contrast */
  --color-text-muted: #374151;

  --color-border: #4b5563; /* Darker border */
  --color-shadow: #1f4b3f; /* Deep Green Shadow */

  --shadow-btn: 4px 4px 0px var(--color-shadow);
  --shadow-card: 6px 6px 0px rgba(0, 0, 0, 0.05);
}

/* --- PALETTE DARK (Neon - Deep) --- */
[data-theme="dark"] {
  --color-bg: #050b08; /* Almost Black */
  --color-surface: #0f1a15; /* Deep Green Surface */
  --color-primary: #34d399; /* Neon Mint */
  --color-primary-hover: #6ee7b7;
  --color-accent: #ffc845;

  --color-text: #e2e8f0; /* Off-white */
  --color-text-muted: #94a3b8;

  --color-border: #34d399; /* Neon Border */
  --color-shadow: rgba(52, 211, 153, 0.4); /* Neon Glow */

  --shadow-btn: 0px 0px 15px var(--color-shadow);
  --shadow-card: 0px 0px 0px transparent; /* Cleaner look in dark mode */
}

/* --- RESET & BASE --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  transition: background-color 0.5s ease, color 0.5s ease;
  line-height: 1.6;
  overflow-x: hidden;
  /* Subtle Grid Background */
  background-image: linear-gradient(var(--color-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center top;
  /* Make the grid very subtle */
  background-blend-mode: overlay;
}

[data-theme="light"] body {
  background-image: linear-gradient(rgba(55, 65, 81, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(55, 65, 81, 0.05) 1px, transparent 1px);
}

[data-theme="dark"] body {
  background-image: linear-gradient(
      rgba(52, 211, 153, 0.05) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(52, 211, 153, 0.05) 1px, transparent 1px);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-title);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

ul {
  list-style: none;
}

/* --- ANIMATIONS --- */
@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-12px);
  }
  100% {
    transform: translateY(0px);
  }
}

.animate-float {
  animation: float 5s ease-in-out infinite;
}

/* --- UTILITIES --- */
.container {
  width: 90%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- COMPONENTS --- */

/* Buttons */
.btn-primary {
  background-color: var(--color-primary);
  color: #052e16; /* Always dark text on primary */
  border: 2px solid var(--color-border);
  padding: 12px 28px;
  border-radius: var(--radius-btn);
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

[data-theme="dark"] .btn-primary {
  border-color: transparent; /* Neon style often has no border or matching border */
  color: #000;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-border);
  padding: 12px 28px;
  border-radius: var(--radius-btn);
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.theme-toggle-fixed {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  background-color: var(--color-surface);
  color: var(--color-text);
  border: 2px solid var(--color-border);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.theme-toggle-fixed:hover {
  transform: scale(1.1);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

[data-theme="dark"] .theme-toggle-fixed {
  background-color: rgba(5, 11, 8, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  backdrop-filter: blur(5px);
}

.logo-text {
  color: var(--color-text);
}

.logo-accent {
  color: var(--color-primary);
}

/* --- HERO SECTION --- */
.hero-section {
  padding: 2rem 0;
  min-height: 50vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Background Glow Effect */
.hero-section::before {
  content: "";
  position: absolute;
  top: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background-color: var(--color-primary);
  filter: blur(150px);
  opacity: 0.2;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}

[data-theme="dark"] .hero-section::before {
  opacity: 0.1;
}

.hero-container {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: center;
  z-index: 1;
}

.hero-content {
  text-align: left;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  background-color: var(--color-surface);
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

[data-theme="dark"] .hero-tag {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.hero-title {
  font-size: 4rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--color-text);
}

.hero-name {
  color: var(--color-primary);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  margin-bottom: 2.5rem;
  font-weight: 500;
  max-width: 500px;
  opacity: 0.9;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
}

.hero-image {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-img-placeholder {
  width: 100%;
  max-width: 450px;
  height: auto;
  /* Removed border/bg for cleaner look, relying on image transparency + float */
  background: transparent;
  border: none;
  box-shadow: none;
}

.hero-img-placeholder img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0px 20px 40px rgba(0, 0, 0, 0.15));
}

[data-theme="dark"] .hero-img-placeholder img {
  filter: drop-shadow(0px 0px 30px rgba(52, 211, 153, 0.2));
}

/* --- SKINS SECTION --- */
.skins-section {
  padding: 2rem 0;
}

.section-title {
  text-align: center;
  font-size: 3rem;
  margin-bottom: 2rem;
  color: var(--color-text);
}

.skins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  grid-auto-flow: dense;
}

@media (min-width: 1400px) {
  .skins-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.skin-card {
  background-color: var(--color-surface);
  border: 2px solid transparent;
  border-radius: var(--radius-card);
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

/* Bento Grid Modifiers */
.skin-card.featured {
  grid-column: span 2;
  grid-row: span 1; /* Reduced height */
}

.skin-card.wide {
  grid-column: span 2;
}

/* Rank Tags */
.rank-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background-color: var(--color-primary);
  color: #052e16;
  padding: 6px 14px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 0.85rem;
  z-index: 5;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  pointer-events: none;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Responsive adjustments for Bento */
@media (max-width: 768px) {
  .skin-card.featured,
  .skin-card.wide {
    grid-column: span 1;
    grid-row: span 1;
  }
}

[data-theme="light"] .skin-card {
  border-color: rgba(20, 83, 45, 0.1);
}

[data-theme="dark"] .skin-card {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.skin-card:hover {
  transform: translateY(-8px);
  z-index: 10; /* Bring to front on hover */
}

[data-theme="light"] .skin-card:hover {
  border-color: var(--color-primary);
  box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .skin-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.2);
}

.skin-image {
  flex-grow: 1;
  min-height: 220px;
  background-color: #1a1a1a; /* Dark placeholder to prevent white flash */
  position: relative;
  overflow: hidden;
}

.skin-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.skin-card:hover .skin-image img {
  transform: scale(1.05);
}

.skin-info {
  padding: 2rem;
}

.skin-info h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.skin-buttons {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.card-btn {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.2s;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-download {
  background-color: var(--color-primary);
  color: #052e16;
  border: none;
}

.btn-download:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-2px);
}

.btn-forum {
  background-color: transparent;
  border: 2px solid rgba(0, 0, 0, 0.1);
  color: var(--color-text);
}

[data-theme="dark"] .btn-forum {
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.btn-forum:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .btn-forum:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* --- FOOTER --- */
.site-footer {
  background-color: var(--color-surface);
  padding: 5rem 0 2rem;
  margin-top: 6rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .site-footer {
  border-top-color: rgba(255, 255, 255, 0.05);
}

.footer-content {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 3rem;
}

.footer-info h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.footer-info p {
  color: var(--color-text-muted);
  max-width: 300px;
}

.footer-links h4 {
  margin-bottom: 1.5rem;
  color: var(--color-text);
  font-size: 1.1rem;
  font-weight: 800;
}

.footer-links ul li {
  margin-bottom: 0.8rem;
}

.footer-links a {
  color: var(--color-text-muted);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-links a:hover {
  color: var(--color-primary);
  transform: translateX(5px);
}

.copyright {
  text-align: center;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 0.9rem;
  color: var(--color-text-muted);
  opacity: 0.7;
}

[data-theme="dark"] .copyright {
  border-top-color: rgba(255, 255, 255, 0.05);
}

/* --- MODAL --- */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(5, 11, 8, 0.8);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(8px);
}

.modal.show {
  display: flex;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background-color: var(--color-bg);
  border-radius: var(--radius-card);
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
  padding: 1.5rem;
  display: flex;
  justify-content: flex-end;
}

.close-button {
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  transition: color 0.2s;
}

.close-button:hover {
  color: var(--color-danger);
}

.modal-body {
  padding: 0 2.5rem 2.5rem;
}

.modal-image img {
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.modal-footer {
  padding: 2rem 2.5rem;
  background-color: var(--color-surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --- BACK TO TOP --- */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--color-primary);
  color: #052e16;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#back-to-top:hover {
  transform: translateY(-5px);
  background-color: var(--color-primary-hover);
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }

  .hero-content {
    text-align: center;
    order: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-image {
    order: 1;
  }

  .footer-content {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .hero-title {
    font-size: 2.8rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }
}
