/* General Styles */
body {
  background: linear-gradient(-45deg, #1e3c72, #2a5298, #1e3c72, #2a5298);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  
}

@keyframes gradientBG {
  0% {background-position: 0% 50%;}
  50% {background-position: 100% 50%;}
  100% {background-position: 0% 50%;}
}

/* Header */
header {
  background: #333;
  color: #fff;
  padding: 1rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1;
}

header h1, header p {
  position: relative;
  z-index: 2;
  color: #fff;
  text-shadow: 0 0 5px rgba(0,0,0,0.5);
}

/*Heart beat animation*/
.header-lego-brick {
    width: 15px;
    height: 15px;
    background-color: #888;
    border-radius: 2px;
    opacity: 0;
    animation: flatline 3s linear infinite;
}

@keyframes flatline {
    0% { opacity: 0; }
    5% { opacity: 1; }
    95% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes pulse {
    0%, 100% { height: 4px; opacity: 0; }
    10%      { height: 4px; opacity: 1; }
    13%      { height: 36px; }
    25%      { height: 6px; }
    37%      { height: 30px; }
    50%      { height: 4px; opacity: 0; }
    
}

.heartbeat {
    animation: pulse 3s linear infinite;
}


/* Sticky Navigation Bar */
.sticky-nav {
  position: sticky;
  top: 0;
  background: #222;
  display: flex;
  justify-content: center;
  padding: 10px 0;
  z-index: 10;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.sticky-nav a.nav-icon {
  font-size: 1.8rem;
  margin: 0 12px;
  color: #fff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.sticky-nav a.nav-icon:hover,
.sticky-nav a.nav-icon:focus {
  color: #ff5722;
  outline: none;
}

/* Sections */
section, section#my-skills-section {
  padding: 20px;
  margin: 20px auto;
  max-width: 900px;
  background: #fff;
  border-bottom: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.05);
}

/* Headings color */
h1, h2, h3, h4, h5, h6 {
  color: #00ff37;
  margin-bottom: 0.5em;
}

/* Lego Header Background */
.header-lego-background {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 4px;
  z-index: 0;
  pointer-events: none;
}


/* Lego hover section */
.hover-section {
  position: relative;
  width: 100%;
  height: 80px;
  background-color: #e0e0e0;
  margin: 40px auto;
  overflow: hidden;
  perspective: 1000px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  transition: all 0.3s ease-in-out;
}

/* Lego bricks grid */
.lego-grid-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
  grid-template-rows: repeat(auto-fill, minmax(28px, 1fr));
  gap: 2px;
  pointer-events: none;
  transform-style: preserve-3d;
  
}

/* Individual Lego bricks */
.lego-brick {
  width: 100%;
  height: 100%;
  background-color: var(--lego-color, #007bff);
  border: 1px solid rgba(0,0,0,0.15);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  transform-style: preserve-3d;
  position: relative;
  border-radius: 3px;
  opacity: 0;
  transform: scale(0.1) rotateX(180deg) rotateY(180deg) translateZ(-200px);
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.5s ease-out;
}

.lego-brick::before {
  content: '';
  position: absolute;
  top: 20%;
  left: 20%;
  width: 60%;
  height: 60%;
  background-color: inherit;
  border-radius: 50%;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  transform: translateZ(5px);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.lego-brick--active {
  opacity: 1;
  transform: scale(1) rotateX(0deg) rotateY(0deg) translateZ(0);
}

/* My skills section layout */
#my-skills-section {
  background-color: #111;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 300px; /* smaller height */
  max-width: 900px; /* optional, for better horizontal control */
  margin: 20px auto; /* center horizontally with margin */
}

.lego-center {
  position: relative;
}

.lego-container {
  display: grid;
  grid-template-columns: repeat(60, 10px);
  grid-template-rows: repeat(10, 10px);
  margin: 0;
  justify-content: center;
  gap: 1px;
  position: relative;
}

.lego-brick.animate {
  animation: dropIn 0.3s forwards;
}

@keyframes dropIn {
  0% {
    opacity: 0;
    transform: scale(0.2) translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/*Day and night mode*/
/* Default (light) mode */
body {
  background-color: #f4f4f4;
  color: #333;
}

/* Night mode styles */
body.night-mode {
  background-color: #121212;
  color: #eee;
}

header.night-mode {
  background-color: #222;
  color: #eee;
}

/* Adjust other elements as needed */
section.night-mode {
  background-color: #1e1e1e;
  color: #ccc;
}
