@charset "UTF-8";

/* CSS rules go below */

body {
  background-image: url("../../content/images/bg.gif");
  background-size: cover;
  background-attachment: fixed;
}

.top-header {
  background-color: blue;
  color: rgb(255, 7, 139);
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.box {
  background-color: #3498db;
  color: white;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 3%, 20px);
  overflow: hidden;
  background: transparent;
  transition: margin-left 0.5s ease, margin-top 0.5s ease, transform 0.5s ease, z-index 0s;
}

.box img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  object-fit: contain;
  padding: 20px;
  pointer-events: none;
}

.flex-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  padding: 50px;
  gap: clamp(20px, 10vw, 100px);
}

/* Hide the checkbox completely */
.toggle {
  display: none;
}

/* --- THE MOVEMENT LOGIC FOR ALL 12 --- */

/* When ANY checkbox is checked, pull EVERY .box that follows it left and up */
.toggle:checked ~ .box {
  margin-left: -100px;
  margin-top: -50px;
}

/* The one you clicked grows and stays on top */
.toggle:checked + .box {
  z-index: 100;
  transform: scale(1.15);
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
}

.flex-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(20px, 8vw, 100px); /* Your responsive gap */
  padding: 50px;
}

.toggle {
  display: none; /* Hide the checkbox */
}

.box {
  cursor: pointer;
  height: 250px;
  width: 250px; /* Important: Give the box a specific width for the swap */
  position: relative; /* Stacks the two images inside */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.5s ease-in-out;
}

/* Base styling for BOTH images */
.box img {
  max-height: 100%;
  max-width: 100%;
  position: absolute; /* Stacks image A directly over image B */
  transition: opacity 0.4s ease, transform 0.4s ease; /* Smooth transition */
  pointer-events: none; /* Crucial so the click goes "through" to the label */
}

/* --- THE IMAGE SWAP LOGIC --- */

/* 1. Hide the clicked image by default */
.img-clicked {
  opacity: 0;
  transform: scale(0.8); /* Optional: make it pop from 'smaller' to 'bigger' */
}

/* 2. When the box is checked, hide the DEFAULT image */
.toggle:checked + .box .img-default {
  opacity: 0;
}

/* 3. When the box is checked, show the CLICKED image */
.toggle:checked + .box .img-clicked {
  opacity: 1;
  transform: scale(1.1); /* Optional: grows slightly on click */
}


/* --- THE MOVEMENT LOGIC (Horizontal & Vertical) --- */

/* Pull neighbors closer from the Left */
.toggle:checked ~ .box {
  margin-left: -100px; /* Increase this to make them overlap more */
}

/* Pull the rows below upward */
.toggle:checked ~ .box {
  margin-top: -60px; /* Adjust this to control vertical movement */
}

/* Ensure the active box stays on top */
.toggle:checked + .box {
  z-index: 100;
  transform: scale(1.15); /* Keep it slightly larger on click */
}