/* Reset & Base Style */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333;
}

/* Navbar */
.navbar {
  position: fixed;
  width: 100%;
  top: 0;
  background: #222;
  color: white;
  display: flex; /* ใช้ Flexbox ที่นี่ */
  justify-content: space-between; /* ตัวนี้คือพระเอกที่จะแยกซ้าย-ขวา */
  align-items: center; /* จัดให้ข้อความอยู่กึ่งกลางแนวตั้ง */
  padding: 15px 30px;
  z-index: 1000;
}

/* Nav Links */
.nav-links {
  list-style: none;
  display: flex; /* ใช้ Flexbox เพื่อจัดการช่องว่างระหว่างลิงก์ */
  gap: 20px; /* ใช้ gap แทน margin-right */
  flex : 1 ;
  
}
.nav-links li:first-child {
  margin-right: auto; /* This pushes the first item (Phanuwat) to the far left */
}
.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: bold;
}
.nav-links a:hover {
  color: #00bcd4;
}

/* Navbar Links Hover */
.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 0%;
  height: 2px;
  background: #00bcd4;
  transition: width 0.3s ease;
}
.nav-links a:hover::after {
  width: 100%;
}




/* Hero Section */
.hero {
  font-size: 16px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(120deg, #333330, #bebe9b);
  color: white;
  text-align: center;
}
.hero .highlight {
  background: linear-gradient(90deg, #eef592, #d4d1a1, #a6bbc2);
  background-size: 200% auto;
  color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
  font-weight: bolder;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.4);
  animation: gradientFlow 3s ease infinite;
}

@keyframes gradientFlow {
  0% { background-position: 0% center; }
  50% { background-position: 100% center; }
  100% { background-position: 0% center; }
}

/* Name Animation */
.name {
  font-size: 64px;
  font-weight: bold;
  background: linear-gradient(90deg, #eef592, #d1cb78, #191c1d);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  color: transparent;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.4);
  animation: wave 2.5s infinite ease-in-out;
  display: inline-block;
  margin-bottom: 15px;
  letter-spacing: 2px;
}

/* เอฟเฟกต์คลื่น */
@keyframes wave {
  0% {
    transform: translateY(0);
    text-shadow: 0 0 10px rgba(0, 245, 255, 0.6);
  }
  25% {
    transform: translateY(-5px);
    text-shadow: 0 0 15px rgba(0, 245, 255, 0.8);
  }
  50% {
    transform: translateY(0);
    text-shadow: 0 0 20px rgba(0, 245, 255, 1);
  }
  75% {
    transform: translateY(5px);
    text-shadow: 0 0 15px rgba(0, 245, 255, 0.8);
  }
  100% {
    transform: translateY(0);
    text-shadow: 0 0 10px rgba(0, 245, 255, 0.6);
  }
}
/* Hero Button Hover */
.hero .btn {
  margin-top: 20px;
  padding: 10px 20px;
  background: white;
  color: #333;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  display: inline-block;
  transition: all 0.3s ease;
  margin-left: 10px;
}
.hero .btn:hover {
  background: #00bcd4;
  color: white;
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(0, 188, 212, 0.4);
}

/* ปุ่ม Resume */
.resume-btn {
  background: linear-gradient(45deg, #f5f4ab, #a0edf7);
  color: rgb(43, 40, 40);
  font-weight: bold;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  transition: 0.3s ease;
  display: inline-block;
  margin-left: 10px;
  
}

.resume-btn:hover {
  background: linear-gradient(45deg, #ff4500, #ff8c00);
  transform: scale(1.05);
}



/* Sections */
.section {
  padding: 80px 20px;
  max-width: 1000px;
  margin: auto;
}
.section h2 {
  margin-bottom: 20px;
  
  font-size: 2rem;
}

/* Tech Stack */
.tech-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}
.tech-item {
  background: #f4f4f4;
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: bold;
}

/* Projects Section */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

.project-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.project-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px; /* ทำมุมโค้งเล็กน้อย */
  border: 2px solid #fff; /* เส้นขอบบางๆ สีขาว */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); /* เพิ่มเงาให้ดูเด่น */
}

.project-content {
  padding: 1.5rem;
}

.project-title {
  font-size: 1.3rem;
  font-weight: bold;
  color: #333;
}

.project-date {
  display: block;
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 0.5rem;
}

.project-description {
  font-size: 1rem;
  margin: 0.5rem 0 1rem;
  color: #555;
}

.project-details {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  padding-left: 1.2rem;
}

.project-details li {
  margin-bottom: 0.5rem;
}

.project-links {
  display: flex;
  gap: 0.8rem;
}

.btn-link {
  text-decoration: none;
  background: linear-gradient(90deg, #6a11cb, #2575fc);
  color: #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  transition: background 0.3s ease;
}

.btn-link:hover {
  background: linear-gradient(90deg, #2575fc, #6a11cb);
}

/* Responsive for smaller devices */
@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

.contact-section {
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(135deg, #f9f9f9, #e6f0ff);
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.contact-section h2 {
  font-size: 2.2rem;
  margin-bottom: 15px;
  color: #222;
}

.contact-intro {
  font-size: 1rem;
  margin-bottom: 30px;
  color: #555;
}

.contact-icons {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 30px;
}

.icon-item {
  position: relative;
  text-align: center;
}

.icon-item a {
  font-size: 2.5rem;
  color: #333;
  transition: transform 0.3s ease, color 0.3s ease;
}

.icon-item a:hover {
  transform: translateY(-8px) ;
  color: #00a6ff; /* สีหลักเวลา hover (ปรับได้) */
  
}

/* ข้อความใต้ไอคอน */
.icon-item::after {
  content: attr(data-text);
  position: absolute;
  bottom: -35px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, bottom 0.3s ease;
}

.icon-item:hover::after {
  opacity: 1;
  bottom: -50px;
}


.contact-form {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.contact-form input,
.contact-form textarea {
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 1rem;
}

.contact-form button {
  background: linear-gradient(45deg, #0077b6, #00b4d8);
  color: white;
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: 0.3s;
}

.contact-form button:hover {
  background: linear-gradient(45deg, #00b4d8, #0077b6);
  transform: translateY(-2px);
}

/* Footer */
.footer {
  text-align: center;
  padding: 20px;
  background: #222;
  color: white;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-links {
    flex-direction: column;
    background: #333;
    position: absolute;
    top: 50px;
    right: 0;
    padding: 10px;
    display: none;
  }
}




/* Tech Stack Items */
.tech-item {
  background: #f4f4f4;
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: bold;
  cursor: pointer;
}
.tech-item:hover {
  background: #00bcd4;
  color: white;
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(0, 188, 212, 0.4);
}

/* Project Cards Hover */
.project-card {
  background: #f9f9f9;
  padding: 20px;
  margin: 15px 0;
  border-left: 5px solid #00bcd4;
  border-radius: 10px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;

}
.project-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* Contact Links Hover */
#contact a:hover {
  color: #4caf50;
  text-decoration: underline;
}

/* Typing Text Effect with Fade */
#changing-text {
  border-right: 2px solid white;
  padding-right: 5px;
  opacity: 1;
  transition: opacity 0.5s ease;
  animation: blink 0.7s infinite;
}

@keyframes blink {
  0% { border-color: white; }
  50% { border-color: transparent; }
  100% { border-color: white; }
}


/* About Section */
/* General section styling */

/* Container layout */
.about-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto;
  flex-wrap: wrap;
}

/* Profile Image */
.about-image img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid #ddd;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Content area */
.about-content {
  flex: 1;
  max-width: 600px;
}

.about-name {
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 5px;
  color: #333;
}

.about-title {
  font-size: 18px;
  color: #888;
  margin-bottom: 15px;
}

.about-description {
  font-size: 16px;
  line-height: 1.6;
  color: #555;
  text-align: justify;
}

/* Education Section */
.section.about {
  padding: 50px 20px;
  
}
.education {
  margin-top: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.education h3 {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 20px;
  color: #333;
  border-bottom: 2px solid #ddd;
  padding-bottom: 8px;
}

/* Education item */
.edu-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 15px;
  transition: transform 0.2s ease;
}

.edu-item:hover {
  transform: translateY(-3px);
}

.edu-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 8px;
}

.edu-details h4 {
  font-size: 18px;
  font-weight: bold;
  margin: 0;
  color: #333;
}

.edu-details .degree {
  font-size: 16px;
  color: #666;
}

.edu-details .year {
  font-size: 14px;
  color: #999;
}

/* Responsive */
@media (max-width: 768px) {
  .about-container {
    flex-direction: column;
    text-align: center;
  }

  .about-content {
    max-width: 100%;
  }
}

/* ====== Skills Section ====== */

.skill-title{
    text-align: center;
    font-size: 30px;
    color: #575656;
    margin-bottom: 15px;
    font-weight: bold;
    margin-top: 15px;
}
.skill-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.skill-item {
  background: linear-gradient(135deg, #eeebbb, #f1cf9c); /* ไล่สีม่วง-น้ำเงิน */
  border-radius: 12px;
  padding: 15px;
  font-size: 16px;
  font-weight: 700;
  color: #555;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.skill-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, #6a11cb, #2575fc); /* ไล่สีม่วง-น้ำเงิน */
  color: white; /* เปลี่ยนสีตัวอักษรให้อ่านง่าย */
}

/* ====== Responsive Design ====== */
@media (max-width: 768px) {
  .skill-item {
    font-size: 14px;
    padding: 10px;
  }
}

.experience-section {
  padding: 50px 20px;
  background: #f8f9fa;
}

.section-title {
  font-size: 2em;
  font-weight: bold;
  text-align: center;
  margin-bottom: 30px;
  color: #333;
}

.experience-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 25px;
  margin: 20px auto;
  max-width: 800px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.experience-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.experience-header {
  display: flex;
  align-items: center;
  gap: 15px;
}

.company-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.position {
  font-weight: 600;
  font-size: 1.1em;
  margin: 5px 0;
}

.date {
  color: gray;
  font-size: 0.9em;
}

.experience-details {
  margin: 20px 0;
  padding-left: 20px;
  list-style-type: disc;
}

.tech-used {
  font-size: 0.95em;
  color: #555;
}
