* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Preloader Styling */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

/* Responsive Logo GIF */
#preloader img {
  width: 20vw;
  max-width: 150px;
  min-width: 40px;
  height: auto;
  animation: pulse 1.5s ease-in-out infinite;
}

/* Optional pulse animation */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

/* Ensure content loads after */
#main-content {
  padding: 20px;
}








body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #f4f4f4;
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #2c3e50;
  color: white;
  padding: 15px 30px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo {
  font-size: 24px;
  font-weight: bold;
}

.navbar {
  display: flex;
  gap: 20px;
}

.navbar a {
  color: white;
  text-decoration: none;
  font-weight: 500;
}

.menu-toggle {
  display: none;
  font-size: 28px;
  cursor: pointer;
}

/* Main */
.main-title {
  text-align: center;
  margin: 40px 10px 20px;
  font-size: clamp(20px, 4vw, 40px);
  font-weight: bold;
}

.category-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  padding: 20px;
  max-width: 1400px;
  margin: auto;
}

.category-box {
  background-color: white;
  border-radius: 14px;
  overflow: hidden;
  text-align: center;
  text-decoration: none;
  color: #2c3e50;
  font-size: 16px;
  font-weight: bold;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  z-index: 0;
}

.image-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  position: relative;
  overflow: hidden;
}

.image-wrapper img {
  width: 97%;
  height: 97%;
  object-fit: cover;
}

/* Animated borders */
.category-box::before,
.image-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(60deg, red, orange, yellow, green, cyan, blue, violet, red);
  background-size: 300% 300%;
  animation: led-border 6s ease-in-out infinite;
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 0;
}

.category-box span {
  padding: 10px;
  z-index: 1;
  position: relative;
  white-space: nowrap;              /* এক লাইনে রাখে */
  overflow: hidden;                 /* বাড়তি অংশ লুকিয়ে রাখে */
  text-overflow: ellipsis;         /* ... দেখায় যদি text বড় হয় */
  font-size: clamp(12px, 2.5vw, 16px);  /* responsive font size */
  max-width: 100%;
  display: block;
  text-align: center;
}

.category-box:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* Keyframes */
@keyframes led-border {
  0%, 100% {
    background-position: 0% 50%;
    filter: hue-rotate(0deg);
  }
  50% {
    background-position: 100% 50%;
    filter: hue-rotate(180deg);
  }
}

/* Footer */
.footer {
  background-color: #2c3e50;
  color: white;
  padding: 40px 20px;
  margin-top: auto;
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 40px;
  max-width: 1200px;
  margin: auto;
}

.footer-section {
  flex: 1 1 250px;
  min-width: 200px;
}

.footer-section h4 {
  margin-bottom: 10px;
}

.footer-section a,
.footer-section p {
  color: #ccc;
  font-size: 15px;
  margin-bottom: 6px;
  display: block;
  text-decoration: none;
}

.footer-section a:hover {
  color: white;
}

.footer-bottom {
  text-align: center;
  margin-top: 30px;
  font-size: 14px;
  border-top: 1px solid #444;
  padding-top: 10px;
  color: #aaa;
}

/* Responsive Menu */
@media (max-width: 768px) {
  .navbar {
    display: none;
    flex-direction: column;
    background-color: #2c3e50;
    position: absolute;
    top: 60px;
    right: 30px;
    width: 200px;
    padding: 10px;
    border-radius: 8px;
  }

  .navbar.active {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }

  .footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}
