/* ============================================================
   Portfolio - อาจารย์ จตุภูมิ จวนชัยภูมิ
   Custom Stylesheet
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --primary:    #0F172A;
  --secondary:  #1E3A8A;
  --accent:     #0EA5E9;
  --accent-dark:#0284C7;
  --bg:         #F8FAFC;
  --text:       #1F2937;
  --text-muted: #6B7280;
  --border:     #E5E7EB;
  --white:      #ffffff;
  --shadow:     0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-lg:  0 10px 25px -5px rgba(0,0,0,.1), 0 4px 10px -3px rgba(0,0,0,.05);
  --radius:     .875rem;
  --radius-sm:  .5rem;
  --transition: all .3s ease;
  --font-main:  'Kanit', 'Inter', sans-serif;
}

/* ── Base ───────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; }

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a { text-decoration: none; transition: var(--transition); }

.text-accent  { color: var(--accent) !important; }
.bg-primary-custom { background: var(--primary); }
.fw-600 { font-weight: 600; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar-custom {
  background: var(--primary);
  padding: .875rem 0;
  transition: var(--transition);
  box-shadow: 0 2px 20px rgba(0,0,0,.2);
}

.navbar-custom .navbar-brand {
  color: #fff;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: .01em;
}
.navbar-custom .navbar-brand:hover { color: var(--accent); }

.navbar-custom .navbar-toggler {
  border-color: rgba(255,255,255,.3);
}
.navbar-custom .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-custom .nav-link {
  color: rgba(255,255,255,.8);
  padding: .4rem .9rem;
  border-radius: var(--radius-sm);
  font-size: .93rem;
  transition: var(--transition);
}
.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
  color: #fff;
  background: rgba(255,255,255,.1);
}

.navbar-custom .btn-contact {
  background: var(--accent);
  color: #fff !important;
  margin-left: .5rem;
}
.navbar-custom .btn-contact:hover {
  background: var(--accent-dark);
}

/* shrink on scroll */
.navbar-custom.scrolled {
  padding: .5rem 0;
}

/* ── Section headers ────────────────────────────────────────── */
.section-header { margin-bottom: 3rem; }

.section-tag {
  display: inline-block;
  background: rgba(14,165,233,.12);
  color: var(--accent-dark);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .3rem .9rem;
  border-radius: 2rem;
  margin-bottom: .75rem;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--primary);
  line-height: 1.3;
}

.section-divider {
  width: 3.5rem;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--secondary));
  border-radius: 2px;
  margin: .75rem auto 1rem;
}

/* ── Hero Section ───────────────────────────────────────────── */
.hero-section {
  background: linear-gradient(135deg, var(--primary) 0%, #1a2d6e 55%, var(--secondary) 100%);
  min-height: 92vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(14,165,233,.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(30,58,138,.3) 0%, transparent 40%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(14,165,233,.2);
  border: 1px solid rgba(14,165,233,.4);
  color: #7dd3fc;
  font-size: .8rem;
  font-weight: 500;
  padding: .35rem .9rem;
  border-radius: 2rem;
  margin-bottom: 1.25rem;
}

.hero-name {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin-bottom: .75rem;
}

.hero-title {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: #93c5fd;
  margin-bottom: 1.5rem;
}

.hero-desc {
  font-size: 1rem;
  color: rgba(255,255,255,.75);
  max-width: 520px;
  margin-bottom: 2rem;
}

.skill-pills { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }

.skill-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.9);
  font-size: .82rem;
  padding: .3rem .85rem;
  border-radius: 2rem;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; }

.btn-hero-primary {
  background: var(--accent);
  color: #fff;
  padding: .7rem 1.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .95rem;
  border: none;
  transition: var(--transition);
}
.btn-hero-primary:hover {
  background: var(--accent-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(14,165,233,.4);
}

.btn-hero-outline {
  background: transparent;
  color: #fff;
  padding: .7rem 1.75rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: .95rem;
  border: 1px solid rgba(255,255,255,.4);
  transition: var(--transition);
}
.btn-hero-outline:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
  border-color: rgba(255,255,255,.7);
}

.hero-avatar-wrap {
  position: relative;
  display: inline-block;
}

.hero-avatar {
  width: clamp(220px, 30vw, 340px);
  height: clamp(220px, 30vw, 340px);
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid rgba(255,255,255,.15);
  box-shadow: 0 0 0 12px rgba(14,165,233,.1), var(--shadow-lg);
}

.hero-avatar-placeholder {
  width: clamp(220px, 30vw, 340px);
  height: clamp(220px, 30vw, 340px);
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(14,165,233,.25), rgba(30,58,138,.4));
  border: 5px solid rgba(255,255,255,.15);
  box-shadow: 0 0 0 12px rgba(14,165,233,.1), var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7rem;
  color: rgba(255,255,255,.4);
}

.hero-stat-badge {
  position: absolute;
  bottom: 1.5rem;
  right: -1rem;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: .6rem 1rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

/* ── Stat cards (hero bottom) ───────────────────────────────── */
.stat-bar {
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 1.5rem 0;
}

.stat-item { text-align: center; }
.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  font-size: .82rem;
  color: rgba(255,255,255,.65);
  margin-top: .25rem;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card-custom {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: var(--transition);
  overflow: hidden;
  height: 100%;
}
.card-custom:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(14,165,233,.3);
}

.card-img-top-custom {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, #e0f2fe, #dbeafe);
}

.card-img-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--accent);
}

/* ── Expertise card ─────────────────────────────────────────── */
.expertise-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, rgba(14,165,233,.12), rgba(30,58,138,.1));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--accent);
  margin-bottom: 1rem;
  transition: var(--transition);
}
.card-custom:hover .expertise-icon {
  background: var(--accent);
  color: #fff;
}

/* ── Tech badges ────────────────────────────────────────────── */
.tech-badge {
  display: inline-block;
  background: rgba(14,165,233,.1);
  color: var(--accent-dark);
  font-size: .75rem;
  font-weight: 600;
  padding: .2rem .7rem;
  border-radius: 2rem;
  border: 1px solid rgba(14,165,233,.2);
}

/* ── Page hero (inner pages) ────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  padding: 5rem 0 3.5rem;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 50%, rgba(14,165,233,.15), transparent 60%);
}
.page-hero h1 { color: #fff; font-weight: 700; }
.page-hero p  { color: rgba(255,255,255,.75); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn-accent {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: .55rem 1.4rem;
  font-weight: 600;
  transition: var(--transition);
}
.btn-accent:hover {
  background: var(--accent-dark);
  color: #fff;
  transform: translateY(-1px);
}

.btn-outline-accent {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: .5rem 1.4rem;
  font-weight: 600;
  transition: var(--transition);
}
.btn-outline-accent:hover {
  background: var(--accent);
  color: #fff;
}

/* ── Training timeline ──────────────────────────────────────── */
.training-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.75rem;
  position: relative;
  border-left: 4px solid var(--accent);
  transition: var(--transition);
  box-shadow: var(--shadow);
}
.training-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-lg);
}

/* ── Course card ────────────────────────────────────────────── */
.course-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem;
  height: 100%;
  transition: var(--transition);
  box-shadow: var(--shadow);
}
.course-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(14,165,233,.3);
}
.course-code {
  display: inline-block;
  background: var(--secondary);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  padding: .2rem .7rem;
  border-radius: var(--radius-sm);
  margin-bottom: .75rem;
}

/* ── Contact ────────────────────────────────────────────────── */
.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.contact-info-item:last-child { border-bottom: none; }

.contact-icon {
  width: 46px;
  height: 46px;
  min-width: 46px;
  background: linear-gradient(135deg, rgba(14,165,233,.15), rgba(30,58,138,.1));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--accent);
}

/* ── Form ───────────────────────────────────────────────────── */
.form-control, .form-select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .65rem 1rem;
  font-family: var(--font-main);
  font-size: .94rem;
  transition: var(--transition);
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14,165,233,.15);
}

/* ── Footer ─────────────────────────────────────────────────── */
.footer-section {
  background: var(--primary);
}
.footer-links a {
  color: rgba(255,255,255,.6);
  font-size: .9rem;
  display: block;
  margin-bottom: .4rem;
}
.footer-links a:hover { color: var(--accent); }

.social-icon {
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.7);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: var(--transition);
}
.social-icon:hover {
  background: var(--accent);
  color: #fff;
}

/* ── Article ────────────────────────────────────────────────── */
.article-content h2, .article-content h3 {
  color: var(--primary);
  font-weight: 600;
  margin-top: 2rem;
}
.article-content p { margin-bottom: 1.25rem; }
.article-content code {
  background: #f1f5f9;
  padding: .1em .4em;
  border-radius: .3rem;
  font-size: .9em;
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb-item a { color: rgba(255,255,255,.7); }
.breadcrumb-item a:hover { color: var(--accent); }
.breadcrumb-item.active { color: rgba(255,255,255,.9); }
.breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.5); }

/* ── Flash messages ─────────────────────────────────────────── */
.flash-success { background: #d1fae5; border: 1px solid #6ee7b7; color: #065f46; }
.flash-error   { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 991px) {
  .navbar-custom .nav-link { border-radius: var(--radius-sm); margin: .1rem 0; }
  .navbar-custom .btn-contact { margin-left: 0; margin-top: .5rem; }
  .hero-section { min-height: auto; padding: 5rem 0 3rem; }
  .hero-avatar-wrap { margin-top: 2.5rem; text-align: center; }
  .hero-stat-badge { right: 0; }
}

@media (max-width: 575px) {
  .hero-name { font-size: 1.8rem; }
  .stat-bar .col-4 { font-size: .85rem; }
}
