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

:root {
  --pc-navy: #1B2A4A;
  --pc-navy-light: #243556;
  --pc-gold: #C8A951;
  --pc-gold-light: #E8D48B;
  --pc-gold-dark: #A68B3C;
  --pc-white: #FFFFFF;
  --pc-gray-50: #F8FAFC;
  --pc-gray-100: #F1F5F9;
  --pc-gray-200: #E2E8F0;
  --pc-gray-600: #475569;
  --pc-gray-800: #1E293B;
  --pc-accent: #2563EB;
  --pc-success: #059669;
  --pc-danger: #DC2626;
  --glass-bg: rgba(255,255,255,0.85);
  --glass-border: rgba(255,255,255,0.3);
  --transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
}

* { font-family: 'Prompt','Sarabun', sans-serif; }
html { scroll-behavior: smooth; }
body { overflow-x: hidden; }

/* === Scrollbar === */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--pc-gray-100); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--pc-navy), var(--pc-navy-light)); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--pc-gold-dark); }

/* === Loading Screen === */
.loading-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(135deg, var(--pc-navy) 0%, #0F172A 100%);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s, visibility 0.6s;
}
.loading-screen.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.loading-spinner { position: relative; width: 100px; height: 100px; }
.loading-spinner .ring {
  position: absolute; inset: 0; border: 3px solid transparent;
  border-top-color: var(--pc-gold); border-radius: 50%;
  animation: spin 1.2s linear infinite;
}
.loading-spinner .ring:nth-child(2) {
  inset: 8px; border-top-color: var(--pc-gold-light);
  animation-duration: 1.8s; animation-direction: reverse;
}
.loading-spinner .logo-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover;
}
.loading-bar { width: 200px; height: 3px; background: rgba(255,255,255,0.1); border-radius: 3px; margin-top: 2rem; overflow: hidden; }
.loading-bar .fill { height: 100%; background: linear-gradient(90deg, var(--pc-gold), var(--pc-gold-light)); animation: loadFill 1.8s ease forwards; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes loadFill { 0%{width:0} 60%{width:75%} 100%{width:100%} }

/* === Navbar Glass === */
.navbar-glass {
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: rgba(27,42,74,0.92) !important;
  border-bottom: 1px solid rgba(200,169,81,0.15);
  transition: var(--transition);
}
.navbar-glass.scrolled { box-shadow: 0 4px 30px rgba(0,0,0,0.15); }
.navbar-glass .nav-link { color: rgba(255,255,255,0.85) !important; font-weight: 500; position: relative; padding: 0.5rem 1rem !important; transition: var(--transition); }
.navbar-glass .nav-link::after {
  content: ''; position: absolute; bottom: 0; left: 50%; width: 0; height: 2px;
  background: var(--pc-gold); transform: translateX(-50%); transition: width 0.3s;
}
.navbar-glass .nav-link:hover { color: var(--pc-gold) !important; }
.navbar-glass .nav-link:hover::after { width: 70%; }
.navbar-brand-text { font-size: 1.15rem; font-weight: 700; color: var(--pc-white) !important; }
.navbar-brand-sub { font-size: 0.7rem; color: var(--pc-gold-light); letter-spacing: 1px; }
.btn-gold { background: linear-gradient(135deg, var(--pc-gold), var(--pc-gold-dark)); color: var(--pc-navy) !important; font-weight: 600; border: none; border-radius: 50px; padding: 0.45rem 1.4rem; transition: var(--transition); box-shadow: 0 2px 15px rgba(200,169,81,0.3); }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(200,169,81,0.5); background: linear-gradient(135deg, var(--pc-gold-light), var(--pc-gold)); }

/* === Hero === */
.hero-section {
  position: relative; min-height: 100vh; display: flex; align-items: center;
  background: linear-gradient(160deg, var(--pc-navy) 0%, #0F172A 60%, #1E1B4B 100%);
  overflow: hidden;
}
.hero-section::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(200,169,81,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(37,99,235,0.06) 0%, transparent 50%);
}
.hero-pattern {
  position: absolute; inset: 0; opacity: 0.03;
  background-image: radial-gradient(circle, #fff 1px, transparent 1px);
  background-size: 30px 30px;
}
.hero-title { font-size: clamp(2.2rem,5vw,3.8rem); font-weight: 800; color: var(--pc-white); line-height: 1.2; }
.hero-title .gold { color: var(--pc-gold); }
.hero-motto { color: rgba(255,255,255,0.7); font-size: 1.1rem; font-weight: 300; letter-spacing: 0.5px; }
.hero-badge { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.4rem 1.2rem; border-radius: 50px; background: rgba(200,169,81,0.12); border: 1px solid rgba(200,169,81,0.25); color: var(--pc-gold-light); font-size: 0.85rem; font-weight: 500; backdrop-filter: blur(10px); }
.hero-cta { display: inline-flex; align-items: center; gap: 0.75rem; padding: 0.85rem 2rem; border-radius: 50px; font-weight: 600; font-size: 1rem; transition: var(--transition); text-decoration: none; }
.hero-cta-primary { background: linear-gradient(135deg, var(--pc-gold), var(--pc-gold-dark)); color: var(--pc-navy); box-shadow: 0 4px 20px rgba(200,169,81,0.35); }
.hero-cta-primary:hover { transform: translateY(-3px); box-shadow: 0 8px 35px rgba(200,169,81,0.5); color: var(--pc-navy); }
.hero-cta-outline { border: 2px solid rgba(255,255,255,0.25); color: var(--pc-white); background: rgba(255,255,255,0.05); }
.hero-cta-outline:hover { border-color: var(--pc-gold); color: var(--pc-gold); background: rgba(200,169,81,0.08); }
.hero-stats { display: flex; gap: 2.5rem; margin-top: 2.5rem; }
.hero-stat-num { font-size: 1.8rem; font-weight: 800; color: var(--pc-gold); }
.hero-stat-label { font-size: 0.8rem; color: rgba(255,255,255,0.5); }

/* === Swiper in Hero === */
.hero-slider-wrap {
  position: relative; border-radius: 16px; overflow: hidden;
  box-shadow: 0 25px 60px rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.08);
}
.hero-slider-wrap .swiper-slide img { width: 100%; height: 420px; object-fit: cover; }
@media(max-width:768px) { .hero-slider-wrap .swiper-slide img { height: 260px; } }
.hero-slider-wrap .swiper-button-next,
.hero-slider-wrap .swiper-button-prev { color: var(--pc-gold) !important; background: rgba(0,0,0,0.4); width: 40px !important; height: 40px !important; border-radius: 50%; backdrop-filter: blur(4px); }
.hero-slider-wrap .swiper-button-next::after,
.hero-slider-wrap .swiper-button-prev::after { font-size: 16px !important; }
.hero-slider-wrap .swiper-pagination-bullet-active { background: var(--pc-gold) !important; }

/* === Section Styles === */
.section-title { font-size: clamp(1.6rem,3.5vw,2.4rem); font-weight: 700; color: var(--pc-navy); }
.section-subtitle { color: var(--pc-gray-600); font-size: 1rem; max-width: 600px; margin: 0 auto; }
.section-divider { width: 60px; height: 3px; background: linear-gradient(90deg, var(--pc-gold), var(--pc-gold-dark)); border-radius: 3px; margin: 0.75rem auto; }
.section-badge { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 1rem; border-radius: 50px; background: rgba(200,169,81,0.1); border: 1px solid rgba(200,169,81,0.2); color: var(--pc-gold-dark); font-size: 0.8rem; font-weight: 600; }
.bg-pattern-light {
  background-color: var(--pc-gray-50);
  background-image: radial-gradient(circle at 1px 1px, rgba(27,42,74,0.03) 1px, transparent 0);
  background-size: 24px 24px;
}

/* === Service Cards === */
.service-card {
  background: var(--pc-white); border-radius: 16px; padding: 2rem 1.5rem;
  border: 1px solid var(--pc-gray-200); text-align: center;
  transition: var(--transition); position: relative; overflow: hidden;
}
.service-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--pc-gold), var(--pc-navy));
  transform: scaleX(0); transition: transform 0.4s; transform-origin: left;
}
.service-card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(27,42,74,0.1); border-color: rgba(200,169,81,0.3); }
.service-card:hover::before { transform: scaleX(1); }
.service-icon {
  width: 64px; height: 64px; border-radius: 16px; display: flex;
  align-items: center; justify-content: center; margin: 0 auto 1.25rem;
  font-size: 1.5rem; color: var(--pc-white); transition: var(--transition);
}
.service-card:hover .service-icon { transform: scale(1.1) rotate(3deg); }
.service-card h5 { font-weight: 600; color: var(--pc-gray-800); margin-bottom: 0.5rem; font-size: 1rem; }
.service-card p { color: var(--pc-gray-600); font-size: 0.85rem; line-height: 1.5; margin-bottom: 1rem; }
.service-link-text { color: var(--pc-gold-dark); font-weight: 600; font-size: 0.85rem; text-decoration: none; transition: var(--transition); display: inline-flex; align-items: center; gap: 0.4rem; }
.service-link-text:hover { gap: 0.7rem; color: var(--pc-navy); }
.service-badge { position: absolute; top: 12px; right: 12px; padding: 0.2rem 0.6rem; border-radius: 50px; font-size: 0.65rem; font-weight: 700; color: #fff; }
.badge-hot { background: linear-gradient(135deg, #059669, #10B981); }
.badge-new { background: linear-gradient(135deg, var(--pc-accent), #3B82F6); }
.badge-soon { background: linear-gradient(135deg, #6B7280, #9CA3AF); }

/* === Contact === */
.contact-card {
  background: var(--pc-white); border-radius: 16px; padding: 1.5rem;
  border: 1px solid var(--pc-gray-200); display: flex; align-items: center; gap: 1rem;
  transition: var(--transition); text-decoration: none; color: inherit;
}
.contact-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(27,42,74,0.08); border-color: rgba(200,169,81,0.3); color: inherit; }
.contact-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.2rem; flex-shrink: 0; transition: var(--transition); }
.contact-card:hover .contact-icon { transform: scale(1.1) rotate(5deg); }
.contact-label { font-size: 0.75rem; color: var(--pc-gray-600); margin-bottom: 0.15rem; }
.contact-value { font-weight: 600; color: var(--pc-gray-800); font-size: 0.9rem; }
.social-btn {
  width: 44px; height: 44px; border-radius: 12px; display: inline-flex;
  align-items: center; justify-content: center; color: #fff; font-size: 1.1rem;
  transition: var(--transition); text-decoration: none;
}
.social-btn:hover { transform: translateY(-4px) scale(1.1); color: #fff; }

/* === Map === */
.map-wrapper { border-radius: 16px; overflow: hidden; border: 1px solid var(--pc-gray-200); box-shadow: 0 8px 25px rgba(0,0,0,0.06); }

/* === Footer === */
.footer-section {
  background: linear-gradient(160deg, var(--pc-navy) 0%, #0F172A 100%);
  position: relative; overflow: hidden;
}
.footer-section::before {
  content: ''; position: absolute; inset: 0; opacity: 0.03;
  background-image: radial-gradient(circle, #fff 1px, transparent 1px);
  background-size: 24px 24px;
}
.footer-link { color: rgba(255,255,255,0.6); text-decoration: none; font-size: 0.9rem; transition: var(--transition); }
.footer-link:hover { color: var(--pc-gold); padding-left: 4px; }
.footer-divider { border-color: rgba(255,255,255,0.08) !important; }
.footer-copy { color: rgba(255,255,255,0.4); font-size: 0.8rem; }

/* === Animations === */
.fade-up { opacity: 0; transform: translateY(30px); transition: opacity 0.6s, transform 0.6s; }
.fade-up.visible { opacity: 1; transform: translateY(0); }
.float-shape {
  position: absolute; border-radius: 50%; opacity: 0.08;
  animation: floatShape 20s ease-in-out infinite;
}
@keyframes floatShape {
  0%,100% { transform: translate(0,0) rotate(0deg); }
  33% { transform: translate(20px,-30px) rotate(120deg); }
  66% { transform: translate(-15px,20px) rotate(240deg); }
}

/* === Back to Top === */
.back-to-top {
  position: fixed; bottom: 2rem; right: 2rem; width: 44px; height: 44px;
  border-radius: 12px; background: linear-gradient(135deg, var(--pc-navy), var(--pc-navy-light));
  color: var(--pc-gold); border: 1px solid rgba(200,169,81,0.3);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: var(--transition); z-index: 999;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2); cursor: pointer;
}
.back-to-top.show { opacity: 1; visibility: visible; }
.back-to-top:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0,0,0,0.3); }

/* === Responsive === */
@media(max-width:768px) {
  .hero-stats { gap: 1.5rem; }
  .hero-stat-num { font-size: 1.4rem; }
  .service-card { padding: 1.5rem 1.25rem; }
}
@media(prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
