@tailwind base;
@tailwind components;
@tailwind utilities;

:root,
:host {
  --font-sans:
    "Noto Sans SC", ui-sans-serif, system-ui, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
}

@font-face {
  font-family: "Noto Sans SC";
  src: url("../fonts/NotoSansSC/NotoSansSC-Thin.ttf") format("truetype");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans SC";
  src: url("../fonts/NotoSansSC/NotoSansSC-ExtraLight.ttf") format("truetype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans SC";
  src: url("../fonts/NotoSansSC/NotoSansSC-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans SC";
  src: url("../fonts/NotoSansSC/NotoSansSC-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans SC";
  src: url("../fonts/NotoSansSC/NotoSansSC-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans SC";
  src: url("../fonts/NotoSansSC/NotoSansSC-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans SC";
  src: url("../fonts/NotoSansSC/NotoSansSC-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans SC";
  src: url("../fonts/NotoSansSC/NotoSansSC-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans SC";
  src: url("../fonts/NotoSansSC/NotoSansSC-Black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Irish Grover";
  src: url("../fonts/IrishGrover/IrishGrover-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "HWMC";
  src: url("../fonts/hwmc/hwmc.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Custom Animations */
@keyframes slide-x-in {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes slide-x {
  0% {
    transform: translate(-40px, 40px);
  }
  50% {
    transform: translate(40px, -40px);
  }
  100% {
    transform: translate(-40px, 40px);
  }
}
@keyframes slide-reverce-x {
  0% {
    transform: translateX(100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes slide-reverce-x-float {
  0% {
    transform: translate(40px, 40px);
  }
  50% {
    transform: translate(-40px, -40px);
  }
  100% {
    transform: translate(40px, 40px);
  }
}
@keyframes scale-osk {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}
@keyframes translate-x {
  0% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-200px);
  }
  100% {
    transform: translateX(0);
  }
}
@keyframes slide-line-x {
  0% {
    transform: translateX(-40px);
  }
  50% {
    transform: translateX(60px);
  }
  100% {
    transform: translateX(-40px);
  }
}

.animate-slide-x-in {
  animation: slide-x-in 1s ease-out forwards;
}
.animate-slide-reverce-x {
  animation: slide-reverce-x 1s ease-out forwards;
}
.animate-scale-osk {
  animation: scale-osk 6s ease-in-out infinite;
}
.animate-translate-x {
  animation: translate-x 20s ease-in-out infinite;
}
.animate-slide-line-x {
  animation: slide-line-x 6s ease-in-out infinite;
}

/* Embla Carousel Base Styles */
.embla {
  overflow: hidden;
}
.embla__viewport {
  overflow: hidden;
  width: 100%;
}
.embla__container {
  display: flex;
  flex-direction: row;
  height: 100%;
}
.embla__slide {
  min-width: 0;
  position: relative;
  /* Default to full width if no utility class is present */
  flex: 0 0 100%;
}

/* Flex helper classes for Embla */
.flex-three {
  flex: 0 0 33.333333%;
}
.flex-four {
  flex: 0 0 25%;
}
.flex-five {
  flex: 0 0 20%;
}
.flex-seven {
  flex: 0 0 14.2857%;
}

@media (min-width: 1280px) {
  .xl\:flex-four {
    flex: 0 0 25% !important;
  }
  .xl\:flex-five {
    flex: 0 0 20% !important;
  }
}

/* Tab Styles */
.tab-btn {
  transition: all 0.3s;
}
.tab-btn.active .tab-bg {
  opacity: 1;
}

/* Scrollbar hide */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Custom Scrollbar for Modal Content */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

/* Text Clamp */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Radio Button Accent */
input[type="radio"] {
  accent-color: #111827; /* gray-900 */
}

/* Custom Utilities */
.rounded-4xl {
  border-radius: 2rem;
}
.font-noto-sc {
  font-family:
    "Noto Sans SC", ui-sans-serif, system-ui, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
}
.font-hwmc {
  font-family:
    "HWMC", "Noto Sans SC", ui-sans-serif, system-ui, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
}
.font-irish {
  font-family: "Irish Grover", cursive;
}
.item-title,
#book-title {
  font-family:
    "HWMC", "Noto Sans SC", ui-sans-serif, system-ui, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
}
#book-story-btn {
  font-family:
    "HWMC", "Noto Sans SC", ui-sans-serif, system-ui, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
}
#ip-licensing .embla__slide .text-gray-900 {
  font-family:
    "HWMC", "Noto Sans SC", ui-sans-serif, system-ui, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
}
.nav-text-lg {
  font-size: 1.5rem;
  line-height: 2rem;
}
@media (min-width: 1536px) {
  .nav-text-lg {
    font-size: 1.875rem;
    line-height: 2.25rem;
  }
}
body,
html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.section {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}
::-webkit-scrollbar {
  display: none;
}

/* Additional helper classes */
.hidden {
  display: none !important;
}
.animate-element {
  opacity: 0;
}
.show {
  opacity: 1 !important;
  pointer-events: auto !important;
}
.fade-enter {
  opacity: 0;
  transition: opacity 0.3s;
}
.fade-enter-active {
  opacity: 1;
}

/* Book Modal specific styles */
#book-viewer-container canvas {
  width: 100% !important;
  height: 100% !important;
  outline: none;
}
