/* ===== Pin Hwa High School - Custom Styles ===== */
/* Laravel 13 + Tailwind CSS Compatible */

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

:root {
  --ph-primary: #1e40af;
  --ph-primary-light: #3b82f6;
  --ph-primary-dark: #1e3a8a;
  --ph-accent: #f59e0b;
  --ph-accent-light: #fbbf24;
  --ph-dark: #0f172a;
  --ph-gray: #64748b;
  --ph-light: #f8fafc;
  --ph-white: #ffffff;
  --ph-red: #dc2626;
  --ph-red-dark: #b91c1c;
  --ph-green: #16a34a;
  --ph-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --ph-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --ph-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  overflow-x: hidden;
}

body.lang-zh {
  font-family: 'Noto Sans SC', 'Inter', sans-serif;
}

/* Announcement Popup */
.announcement-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.announcement-overlay.active {
  opacity: 1;
  visibility: visible;
}

.announcement-modal {
  background: white;
  border-radius: 1rem;
  max-width: 90vw;
  width: 90vw;
  max-height: 80vh;
  height: 80vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

@media (min-width: 1024px) {
  .announcement-modal {
    max-width: 80vw;
    width: 80vw;
    max-height: 80vh;
    height: 80vh;
  }
}

.announcement-overlay.active .announcement-modal {
  transform: translateY(0) scale(1);
}

.announcement-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ph-red);
  color: white;
  padding: 4px 20px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(220, 38, 38, 0); }
}

.ann-slide-img { height: 260px; }
@media (min-width: 1024px) { .ann-slide-img { height: 360px; } }

/* Navigation */
.nav-scrolled {
  background: rgba(255, 255, 255, 0.97) !important;
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.nav-link {
  position: relative;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--ph-primary);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Hero Slider */
.hero-slide {
  position: relative;
  height: 100vh;
  min-height: 600px;
  max-height: 800px;
  display: flex;
  align-items: center;
}

.hero-slide::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.7) 0%, rgba(30, 64, 175, 0.5) 50%, rgba(15, 23, 42, 0.3) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-title {
  animation: slideUp 0.8s ease forwards;
}

.hero-desc {
  animation: slideUp 0.8s 0.2s ease forwards;
  opacity: 0;
}

.hero-btn {
  animation: slideUp 0.8s 0.4s ease forwards;
  opacity: 0;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Swiper Custom Styles */
.swiper-pagination-bullet {
  width: 12px;
  height: 12px;
  background: white;
  opacity: 0.5;
  transition: all 0.3s;
}

.swiper-pagination-bullet-active {
  opacity: 1;
  width: 32px;
  border-radius: 6px;
  background: white;
}

/* Leaderboard Table */
.leaderboard-table tr {
  transition: all 0.2s ease;
}

.leaderboard-table tr:hover {
  background: #f1f5f9;
  transform: scale(1.01);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.875rem;
}

.rank-1 { background: #fbbf24; color: #78350f; }

/* Horizontal Scroll Strip */
.horiz-scroll {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 8px;
}
.horiz-scroll::-webkit-scrollbar { height: 6px; }
.horiz-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.horiz-scroll > * { scroll-snap-align: start; flex-shrink: 0; }
.rank-2 { background: #cbd5e1; color: #334155; }
.rank-3 { background: #fed7aa; color: #7c2d12; }

/* News Cards */
.news-card {
  transition: all 0.3s ease;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--ph-shadow-xl);
}

.news-card:hover .news-card-img {
  transform: scale(1.05);
}

.news-card-img {
  transition: transform 0.5s ease;
}

/* Virtual Tour Preview */
.vt-hotspot {
  position: absolute;
  width: 28px;
  height: 28px;
  background: var(--ph-primary);
  border: 3px solid white;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 0 0 rgba(30, 64, 175, 0.5);
  animation: hotspot-pulse 2s infinite;
  z-index: 10;
}

.vt-hotspot:hover {
  transform: scale(1.3);
  background: var(--ph-accent);
}

@keyframes hotspot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(30, 64, 175, 0.5); }
  70% { box-shadow: 0 0 0 15px rgba(30, 64, 175, 0); }
  100% { box-shadow: 0 0 0 0 rgba(30, 64, 175, 0); }
}

.vt-tooltip {
  position: absolute;
  background: white;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--ph-shadow-lg);
  pointer-events: none;
  opacity: 0;
  transform: translateY(5px);
  transition: all 0.2s ease;
}

.vt-hotspot:hover .vt-tooltip {
  opacity: 1;
  transform: translateY(0);
}

/* Stats Counter */
.stat-number {
  font-variant-numeric: tabular-nums;
}

/* Section Transitions */
.section-fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.section-fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Bilingual font handling */
[lang="zh-CN"] {
  font-family: 'Noto Sans SC', 'Inter', sans-serif;
}

[lang="en"] {
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Mobile menu */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.open {
  transform: translateX(0);
}

/* Virtual Tour Room Cards */
.vt-room-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

.vt-room-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--ph-shadow-xl);
}

.vt-room-card:hover .vt-room-overlay {
  opacity: 1;
}

.vt-room-overlay {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* PDF Viewer Modal */
.pdf-modal {
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.pdf-modal.active {
  opacity: 1;
  visibility: visible;
}

/* Filter buttons */
.filter-btn.active {
  background: var(--ph-primary) !important;
  color: white !important;
}

/* Back to top button */
.back-to-top {
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Print styles */
@media print {
  .no-print { display: none !important; }
}
