/* --- General Reset --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: #f7f8fa;
  color: #2c3e50;
  line-height: 1.6;
}

/* --- Navbar --- */
.navbar {
  width: 100%;
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: auto;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.nav-logo {
  font-weight: bold;
  font-size: 1.5rem;
}

.nav-links a {
  margin-left: 1.5rem;
  text-decoration: none;
  color: #555;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: #000;
}

/* --- Sections --- */
.block {
  padding: 5rem 1rem;
}

.container {
  max-width: 1200px;
  margin: auto;
}

/* --- Introduction --- */
.intro-content {
  text-align: center;
}

.profile-pic {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
  border: 3px solid #ccc;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 1.25rem;
  color: #7f8c8d;
  margin-bottom: 1rem;
}

.description {
  max-width: 600px;
  margin: 0 auto 2rem auto;
  color: #555;
}

.buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.btn-primary, .btn-secondary {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s;
}

.btn-primary {
  background-color: #2c3e50;
  color: #fff;
}

.btn-primary:hover {
  background-color: #1a252f;
}

.btn-secondary {
  background-color: #ecf0f1;
  color: #2c3e50;
}

.btn-secondary:hover {
  background-color: #d0d7de;
}

/* --- Skills --- */
.skills-block h2 {
  text-align: center;
  margin-bottom: 3rem;
}

.skill-card {
  background-color: #fff;
  padding: 1.5rem;
  border-radius: 1rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.skill-card h3 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 120px;
  gap: 0.75rem;
  background-color: #f7f8fa;
  padding: 1rem 0.75rem;
  border-radius: 1rem;
  font-size: 1rem;
  transition: transform 0.3s, box-shadow 0.3s;
}

.skill-item img {
  width: 32px;
  height: 32px;
}

.skill-item.learning {
  background-color: #e1e4e8;
  font-style: italic;
}

/* --- Projects --- */
.projects-block h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: #333;
}

.projects-carousel-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  overflow: hidden;
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem 0;
}

.projects-carousel {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 1rem;
  cursor: grab;
}

.projects-carousel:active {
  cursor: grabbing;
}

.projects-carousel::-webkit-scrollbar {
  display: none;
}

.project-card {
  min-width: 280px;
  max-width: 320px;
  flex: 0 0 auto;
  background-color: #f7f8fa;
  border-radius: 1rem;
  padding: 1rem;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.project-title {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.project-description {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: #555;
}

.project-tech {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 0.75rem;
}

.project-links a {
  margin: 0 0.5rem;
  text-decoration: none;
  color: #1a73e8;
  font-weight: 500;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255,255,255,0.9);
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  z-index: 10;
}

.carousel-btn.prev {
  left: 0;
}

.carousel-btn.next {
  right: 0;
}

#projects-container {
  user-select: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* --- Contact --- */
.contact-block {
  text-align: center;
}

.contact-block p {
  color: #2c3e50;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.contact-block a {
  color: #2980b9;
  text-decoration: none;
  transition: color 0.3s;
}

.contact-block a:hover {
  color: #1a5276;
  text-decoration: underline;
}

.social-icon img {
  width: 32px;
  height: 32px;
  margin: 0 0.5rem;
  transition: transform 0.3s, filter 0.3s;
  vertical-align: middle;
}

.social-icon img:hover {
  transform: scale(1.1);
  filter: brightness(1.2);
}

/* --- Footer --- */
footer {
  text-align: center;
  padding: 2rem 1rem;
  background-color: #2c3e50;
  color: #fff;
  font-size: 0.9rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .nav-links {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    width: auto;
  }

  h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1.1rem;
  }

  .description {
    font-size: 0.95rem;
  }

  .btn-primary, .btn-secondary {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .skill-item {
    width: 100px;
  }

  .skill-tags {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 คอลัมน์ */
    gap: 1rem;
    justify-items: center;
  }

  .projects-carousel-wrapper {
    gap: 0.5rem;
  }

  .project-card {
    min-width: 240px;
    max-width: 280px;
  }

  .carousel-btn {
    font-size: 1.2rem;
    padding: 0.4rem 0.8rem;
  }
}

@media (max-width: 480px) {
  .nav-container {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .skill-tags {
    flex-direction: column;
    align-items: center;
  }

  .projects-carousel-wrapper {
    flex-direction: column;
  }
}
