/* ===========================
   ระบบฝึกประสบการณ์วิชาชีพครู
   Custom Styles - Light Theme Only
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700;800&display=swap');

/* --- CSS Variables (Light Mode - Permanent) --- */
:root {
  --bg-primary: #f0f4f8;
  --bg-secondary: #e2e8f0;
  --bg-card: #ffffff;
  --bg-card-hover: #f8faff;
  --border-color: rgba(0, 0, 0, 0.1);
  --text-primary: #000000;
  --text-muted: #1a1a1a;
  --glow-opacity: 0.15;

  /* Card Colors */
  --c1: #7c3aed;
  /* นักศึกษา - Violet */
  --c2: #0891b2;
  /* ครูพี่เลี้ยง - Cyan */
  --c3: #1d4ed8;
  /* ผู้บริหาร - Blue */
  --c4: #d97706;
  /* ผู้แทนกรรมการ - Amber */
  --c5: #059669;
  /* อาจารย์นิเทศก์ - Emerald */
  --c6: #dc2626;
  /* Admin - Red */
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Sarabun', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- Animated Background --- */
.bg-animated {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: linear-gradient(rgba(240, 244, 248, 0.94), rgba(240, 244, 248, 0.94)), url('../../images/bg.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  pointer-events: none;
}

.bg-animated::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(0, 0, 0, 0.02) 70%, transparent 30%),
    radial-gradient(1px 1px at 80% 10%, rgba(0, 0, 0, 0.015) 70%, transparent 30%),
    radial-gradient(1.5px 1.5px at 50% 70%, rgba(0, 0, 0, 0.01) 70%, transparent 30%);
}

/* --- Main Wrapper --- */
.main-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Header / Hero --- */
.hero-section {
  text-align: center;
  margin-top: -3.5rem;
  /* ขยับขึ้นตามคำขอของผู้ใช้ (Reduced top space) */
}

.hero-logo {
  width: 200px;
  height: 200px;
  object-fit: contain;
  filter: drop-shadow(0 0 30px rgba(252, 249, 91, 0.5));
  margin-bottom: 1.2rem;
  animation: logoFloat 3s ease-in-out infinite;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

@keyframes logoFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.hero-badge {
  display: inline-block;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.3);
  color: #6d28d9;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 1rem;
  border-radius: 999px;
  margin-bottom: 0.1rem;
}

.hero-faculty {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-muted);
  color: #dc2626;
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

.hero-university {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-muted);
  color: #2a1fc4;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  background: linear-gradient(135deg, #FA4616 30%, #FA4616 100%, #FA4616 30%);
  filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.5));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 2;
  margin-bottom: 0.8rem;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--sys-text-secondary);
  font-weight: 500;
  max-width: 500px;
  margin: 0 auto 0.5rem;
}

.hero-divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #7c3aed, #0891b2);
  border-radius: 999px;
  margin: 1.5rem auto;
}

/* --- Section Label --- */
.section-label {
  text-align: center;
  margin-bottom: 2rem;
}

.section-label h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* --- User Cards Grid --- */
.cards-section {
  flex: 1;
  padding: 0 1rem 3rem;
}

.user-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2.5rem 1.5rem 2rem;
  height: 100%;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-primary);
}

.user-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.35s ease;
  border-radius: 20px;
}

.user-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(transparent, rgba(0, 0, 0, 0.02), transparent 30%);
  transform: rotate(0deg);
  transition: transform 0.6s ease;
  opacity: 0;
}

.user-card:hover {
  transform: translateY(-8px);
  border-color: var(--card-color);
  color: var(--text-primary);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 0 0 30px var(--glow-color);
}

.user-card:hover .card-title {
  color: var(--text-primary);
}

.user-card:hover .card-num {
  color: var(--text-muted);
}

.user-card:hover .card-desc {
  color: var(--text-muted);
}

.user-card:hover::before {
  opacity: 1;
}

.user-card:hover::after {
  opacity: 1;
  transform: rotate(180deg);
}

/* Card Color Themes */
.card-1 {
  --card-color: var(--c1);
  --glow-color: rgba(124, 58, 237, 0.2);
}

.card-2 {
  --card-color: var(--c2);
  --glow-color: rgba(8, 145, 178, 0.2);
}

.card-3 {
  --card-color: var(--c3);
  --glow-color: rgba(29, 78, 216, 0.2);
}

.card-4 {
  --card-color: var(--c4);
  --glow-color: rgba(217, 119, 6, 0.2);
}

.card-5 {
  --card-color: var(--c5);
  --glow-color: rgba(5, 150, 105, 0.2);
}

.card-6 {
  --card-color: var(--c6);
  --glow-color: rgba(220, 38, 38, 0.2);
}

.card-1::before {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(124, 58, 237, 0.02));
}

.card-2::before {
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.08), rgba(8, 145, 178, 0.02));
}

.card-3::before {
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.08), rgba(29, 78, 216, 0.02));
}

.card-4::before {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.08), rgba(217, 119, 6, 0.02));
}

.card-5::before {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.08), rgba(5, 150, 105, 0.02));
}

.card-6::before {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.08), rgba(220, 38, 38, 0.02));
}

/* Card Icon */
.card-icon-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.4rem;
  background: rgba(0, 0, 0, 0.04);
  border: 2px solid rgba(0, 0, 0, 0.08);
  transition: all 0.35s ease;
  position: relative;
  z-index: 1;
}

.card-1 .card-icon-wrap {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.25);
}

.card-2 .card-icon-wrap {
  background: rgba(8, 145, 178, 0.12);
  border-color: rgba(8, 145, 178, 0.25);
}

.card-3 .card-icon-wrap {
  background: rgba(29, 78, 216, 0.12);
  border-color: rgba(29, 78, 216, 0.25);
}

.card-4 .card-icon-wrap {
  background: rgba(217, 119, 6, 0.12);
  border-color: rgba(217, 119, 6, 0.25);
}

.card-5 .card-icon-wrap {
  background: rgba(5, 150, 105, 0.12);
  border-color: rgba(5, 150, 105, 0.25);
}

.card-6 .card-icon-wrap {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.25);
}

.user-card:hover .card-icon-wrap {
  transform: scale(1.1);
  box-shadow: 0 0 25px var(--glow-color);
}

.card-icon-wrap i {
  font-size: 2.2rem;
  line-height: 1;
}

.card-1 .card-icon-wrap i {
  color: #7c3aed;
}

.card-2 .card-icon-wrap i {
  color: #0891b2;
}

.card-3 .card-icon-wrap i {
  color: #1d4ed8;
}

.card-4 .card-icon-wrap i {
  color: #d97706;
}

.card-5 .card-icon-wrap i {
  color: #059669;
}

.card-6 .card-icon-wrap i {
  color: #dc2626;
}

/* Card Text */
.card-num {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  position: relative;
  z-index: 1;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
  line-height: 1.4;
  color: var(--text-primary);
}

.card-desc {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.55;
  position: relative;
  z-index: 1;
  transition: color 0.3s;
}

.card-arrow {
  position: relative;
  z-index: 1;
  margin-top: 1.2rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.35s ease;
  color: var(--text-primary);
}

.user-card:hover .card-arrow {
  background: var(--card-color);
  border-color: var(--card-color);
  color: #ffffff;
  transform: translateX(3px);
}

.card-accent {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--card-color), transparent);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.user-card:hover .card-accent {
  opacity: 1;
}

/* --- Animation on Load --- */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.delay-1 {
  animation-delay: 0.1s;
}

.delay-2 {
  animation-delay: 0.2s;
}

.delay-3 {
  animation-delay: 0.3s;
}

.delay-4 {
  animation-delay: 0.4s;
}

.delay-5 {
  animation-delay: 0.5s;
}

.delay-6 {
  animation-delay: 0.6s;
}

/* --- Footer --- */
.site-footer {
  background: var(--sys-bg-topbar);
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 1rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.site-footer p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* --- Responsive --- */
@media (max-width: 576px) {
  .hero-title {
    font-size: 1.4rem;
  }

  .user-card {
    padding: 2rem 1.2rem 1.6rem;
  }
}

/* --- Compact Desktop Grid Adjustments --- */
@media (min-width: 992px) {
  .user-card {
    padding: 1.5rem 0.75rem 1.25rem;
  }

  .card-icon-wrap {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
  }

  .card-icon-wrap i {
    font-size: 1.8rem;
  }

  .card-title {
    font-size: 1rem;
    margin-bottom: 0.4rem;
  }

  .card-desc {
    font-size: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 3.6em;
  }

  .card-arrow {
    width: 30px;
    height: 30px;
    margin-top: 1rem;
  }

  .card-num {
    font-size: 0.82rem;
  }

  .coming-soon-badge {
    font-size: 0.82rem;
    padding: 0.2rem 0.5rem;
  }
}

/* --- Disabled Cards (Coming Soon) --- */
.card-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.3);
}

.coming-soon-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin-top: 0.6rem;
  position: relative;
  z-index: 1;
}

/* --- Contact Bar (Integrated with Footer) --- */
.contact-bar-section {
  padding: 0 1rem 3rem;
}

.contact-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.5rem 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-around;
  gap: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(10px);
}

.contact-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.group-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  opacity: 0.9;
}

.group-header i {
  font-size: 1.2rem;
  background: linear-gradient(135deg, var(--c2), var(--c3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.contact-group:last-child .group-header i {
  background: linear-gradient(135deg, var(--c5), #10b981);
}

.group-content {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.contact-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s ease;
}

.contact-pill:not(.text-only):hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 0, 0, 0.2);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.contact-pill i {
  font-size: 0.9rem;
}

.contact-pill.text-only {
  cursor: default;
}

.bar-divider {
  width: 1px;
  height: 40px;
  background: var(--border-color);
}

@media (max-width: 991px) {
  .contact-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem;
  }

  .bar-divider {
    display: none;
  }

  .group-content {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 576px) {
  .contact-bar {
    border-radius: 20px;
  }
}