@import url('https://fonts.googleapis.com/css2?family=Inter:wght@500;700&display=swap');
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  body {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  background-color: #FEFBEF;
  background-image: url('../assets/other/Blackboard.png');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

.page-wrapper {
  min-height: 100vh;
  width: 100%;
  background: url("../../assets/other/Blackboard.png") no-repeat center center;
  background-size: cover;
  background-attachment: fixed; /* Optional for parallax effect */
  padding: 64px; /* updated from 40px */
  box-sizing: border-box;
  padding-left: 40px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px;
  margin-bottom: 20px;
}

.nav-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.logo img {
  height: 40px;
  width: auto;
}

.back-arrow img {
  height: 30px;
  width: auto;
}
  .container {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
  }

  .page-header {
    display: flex;
    flex-direction: column;
    align-items: left;
    padding: 70px;
  }
  
  /* .logo { */
  /*   margin-bottom: 8px; */
  /* } */
  
  .main-heading {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin: 0;
  }
  
  .tile {
    width: 152px;
    height: 123px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    user-select: none;
    background-color: var(--tile-color);
    border: 1px solid #252525;
    transition: filter 0.15s;
  }
  
  .tile .icon img {
    height: 85px;
    width: auto;
    display: block; 
  }
  
  .tile .label {
    margin-top: 10px;
    font-size: 20px;
    color: #252525;
  }

a {
  text-decoration: none;
}

/* Added styles for main content layout and right panel */
/* This class creates the main horizontal layout: mood cards on the left, mascot + definition on the right */
.main-content {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 80px;
  gap: 160px;
}

/* This grid arranges mood cards in 2 columns and 3 rows */
.mood-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* two equal-width columns */
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "angry happy"
    "sad calm"
    "anxious anxious"; /* anxious spans two columns */
  gap: 16px;
  justify-items: center;
  justify-content: center;
  margin-left: 40px; /* shift mood grid to the right */
  margin-top: 50px;
}

.tile.angry { grid-area: angry; }
.tile.happy { grid-area: happy; }
.tile.sad { grid-area: sad; }
.tile.calm { grid-area: calm; }
.tile.anxious { grid-area: anxious; }

/* Custom angry tile background and border accent */
.tile.angry {
  background-color: var(--tile-color); /* keep base color system */
  border: 1px solid #252525; /* slightly stronger red accent */
}

/* Custom anxious tile background and border accent */
.tile.anxious {
  background-color: var(--tile-color); /* maintain system-defined color */
  border: 1px solid #252525; /* soft blue-gray tone for anxious state */
}

/* Custom happy tile (keep same border for unified stroke style) */
.tile.happy {
  background-color: var(--tile-color);
  border: 1px solid #252525;
}

/* Custom sad tile */
.tile.sad {
  background-color: var(--tile-color);
  border: 1px solid #252525;
}

/* Custom calm tile */
.tile.calm {
  background-color: var(--tile-color);
  border: 1px solid #252525;
}

/* This allows visual distinction per mood while keeping layout shared. */
/* Right side container for presenter and definition box */
.right-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* changed from flex-end to allow left alignment */
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
  margin-left: -40px;
  position: relative;
}

#toggleBtn {
  position: absolute;
  top: -20px;
  right: 0px;
  background:  white; /* or any preferred color */
  padding: 3px;
  border-radius: 6px;
  border: 2px solid #555;
  cursor: pointer;
}

#toggleBtn:hover {
  background-color: #cecece;
  transform: scale(1.05);
}

.speech-bubble {
  background-color: #252525;
  color: white;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 16px;
  max-width: 240px;
  margin-bottom: 10px;
  position: relative;
  transform: translate(-60px, -20px); /* 控制气泡的位置：
     - 第一个值控制左右（更负 = 向左）
     - 第二个值控制上下（更负 = 向上） */
  align-self: flex-end; /* 控制气泡在容器内靠左（也可以尝试 flex-end 居右） */
}

.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 20px;
  width: 0;
  height: 0;
  border: 10px solid transparent;
  border-top-color: #252525;
}

.mascot-image {
  height: 20vh;
  width: auto;
  margin-top: 10px; /* control presneter：
     - - = up move
     - + = down move */
  transition: opacity 0.3s ease;
}

.definition-box {
  position: relative;
  margin-top: 10px; /* move closer to mascot's foot */
  left: -60px; /* shift box left to align under mascot */
  max-width: 300px; /* increase width to match design reference */
  background-color: #F3F3F3;
  padding: 15px 20px;
  border-radius: 10px;
  border: 2px solid #ccc;
  font-size: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.definition-box strong {
  display: block;
  margin-bottom: 6px;
}
.definition-box p {
  opacity: 1;
  transition: opacity 0.2s;
  margin: 0;
  color: #333;
}


/* Subcategory grid layout styles */
.subcategory-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  padding-left: 80px;
  padding-top: 60px;
  align-items: center;
}

.subcategory-grid .tile {
  width: 160px;
  height: 130px;
  background-color: var(--tile-color);
  border: 1px solid #252525;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.subcategory-grid .tile img {
  height: 80px;
  width: auto;
}

.subcategory-grid .tile a {
  margin-top: 10px;
  font-size: 18px;
  font-weight: 500;
  color: #3f3f3f;
  text-decoration: none;
}

.subcategory-grid .tile a:hover {
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

/* Responsive styles for smaller screens */
@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding: 20px;
  }

  .mood-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "angry"
      "happy"
      "sad"
      "calm"
      "anxious";
    margin-left: 0;
  }

  .tile {
    width: 200px;
    height: 140px;
  }

  .right-panel {
    margin-left: 0;
    align-items: center;
  }

  .subcategory-grid {
    grid-template-columns: 1fr;
    padding-left: 0;
    justify-items: center;
  }

  .speech-bubble {
    align-self: center;
    transform: translate(0, -10px);
  }

  .definition-box {
    left: 0;
    text-align: center;
  }
}
/* Remove conflicting/duplicate .back-arrow or .logo rules if present elsewhere */