/* -------------------------------------------------------------
   Custom Styles & Animations for Personal Portfolio
   ------------------------------------------------------------- */

/* นำเข้าฟอนต์ภาษาไทยและอังกฤษจาก Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+Thai:wght@300;400;500;600;700&display=swap');

:root {
  --font-sans: 'Inter', 'Noto Sans Thai', sans-serif;
}

body {
  font-family: var(--font-sans);
  scroll-behavior: smooth;
  transition: background-image 0.4s ease, color 0.4s ease, border-color 0.4s ease;
  background-image: linear-gradient(rgba(248, 250, 252, 0.92), rgba(248, 250, 252, 0.92)), url('assets/fuji.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: #dc2626 !important; /* เปลี่ยนตัวหนังสือเป็นสีแดงพรีเมียม (Red 600) */
}

/* พื้นหลังฟูจิเหลือบดำม่วงพรีเมียมสำหรับ Dark Mode */
.dark body {
  background: linear-gradient(rgba(5, 1, 10, 0.88), rgba(5, 1, 10, 0.88)), url('assets/fuji.jpg') no-repeat center center fixed !important;
  background-size: cover !important;
}

/* ทำให้การเปลี่ยนธีมสมูทและเนียนตามากขึ้นในทุกๆ element */
*, *::before, *::after {
  transition-property: background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 350ms;
}

/* ซ่อน Scrollbar ของบราวเซอร์เพื่อความมินิมอล แต่ยังสกรอลล์ได้ปกติ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

.dark ::-webkit-scrollbar-track {
  background: #0f172a; /* Slate 900 */
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1; /* Slate 300 */
  border-radius: 9999px;
}

.dark ::-webkit-scrollbar-thumb {
  background: #334155; /* Slate 700 */
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8; /* Slate 400 */
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: #475569; /* Slate 600 */
}

/* แอนิเมชันสำหรับ Hero Profile รูปภาพให้ลอยตัวเบาๆ */
@keyframes float {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-12px) rotate(1deg);
  }
  100% {
    transform: translateY(0px) rotate(0deg);
  }
}

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

/* เอฟเฟกต์ Glassmorphism แบบพรีเมียม */
.glass-effect {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.dark .glass-effect {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* เอฟเฟกต์การไล่สีเรืองแสงเบื้องหลัง (Glow Effects) */
.bg-glow-blue {
  filter: blur(120px);
  opacity: 0.15;
  background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
}

.dark .bg-glow-blue {
  opacity: 0.25;
}

.bg-glow-indigo {
  filter: blur(120px);
  opacity: 0.15;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
}

.dark .bg-glow-indigo {
  opacity: 0.25;
}

.bg-glow-purple {
  filter: blur(120px);
  opacity: 0.2;
  background: radial-gradient(circle, #a855f7 0%, transparent 70%);
}

.dark .bg-glow-purple {
  opacity: 0.35;
}

/* ปรับปรุงการ Focus ฟอร์มติดต่อให้โดดเด่น */
.form-input {
  transition: all 0.3s ease;
}

.form-input:focus {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.1), 0 4px 6px -4px rgba(59, 130, 246, 0.1);
}

/* การเน้นข้อความ active เมนูเดฟ */
.nav-link-active {
  color: #3b82f6 !important;
  font-weight: 600;
}

.dark .nav-link-active {
  color: #60a5fa !important;
}

/* เอฟเฟกต์พิเศษสำหรับ Project Card Zoom & Overlay */
.project-card:hover .project-overlay {
  opacity: 1;
}

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

/* กฎเพิ่มเติมเพื่อบังคับเปลี่ยนสีตัวหนังสือทั้งหมดให้เป็นสีแดงพรีเมียม (เนื่องจากโปรเจกต์มีการใช้ Tailwind CSS) */
body, p, span, h1, h2, h3, h4, h5, h6, li, label, input, textarea {
  color: #dc2626 !important;
}
