/* Additional theme styles to match Next.js */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Thai:wght@100;200;300;400;500;600;700&family=Kanit:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

body {
  font-family: "Kanit", sans-serif;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ensure all text elements use Kanit font */
* {
  font-family: "Kanit", sans-serif;
}

/* Override any other font declarations */
input,
textarea,
select,
button {
  font-family: "Kanit", sans-serif;
}

/* Font variables to match Next.js */
:root {
  --font-kanit: "Kanit", sans-serif;
  --font-ibm-plex-sans-thai: "IBM Plex Sans Thai", sans-serif;
}

/* Font utility classes */
.font-kanit {
  font-family: var(--font-kanit);
}

.font-ibm-plex-sans-thai {
  font-family: var(--font-ibm-plex-sans-thai);
}

/* Typography improvements to match Next.js */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-kanit);
  font-weight: 700;
  line-height: 1.2;
}

p,
span,
div {
  font-family: var(--font-kanit);
  line-height: 1.6;
}

/* Specific font weights matching Next.js */
.font-light {
  font-weight: 300;
}
.font-normal {
  font-weight: 400;
}
.font-medium {
  font-weight: 500;
}
.font-semibold {
  font-weight: 600;
}
.font-bold {
  font-weight: 700;
}
.font-extrabold {
  font-weight: 800;
}
.font-black {
  font-weight: 900;
}

.site-main {
  min-height: 60vh;
}

/* Split text animation */
.split-word {
  opacity: 0;
  transform: translateY(10px);
  display: inline-block;
  transition: all 0.3s ease-out;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #005e98;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #004a7c;
}

/* Focus styles for accessibility */
*:focus {
  outline: none;
}

/* Remove focus outline for navigation links and buttons */
nav a:focus,
.menu a:focus,
button:focus,
.btn:focus,
a:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Remove focus outline for all clickable elements */
*:focus {
  outline: none !important;
}

/* Remove focus outline specifically for navigation */
#site-nav a:focus,
#mobile-menu a:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Keep focus visible for keyboard navigation only */
*:focus-visible {
  outline: 2px solid #005e98;
  outline-offset: 2px;
}

/* Button hover effects */
.btn-hover {
  transition: all 0.3s ease;
}

.btn-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 94, 152, 0.3);
}

/* Card hover effects */
.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Animation keyframes */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes bounce {
  0%,
  20%,
  53%,
  80%,
  100% {
    transform: translateY(0);
  }
  40%,
  43% {
    transform: translateY(-10px);
  }
  70% {
    transform: translateY(-5px);
  }
  90% {
    transform: translateY(-2px);
  }
}

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

/* Animation classes */
.animate-fadeInUp {
  animation: fadeInUp 0.6s ease-out;
}

.animate-fadeInLeft {
  animation: fadeInLeft 0.6s ease-out;
}

.animate-fadeInRight {
  animation: fadeInRight 0.6s ease-out;
}

.animate-fadeInDown {
  animation: fadeInDown 0.6s ease-out;
}

.animate-scaleIn {
  animation: scaleIn 0.5s ease-out;
}

.animate-slideInUp {
  animation: slideInUp 0.8s ease-out;
}

.animate-slideInLeft {
  animation: slideInLeft 0.8s ease-out;
}

.animate-slideInRight {
  animation: slideInRight 0.8s ease-out;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-bounce {
  animation: bounce 1s infinite;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* Page transition animations */
.page-enter {
  opacity: 0;
  transform: translateY(20px);
}

.page-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.page-exit {
  opacity: 1;
  transform: translateY(0);
}

.page-exit-active {
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Scroll reveal animations - Enhanced to match Next.js framer-motion */
.scroll-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease-out;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.scroll-reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: all 0.6s ease-out;
}

.scroll-reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.6s ease-out;
}

.scroll-reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.6s ease-out;
}

.scroll-reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* Enhanced stagger animations to match Next.js */
.stagger-animate > * {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease-out;
}

.stagger-animate.revealed > * {
  opacity: 1;
  transform: translateY(0);
}

.stagger-item {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease-out;
}

.stagger-item.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animations */
.stagger-1 {
  animation-delay: 0.1s;
}
.stagger-2 {
  animation-delay: 0.2s;
}
.stagger-3 {
  animation-delay: 0.3s;
}
.stagger-4 {
  animation-delay: 0.4s;
}
.stagger-5 {
  animation-delay: 0.5s;
}
.stagger-6 {
  animation-delay: 0.6s;
}

/* Utility spacing */
.mt-2 {
  margin-top: 0.5rem;
}
.mt-4 {
  margin-top: 1rem;
}
.mt-8 {
  margin-top: 2rem;
}

/* Custom gradient backgrounds */
.bg-gradient-primary {
  background: linear-gradient(135deg, #005e98 0%, #001f32 100%);
}

.bg-gradient-secondary {
  background: linear-gradient(135deg, #005e98 0%, #3b9cff 100%);
}

/* Text gradient */
.text-gradient {
  background: linear-gradient(135deg, #005e98 0%, #3b9cff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Glass morphism effect */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Loading animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Thai text optimization */
.thai-text {
  font-family: "Kanit", sans-serif;
  font-feature-settings: "liga" 1, "kern" 1;
  text-rendering: optimizeLegibility;
}

/* Responsive text sizes */
@media (max-width: 640px) {
  .text-responsive-xl {
    font-size: 1.5rem;
    line-height: 2rem;
  }
}

@media (min-width: 641px) {
  .text-responsive-xl {
    font-size: 2rem;
    line-height: 2.5rem;
  }
}

@media (min-width: 768px) {
  .text-responsive-xl {
    font-size: 2.5rem;
    line-height: 3rem;
  }
}

@media (min-width: 1024px) {
  .text-responsive-xl {
    font-size: 3rem;
    line-height: 3.5rem;
  }
}

/* Image loading styles */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Ensure navbar logo respects fixed height regardless of generic img rule */
#site-nav img {
  height: 56px;
  max-height: 56px;
  width: auto;
}
@media (max-width: 640px) {
  #site-nav img {
    height: 40px;
    max-height: 40px;
  }
}

/* Footer logo sizing */
footer img.footer-logo {
  height: 40px;
  max-height: 40px;
  width: auto;
}
@media (max-width: 640px) {
  footer img.footer-logo {
    height: 28px;
    max-height: 28px;
  }
}

/* ImageMirror effect styles */
.image-mirror-container {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  transform: scale(0.8);
}

@media (min-width: 768px) {
  .image-mirror-container {
    transform: scale(0.9);
  }
}

.image-mirror-shadow-back {
  position: absolute;
  top: 24px;
  left: 20px;
  width: 100%;
  aspect-ratio: 2/2;
  background-color: #e5e7eb;
  border-radius: 8px;
  z-index: -20;
  transform: skewX(12deg);
}

.image-mirror-shadow-middle {
  position: absolute;
  top: -20px;
  left: -20px;
  width: 100%;
  aspect-ratio: 2/2;
  background-color: #005e98;
  border-radius: 8px;
  z-index: -10;
  transform: skewX(12deg);
}

.image-mirror-image {
  position: relative;
  width: 100%;
  aspect-ratio: 2/2;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 0;
  transform: skewX(12deg);
}

.image-mirror-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: skewX(-12deg) scale(1.25);
}

/* Font loading optimization */
@font-face {
  font-family: "Kanit";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("https://fonts.gstatic.com/s/kanit/v15/nKKZ-GMqYqYgA5XaU7WzU2VN.woff2")
    format("woff2");
  unicode-range: U+0E00-0E7F, U+200C-200D, U+25CC;
}

@font-face {
  font-family: "Kanit";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("https://fonts.gstatic.com/s/kanit/v15/nKKZ-GMqYqYgA5XaU7WzU2VN.woff2")
    format("woff2");
  unicode-range: U+0E00-0E7F, U+200C-200D, U+25CC;
}

/* Hero carousel animations - matching Next.js framer-motion exactly */
.hero-fade-in {
  opacity: 0;
  transform: translateY(30px);
  animation: heroFadeIn 0.8s ease-out forwards;
}

.hero-fade-in-delay-1 {
  opacity: 0;
  transform: translateY(30px);
  animation: heroFadeIn 0.8s ease-out 0.2s forwards;
}

.hero-fade-in-delay-2 {
  opacity: 0;
  transform: translateY(30px);
  animation: heroFadeIn 0.8s ease-out 0.4s forwards;
}

.hero-fade-in-delay-3 {
  opacity: 0;
  transform: translateY(30px);
  animation: heroFadeIn 0.8s ease-out 0.6s forwards;
}

.hero-fade-in-delay-4 {
  opacity: 0;
  transform: translateY(30px);
  animation: heroFadeIn 0.8s ease-out 0.8s forwards;
}

.hero-fade-in-delay-5 {
  opacity: 0;
  transform: translateY(30px);
  animation: heroFadeIn 0.8s ease-out 1s forwards;
}

/* Enhanced scroll indicator animation to match Next.js */
.scroll-indicator {
  animation: scrollBounce 1.5s ease-in-out infinite;
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ImageMirror animation - matching Next.js */
.image-mirror-animate {
  opacity: 0;
  animation: imageMirrorFadeIn 1s ease-out forwards;
}

@keyframes imageMirrorFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Staggered animations for lists */
.stagger-item {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease-out;
}

.stagger-item.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Hover animations - matching Next.js */
/* Enhanced hover animations to match Next.js */
.hover-lift {
  transition: all 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.hover-scale {
  transition: all 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

/* Button animations matching Next.js */
.btn-animate {
  transition: all 0.3s ease;
  color: white !important;
}

.btn-animate:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: white !important;
}

/* Specific fix for services button */
.bg-\[#005E98\] {
  color: white !important;
}

.bg-\[#005E98\]:hover {
  color: white !important;
}

/* Fix for white/10 background buttons */
.bg-white\/10 {
  color: white !important;
}

.bg-white\/10:hover {
  color: white !important;
}

/* Card hover effects matching Next.js */
.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Icon animations matching Next.js */
.icon-hover {
  transition: transform 0.3s ease;
}

.icon-hover:hover {
  transform: scale(1.1);
}

/* Text reveal animation matching Next.js */
.text-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease-out;
}

.text-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Button animations - matching Next.js */
.btn-animate {
  transition: all 0.3s ease;
}

.btn-animate:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 94, 152, 0.3);
}

/* Scroll indicator animation */
.scroll-indicator {
  animation: scrollBounce 1.5s infinite;
}

@keyframes scrollBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

/* Navbar animations - matching Next.js */
.navbar-scroll {
  background: rgba(0, 31, 50, 0.5);
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
}

/* Mobile navbar scroll - darker background for better visibility */
@media (max-width: 768px) {
  .navbar-scroll {
    background: rgba(0, 31, 50, 0.85) !important;
    backdrop-filter: blur(16px);
  }
}

.navbar-scroll a:hover {
  color: #3b9cff !important;
  background-color: rgba(59, 156, 255, 0.1) !important;
}

/* Mobile menu scroll state */
.navbar-scroll #mobile-menu {
  background: rgba(0, 31, 50, 0.9) !important;
  backdrop-filter: blur(12px);
  border-color: rgba(255, 255, 255, 0.1);
}

.navbar-scroll #mobile-menu a {
  color: white !important;
}

.navbar-scroll #mobile-menu a:hover {
  color: #3b9cff !important;
  background-color: rgba(59, 156, 255, 0.1) !important;
}

.navbar-scroll #mobile-menu-button {
  color: white !important;
}

.navbar-scroll #mobile-menu-button:hover {
  color: #3b9cff !important;
  background-color: rgba(59, 156, 255, 0.1) !important;
}

.navbar-normal {
  background: white;
  transition: all 0.3s ease;
}

/* Mobile menu animations */
.mobile-menu-enter {
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.mobile-menu-enter-active {
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu-exit {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.3s ease;
}

.mobile-menu-exit-active {
  opacity: 0;
  transform: translateY(-10px);
}

/* Hamburger animation */
.hamburger-line {
  transition: all 0.3s ease;
}

.hamburger-line-1 {
  transform-origin: center;
}

.hamburger-line-2 {
  transform-origin: center;
}

.hamburger-line-3 {
  transform-origin: center;
}

.hamburger-open .hamburger-line-1 {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-open .hamburger-line-2 {
  opacity: 0;
}

.hamburger-open .hamburger-line-3 {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Page transition animations removed - only element animations */

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
