/**
 * Main Stylesheet - Portfolio สกร.
 * ดีไซน์หรูหรา ถอดแบบจากรูปภาพอ้างอิง 100%
 */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-thai);
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.logo-img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(13, 148, 136, 0.2);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  line-height: 1.2;
}

[data-theme="dark"] .brand-title {
  color: var(--color-primary-light);
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Nav Links */
.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--color-primary);
  background-color: var(--bg-secondary);
}

/* Active Pill Style ตามรูปภาพ */
.nav-link.active {
  background-color: var(--color-primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

/* Header Utilities */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 170px;
  padding: 7px 34px 7px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background-color: var(--bg-input);
  color: var(--text-main);
  font-size: 0.85rem;
  font-family: inherit;
  transition: width var(--transition-normal), border-color var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  width: 210px;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.search-icon {
  position: absolute;
  right: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

/* Theme Toggle Button */
.btn-theme-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.btn-theme-toggle:hover {
  background-color: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  transform: rotate(15deg);
}

.btn-theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* Admin Quick Link */
.btn-user-profile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-user-profile:hover {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.btn-user-profile svg {
  width: 20px;
  height: 20px;
}

/* Mobile Nav Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 4px;
}

/* ==========================================================================
   Hero Section (ส่วนต้อนรับผู้บริหาร)
   ========================================================================== */
.hero-section {
  position: relative;
  background: var(--bg-hero);
  padding: 60px 0 80px 0;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 40px;
  position: relative;
  z-index: 2;
}

.hero-content {
  padding-right: 20px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 20px;
}

[data-theme="dark"] .hero-badge {
  background-color: rgba(45, 212, 191, 0.15);
  color: #5eead4;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-main);
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.hero-subtitle {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 20px;
  line-height: 1.35;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  max-width: 540px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.98rem;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.45);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background-color: var(--bg-secondary);
}

/* Executive Visual / Shapes */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 480px;
}

/* Geometric Backdrop Shapes ตามรูป */
.hero-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.shape-poly-1 {
  position: absolute;
  right: -20px;
  top: 10%;
  width: 380px;
  height: 380px;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.35) 0%, rgba(15, 118, 110, 0.1) 100%);
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
  transform: rotate(15deg);
}

.shape-poly-2 {
  position: absolute;
  right: 60px;
  bottom: 0px;
  width: 320px;
  height: 320px;
  background: linear-gradient(45deg, rgba(45, 212, 191, 0.25) 0%, rgba(13, 148, 136, 0.05) 100%);
  clip-path: polygon(25% 0%, 100% 0%, 75% 100%, 0% 100%);
}

.shape-dots {
  position: absolute;
  left: 20px;
  top: 30%;
  width: 100px;
  height: 100px;
  background-image: radial-gradient(var(--color-primary) 1.5px, transparent 1.5px);
  background-size: 14px 14px;
  opacity: 0.4;
}

.shape-glow-line {
  position: absolute;
  right: -50px;
  bottom: 80px;
  width: 250px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #fef08a, transparent);
  transform: rotate(-35deg);
  opacity: 0.8;
  filter: drop-shadow(0 0 6px #f59e0b);
}

.executive-portrait-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  border: 4px solid #ffffff;
}

[data-theme="dark"] .executive-portrait-wrap {
  border-color: #1e2e47;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.executive-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.executive-portrait-wrap:hover .executive-img {
  transform: scale(1.02);
}

.executive-badge {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .executive-badge {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(255, 255, 255, 0.1);
}

.exec-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.exec-title {
  font-size: 0.8rem;
  color: var(--color-primary);
  font-weight: 500;
}

/* ==========================================================================
   Outstanding Achievements (ผลงานที่โดดเด่น)
   ========================================================================== */
.section-achievements {
  padding: 80px 0;
  background-color: var(--bg-body);
}

.section-header-center {
  text-align: center;
  margin-bottom: 50px;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.section-subtitle-en {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary);
  letter-spacing: 0.5px;
}

/* Category Filter Tabs */
.filter-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

.filter-btn {
  padding: 8px 20px;
  border-radius: var(--radius-full);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.filter-btn.active {
  background-color: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

/* Achievement Cards Grid */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.achievement-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
}

.achievement-card:hover {
  transform: translateY(-8px);
  border-color: var(--card-hover-border);
  box-shadow: var(--shadow-lg);
}

.card-media-wrap {
  position: relative;
  width: 100%;
  padding-top: 60%; /* 16:9 - 5:3 ratio */
  overflow: hidden;
  background-color: #0f172a;
}

.card-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.achievement-card:hover .card-thumb {
  transform: scale(1.06);
}

/* Video Badge / Indicator */
.media-indicator {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
  color: #ffffff;
}

.indicator-video {
  background-color: rgba(239, 68, 68, 0.88);
}

.indicator-image {
  background-color: rgba(15, 118, 110, 0.88);
}

.indicator-icon {
  width: 14px;
  height: 14px;
}

.card-play-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: transform var(--transition-fast);
}

.achievement-card:hover .card-play-center {
  transform: translate(-50%, -50%) scale(1.15);
  background-color: #ffffff;
}

.card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-category-tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 12px;
}

.card-snippet {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  font-size: 0.82rem;
  color: var(--text-light);
}

.card-action-more {
  color: var(--color-primary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Dots indicator matching the image ( • • • ) */
.carousel-dots-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--border-color);
  transition: all var(--transition-fast);
}

.carousel-dot.active {
  width: 28px;
  border-radius: var(--radius-full);
  background-color: var(--color-primary);
}

/* ==========================================================================
   Awards & Success Section (รางวัลและความสำเร็จ - Deep Teal / Emerald)
   ========================================================================== */
.section-awards {
  position: relative;
  background: var(--awards-bg);
  padding: 85px 0 95px 0;
  color: var(--awards-text);
  overflow: hidden;
}

/* Background Glowing Elements */
.awards-decorations {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.awards-glow-1 {
  position: absolute;
  top: -50px;
  left: 20%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.25) 0%, transparent 70%);
}

.awards-glow-2 {
  position: absolute;
  bottom: -50px;
  right: 15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
}

.awards-sparkles {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(254, 240, 138, 0.4) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.25;
}

.awards-header {
  text-align: center;
  margin-bottom: 55px;
  position: relative;
  z-index: 2;
}

.awards-title {
  font-size: 2.35rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.awards-subtitle-en {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--awards-subtext);
  letter-spacing: 0.5px;
}

.awards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 35px;
  position: relative;
  z-index: 2;
}

.award-item-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: transform var(--transition-normal);
}

.award-item-card:hover {
  transform: translateY(-8px);
}

/* Trophy Visual Wrap */
.trophy-visual-wrap {
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.trophy-glow {
  position: absolute;
  bottom: 0;
  width: 170px;
  height: 45px;
  background: radial-gradient(ellipse at center, rgba(245, 158, 11, 0.6) 0%, rgba(245, 158, 11, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
  filter: blur(4px);
}

.trophy-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 25px rgba(0, 0, 0, 0.45));
  transition: transform var(--transition-normal);
}

.award-item-card:hover .trophy-image {
  transform: scale(1.08) rotate(1deg);
}

/* Certificate Frame Card Special Visual */
.cert-visual-wrap {
  position: relative;
  width: 270px;
  height: 220px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45), 0 0 20px rgba(245, 158, 11, 0.3);
  border: 3px solid rgba(254, 240, 138, 0.7);
  margin-bottom: 24px;
}

.cert-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.award-item-card:hover .cert-image {
  transform: scale(1.05);
}

.award-title-th {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
  line-height: 1.35;
}

.award-title-en {
  font-size: 0.88rem;
  color: var(--awards-subtext);
  margin-bottom: 8px;
  font-weight: 500;
}

.award-date-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.8rem;
  color: #fef08a;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   Vision & Executive Bio Section
   ========================================================================== */
.section-vision {
  padding: 80px 0;
  background-color: var(--bg-secondary);
}

.vision-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 50px 60px;
  position: relative;
  box-shadow: var(--shadow-md);
}

.vision-quote-icon {
  position: absolute;
  top: 20px;
  left: 30px;
  width: 40px;
  height: 40px;
  color: var(--color-primary-light);
  opacity: 0.35;
  z-index: 0;
}

.vision-title,
.vision-body {
  position: relative;
  z-index: 1;
}

.vision-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 16px;
}

[data-theme="dark"] .vision-title {
  color: var(--color-primary-light);
}

.vision-body {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text-main);
  font-style: italic;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background-color: #0b1320;
  color: #94a3b8;
  padding: 50px 0 25px 0;
  border-top: 1px solid #1e293b;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-org-name {
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.footer-desc {
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 420px;
}

.footer-heading {
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: #2dd4bf;
}

.footer-bottom {
  padding-top: 25px;
  border-top: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

/* ==========================================================================
   Interactive Lightbox Modal (รูปภาพ & วิดีโอขนาดใหญ่)
   ========================================================================== */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background-color: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox-modal.active {
  display: flex;
  opacity: 1;
}

.lightbox-dialog {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  max-width: 860px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.btn-close-modal {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background-color var(--transition-fast);
}

.btn-close-modal:hover {
  background: #ef4444;
}

.lightbox-media-container {
  width: 100%;
  background-color: #000000;
  position: relative;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  display: block;
}

.lightbox-video-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
}

.lightbox-details {
  padding: 24px 30px;
}

.lightbox-category {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 6px;
}

.lightbox-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
}

.lightbox-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ==========================================================================
   Utility Animations
   ========================================================================== */
@keyframes fadeIn {
  0%   { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}
