/* Base variables that don't change with theme */
:root {
  --transition-speed: 0.3s;
  --hero-width: 1600px;
  --border-radius: 2rem;
  --character-top-offset: 3rem;
  --header-height: 8.8rem;
}

/* Light theme variables */
.light-theme {
  --accent-color: #ffd700;
  /* --background: #c2e3fe; */
  --background: #afd9fe;
  --header-bg: rgba(255, 255, 255, 0.95);
  --nav-link-color: var(--primary-color);
  --primary-color: #d75380;
  --secondary-color: #f6d5e2;
  --primary-color-hover: #b9436a;
  --sketch-color: #ffd6dd;
  --section-bg: rgba(255, 255, 255, 0.85);
  --text: #333333;
  --white: #fff;
  --pink: #e06f96;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background-color: #87ceeb;
  background-image: url("../assets/images/bg1.png");
  background-repeat: repeat;
  background-size: contain;
  font-family: "Atma", cursive;
  font-size: 2rem;
  overflow-x: hidden;
  transition: background-color var(--transition-speed),
    color var(--transition-speed);
}

#characters-anchor-scroll {
  height: 3rem;
}

h1 {
  font-size: 5rem;
  line-height: 1.2;
}

/* Theme Styles */
body.light-theme {
  background-color: var(--background);
  color: var(--text);
}

header {
  backdrop-filter: blur(1rem);
  background: var(--header-bg);
  box-shadow: 0rem 0.2rem 0.2rem rgba(0, 0, 0, 0.2);
  border-radius: var(--border-radius);
  height: var(--header-height);
  margin: 0 auto;
  max-width: 162rem;
  position: sticky;
  top: 1rem;
  width: 100%;
  z-index: 1000;
}

nav {
  align-items: center;
  display: flex;
  justify-content: space-between;
  height: 100%;
  margin: 0 auto;
  padding: 1rem 2rem;
}

.logo {
  height: 100%;
}

.logo:hover {
  cursor: pointer;
}

.logo img {
  height: 100%;
  transition: transform var(--transition-speed) ease;
}

.logo img:hover {
  transform: scale(1.1) rotate(5deg);
}

.nav-links {
  display: flex;
  font-size: 3.5rem;
  gap: 6rem;
  justify-content: center;
  list-style: none;
}

@media (max-width: 1280px) {
  .nav-links {
    font-size: 2.5rem;
    gap: 4rem;
  }
}

@media (max-width: 1080px) {
  .nav-links {
    font-size: 2rem;
    gap: 3rem;
  }
}

@media (min-width: var(--hero-width)) {
  .nav-links {
    font-size: 3rem;
  }
}

.nav-links a {
  color: var(--nav-link-color);
  font-weight: 500;
  position: relative;
  text-decoration: none;
}

.nav-links a::after {
  background-color: var(--primary-color);
  bottom: 0;
  content: "";
  height: 0.5rem;
  left: 0;
  position: absolute;
  transition: width var(--transition-speed) ease;
  width: 0;
}

/* Language Selector start */

.custom-dropdown {
  position: absolute;
  right: 2rem;
  width: 16rem;
  user-select: none;
}

.dropdown-selected {
  padding: 0.5rem 1rem;
  border: 0.2rem solid #ccc;
  border-radius: var(--border-radius);
  background-color: white;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-speed);
}

.dropdown-selected:hover,
.dropdown-selected:hover::after {
  color: var(--primary-color);
}

.dropdown-selected::after {
  content: "▾";
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.8rem;
  color: #666;
  transition: transform var(--transition-speed);
}

@media (max-width: 768px) {
  .dropdown-selected {
    font-family: none;
    font-size: 1.8rem;
  }
}

.dropdown-options {
  position: absolute;
  width: 100%;
  top: 110%;
  left: 0;
  background-color: white;
  border: 0.2rem solid var(--primary-color);
  border-radius: var(--border-radius);
  display: none;
  overflow: hidden;
  z-index: 1;
}

.dropdown-options div {
  cursor: pointer;
  padding: 0.5rem 1rem;
}

.dropdown-options div:hover {
  background-color: var(--primary-color);
  color: var(--white);
}

.dropdown-open .dropdown-options {
  display: block;
}

.dropdown-open .dropdown-selected::after {
  transform: translateY(-50%) rotate(180deg);
}

.dropdown-selected.open {
  border-color: var(--primary-color);
}

/* Language Selector end */

.nav-links a:hover::after {
  width: 100%;
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 3.5rem;
  transition: transform var(--transition-speed) ease;
}

.theme-toggle:hover {
  transform: rotate(360deg);
}

.theme-toggle .sun,
.theme-toggle .moon {
  display: none;
}

.light-theme .theme-toggle .moon {
  display: inline-block;
}

/* Update existing sections to work with background */
.site-section {
  margin: 0 auto;
  max-width: 120rem;
  padding: 5rem;
  position: relative;
  z-index: 1;
}

/* Hero Section */
.hero-section {
  margin: 0 auto;
  max-width: var(--hero-width);
  min-height: 70vh;
  padding: 0;
}

.hero-background,
.hero-content {
  width: 100%;
}

.hero-background {
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  z-index: 1;
}

.hero-background .main-bg {
  height: 100%;
  object-fit: cover;
  object-position: bottom;
  width: 100%;
}

.hero-content {
  position: relative;
  text-align: center;
  z-index: 2;
}

.hero-text {
  background: #fff4ee;
  border: 0.2rem solid var(--primary-color);
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  position: absolute;
  right: 2rem;
  top: 3rem;
  z-index: 3;
}

.hero-text h1,
.hero-text p {
  color: var(--primary-color);
  text-shadow: 0 0.1rem 0 rgba(255, 255, 255, 1);
}

.hero-text h1 {
  animation: fadeInUp 1s ease-out;
  font-size: 2.8rem;
}

.hero-text p {
  animation: fadeInUp 1s ease-out var(--transition-speed) backwards;
  font-size: 1.8rem;
}

.hero-content .main-characters {
  margin-top: 12vh;
  transition: all var(--transition-speed);
  width: 80%;
}

.hero-content .main-characters:hover {
  transform: scale(1.02) rotate(-0.5deg);
}

.hero-content .floating-elements {
  height: auto;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
}

.cta-buttons {
  animation: fadeInUp 1s ease-out 0.6s backwards;
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.cta-buttons button {
  border: none;
  border-radius: 5rem;
  cursor: pointer;
  font-family: "Atma", cursive;
  padding: 1rem 2rem;
  transition: transform var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease;
}

.discover-btn {
  background-color: var(--primary-color);
  color: white;
}

.create-btn {
  background-color: var(--accent-color);
  color: var(--text);
}

.cta-buttons button:hover {
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.2);
  transform: translateY(-0.3rem);
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2rem);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sections */
.characters-section,
.crafts-section,
.books-section {
  background-color: transparent;
}

h1,
h2,
h3,
h4,
h5 {
  font-weight: 500;
}

h2 {
  color: var(--primary-color);
  font-size: 4rem;
  margin-bottom: 3rem;
  text-align: center;
}

h4 {
  color: var(--primary-color);
  font-size: 2rem;
}

.mb-0 {
  margin-bottom: 0;
}

.text-center {
  text-align: center;
}

.characters-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4rem;
  grid-row-gap: 7rem;
  margin: 0 auto;
  max-width: var(--hero-width);
}

.character-card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease;
  width: calc(calc(100% / 3) - 4rem);
}

.character-card:hover {
  box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.2);
  transform: translateY(-1rem);
}

.character-card:hover .character-info h3 {
  color: #000;
}

.character-card:hover .character-info p {
  color: var(--primary-color);
}

.hero-text.secondary {
  display: none;
}

@media (max-width: 960px) {
  .site-section {
    padding: 2rem;
  }

  .hero-content .main-characters {
    width: 100%;
  }

  .hero-text.main {
    display: none;
  }

  .character-grid {
    align-items: center;
    flex-direction: column;
  }

  .hero-text.secondary {
    display: block;
    margin-left: 5%;
    position: static;
    width: 90%;
  }

  .character-card {
    min-width: 35rem;
    width: 70%;
  }

  .character-image {
    height: 40rem;
    width: 100%;
  }

  .character-image img {
    height: 100%;
    width: auto !important;
  }
}

.character-image {
  align-items: center;
  background: var(--primary-color);
  border-top-left-radius: var(--border-radius);
  border-top-right-radius: var(--border-radius);
  display: flex;
  height: 30rem;
  justify-content: center;
  position: relative;
}

.characters-header {
  margin-bottom: calc(5rem + var(--character-top-offset));
}

.character-image::after {
  animation: float 10s infinite ease-in-out;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  bottom: var(--character-top-offset);
  content: "";
  height: 15rem;
  position: absolute;
  width: 15rem;
  z-index: 0;
}

@keyframes float {
  0%,
  100% {
    transform: translate(-40%, -60%) scale(0.9);
  }

  50% {
    transform: translate(-50%, -50%) scale(1.1);
  }
}

.character-image.piffsy {
  background: linear-gradient(135deg, #fde4e3 0%, #fac1c4 100%);
}

.character-image:hover.piffsy {
  background: linear-gradient(135deg, #fac1c4 100%, #fde4e3 0%);
}

.character-image.lily {
  background: linear-gradient(135deg, #d696a6 0%, #ce98ba 100%);
}

.character-image.wise-sunflower {
  background: linear-gradient(135deg, #ffd700 0%, #ffa500 100%);
}

.character-image.bubble {
  background: linear-gradient(135deg, #87ceeb 0%, #4682b4 100%);
}

.character-image.bouncekins {
  background: linear-gradient(135deg, #dda0dd 0%, #9932cc 100%);
}

.character-image img {
  bottom: 0;
  object-fit: fill;
  position: absolute;
  transform: scale(1.05);
  transform-origin: bottom;
  transition: all calc(2 * var(--transition-speed)) ease;
  width: 100%;
  z-index: 1;
}

.character-image:hover img {
  transform: scale(0.9);
}

.character-image:hover .sketch,
.character-image img.color {
  opacity: 1;
}

.character-image img.sketch,
.character-image:hover .color {
  opacity: 0;
}

.character-info {
  padding: 1.5rem;
  text-align: center;
}

.character-info h3 {
  color: var(--primary-color);
  transition: all var(--transition-speed);
}

.character-info p {
  color: #666;
  line-height: 1.5;
  margin: 0;
  transition: all var(--transition-speed);
}

.character-info .character-books {
  margin-top: 0.8rem;
}

.character-info .character-books-list {
  color: var(--primary-color);
  display: flex;
  flex-wrap: wrap;
  font-size: 1.3rem;
  gap: 1rem;
  justify-content: center;
  list-style: none;
}

.character-info .character-books-list li {
  background: hsl(340 62% 97% / 1);
  border: 0.1rem solid #edc1d2;
  border-radius: 1rem;
  color: #223f18;
  display: inline-block;
  padding: 0.3rem 1rem;
}

/* Books grid */
.books-thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.book-card {
  display: flex;
  cursor: pointer;
  flex-direction: column;
  transition: transform var(--transition-speed);
}

@media (max-width: 760px) {
  .book-card {
    margin: 1vh auto;
    width: 80%;
  }
}

.book-card:hover {
  transform: translateY(-0.6rem) rotate(1deg);
}

.book-card img {
  border-radius: var(--border-radius);
  border: 0.3rem solid var(--white);
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.book-title {
  border-radius: var(--border-radius);
  font-size: 1.8rem;
  font-weight: 500;
  margin: 1rem 0 0 0;
  padding: 0 1rem;
  text-align: center;
}

/* Book Modal */
.book-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 2000;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.book-modal.open {
  display: block;
}

.book-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(0.2rem);
}

#bookModalTitle {
  font-size: 2.4rem;
}

#bookModalDescription {
  margin: 3rem 0;
}

.book-modal__cta-container {
  text-align: center;
}

.book-modal__content {
  position: relative;
  background: #fff;
  border-radius: var(--border-radius);
  margin: 6vh auto;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  max-width: 140rem;
  width: 75vw;
  max-height: 90vh;
}

.book-modal__image {
  margin: 2rem;
}

.book-modal__image img {
  border-radius: var(--border-radius);
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.book-modal__details {
  padding: 2rem;
}

.book-modal__close {
  position: fixed;
  right: 1.2rem;
  top: 1.2rem;
  border: none;
  background: transparent;
  font-size: 6rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2001;
  color: var(--primary-color);
}

.book-modal__close:hover {
  animation: bookModalCloseSpin 0.4s ease-in-out 1;
}

@keyframes bookModalCloseSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(180deg);
  }
}

.book-modal__cta {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.8rem 1.6rem;
  border-radius: var(--border-radius);
  background: var(--primary-color);
  color: #fff;
  text-decoration: none;
  transition: all var(--transition-speed);
}

.book-modal__cta:hover {
  background: var(--primary-color-hover);
}

@media (max-width: 768px) {
  .book-modal {
    padding: 1rem;
  }

  .book-modal__content {
    grid-template-columns: 1fr;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    text-align: center;
    width: 90vw;
    max-width: 100%;
    max-height: calc(100vh - 4rem);
    margin: 1rem auto;
  }

  .book-modal__close {
    color: var(--white);
    right: 2.5rem;
    top: 2.5rem;
    font-size: 4rem;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .foreground-image {
    max-width: 32rem;
  }
}

/* About Us Images Section */
.aboutus-images-section {
  background-color: transparent;
}

.aboutus-images-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.aboutus-image-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.aboutus-image-wrapper {
  position: relative;
  display: flex;
  height: 28.5rem;
  align-items: start;
  justify-content: center;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.aboutus-image-wrapper img {
  height: 100%;
  border-radius: var(--border-radius);
  object-fit: contain;
  transition: all calc(2 * var(--transition-speed)) ease;
  width: 100%;
}

.aboutus-image-wrapper img.color {
  opacity: 1;
  position: relative;
}

.aboutus-image-wrapper img.sketch {
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
}

.aboutus-image-wrapper:hover img.color {
  opacity: 0;
}

.aboutus-image-wrapper:hover img.sketch {
  opacity: 1;
}

.aboutus-description {
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1.6;
  margin: 0;
  text-align: center;
}

@media (max-width: 768px) {
  .aboutus-images-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

footer {
  background: var(--secondary-color);
  padding: 5rem;
}

@media (max-width: 768px) {
  footer {
    padding: 2rem;
  }

  .footer-content {
    justify-content: space-around;
    margin-bottom: 2rem;
  }

  .footer-logo {
    display: none;
  }

  .go-up {
    position: static !important;
  }
}

.footer-content {
  align-items: center;
  display: flex;
  position: relative;
}

.footer-logo {
  margin-right: 10rem;
  width: 10rem;
}

.footer-logo img {
  width: 100%;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  color: inherit;
  transition: opacity var(--transition-speed);
}

.footer-links a:hover {
  opacity: 0.8;
}

.footer-copyright {
  text-align: center;
}

/* Privacy Page Styles */
.privacy-section {
  background: var(--white);
  max-width: 102.4rem;
}

.privacy-last-updated {
  font-size: 1.4rem;

  margin-bottom: 3rem;
}

.privacy-last-updated span:nth-of-type(2) {
  font-weight: bold;
}

.privacy-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.privacy-content h2 {
  text-align: left;
}

.privacy-section-item {
  margin-bottom: 2rem;
}

.privacy-section-item h2 {
  color: var(--primary-color);
  font-size: 2.4rem;
  margin-bottom: 1rem;
}

.privacy-section-item p {
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1.8;
  margin: 0 0 1rem 0;
}

.privacy-section-item p:last-child {
  margin-bottom: 0;
}

.privacy-rights-list {
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1.8;
  margin: 1rem 0;
  padding-left: 2rem;
}

.privacy-rights-list li {
  margin-bottom: 0.5rem;
}

.privacy-section-item a {
  color: var(--primary-color);
  text-decoration: none;
  transition: opacity var(--transition-speed);
}

.privacy-section-item a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.go-up {
  align-items: center;
  background: #fff;
  border-radius: var(--border-radius);
  bottom: 0;
  box-shadow: 0.2rem 0.2rem 0rem rgba(0, 0, 0, 0.07);
  display: flex;
  font-size: 4rem;
  height: 7rem;
  justify-content: center;
  line-height: 1.2;
  padding: 1rem;
  position: absolute;
  right: 0;
  text-decoration: none;
  transition: all var(--transition-speed);
  width: 7rem;
}

.go-up span {
  position: relative;
  transition: all var(--transition-speed);
}

.go-up:hover {
  transform: scale(1.1);
  transform-origin: center center;
}

/* Hamburger Menu Styles */
.hamburger-menu {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 1rem;
  z-index: 1000;
}

.hamburger-menu span {
  display: block;
  width: 2.5rem;
  height: 0.3rem;
  background-color: #333;
  margin: 0.5rem 0;
  transition: all 0.3s ease;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6rem;
  margin-left: -3rem;
  width: 100%;
}

@media screen and (max-width: 960px) {
  .hamburger-menu {
    display: block;
  }

  .nav-container {
    position: fixed;
    top: 0;
    right: 0;
    justify-content: start;
    width: 50%;
    max-width: 30rem;
    height: 100dvh;
    background-color: white;
    flex-direction: column;
    padding: 8rem 2rem 2rem;
    transition: transform 0.3s ease;
    transform: translateX(100%);
    box-shadow: -0.2rem 0 0.5rem rgba(0, 0, 0, 0.1);
    z-index: 1001;
    visibility: hidden;
    pointer-events: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-container.active {
    gap: 0rem;
    pointer-events: auto;
    transform: translateX(0);
    visibility: visible;
  }

  .nav-links {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }

  .nav-links li {
    margin: 1rem 0;
  }

  .nav-links a {
    display: inline-block;
    font-size: 2.5rem;
    width: 100%;
  }

  .custom-dropdown {
    margin-top: 2rem;
    position: relative;
    right: auto;
  }

  /* Hamburger animation */
  .hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(0.5rem, 0.5rem);
  }

  .hamburger-menu.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(0.7rem, -0.6rem);
  }
}
