/* ========================================
   Institut Don Bosco Huy - Student Portal
   ======================================== */

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

:root {
  --white: #FFFFFF;
  --sky: #009BC9;
  --navy: #173D88;
  --dark: #343434;
  --sky-light: #e6f5fb;
  --sky-mid: #b3e0f0;
  --navy-light: #2a5ab8;
  --navy-dark: #0f2a5e;
  --gray-100: #f7f8fa;
  --gray-200: #ebedf2;
  --gray-300: #d1d5de;
  --shadow-sm: 0 2px 8px rgba(23, 61, 136, 0.08);
  --shadow-md: 0 8px 24px rgba(23, 61, 136, 0.12);
  --shadow-lg: 0 16px 48px rgba(23, 61, 136, 0.16);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--gray-100);
  color: var(--dark);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Background Pattern */
.bg-pattern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(0, 155, 201, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(23, 61, 136, 0.06) 0%, transparent 60%),
    var(--gray-100);
}

/* Header */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.92);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--dark);
}

.header-brand:hover {
  opacity: 0.85;
}

.logo-placeholder {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--navy), var(--sky));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.logo-img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: contain;
}

.header-text h1 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--navy);
  line-height: 1.2;
}

.header-text p {
  font-size: 0.82rem;
  color: var(--sky);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.header-nav {
  display: flex;
  gap: 0.5rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--dark);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
  box-shadow: var(--shadow-sm);
}

.nav-link.accent {
  background: var(--sky);
  color: var(--white);
  border-color: var(--sky);
}

.nav-link.accent:hover {
  background: var(--navy);
  border-color: var(--navy);
}

/* Hero Section */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem 2rem;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--sky-light);
  color: var(--sky);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 1.2rem;
  border-radius: 50px;
  margin-bottom: 1.5rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hero h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 3rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

.hero h2 span {
  background: linear-gradient(135deg, var(--sky), var(--navy));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.15rem;
  color: #6b7280;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Class Cards (Homepage) */
.class-grid {
  max-width: 900px;
  margin: 3rem auto 4rem;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.class-card {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-decoration: none;
  color: var(--dark);
  border: 1px solid var(--gray-200);
  transition: var(--transition);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.class-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--sky), var(--navy));
  opacity: 0;
  transition: var(--transition);
}

.class-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

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

.class-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
}

.class-card:nth-child(1) .class-icon {
  background: linear-gradient(135deg, #e6f5fb, #b3e0f0);
  color: var(--sky);
}

.class-card:nth-child(2) .class-icon {
  background: linear-gradient(135deg, #e8edf7, #c5d0eb);
  color: var(--navy);
}

.class-card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--navy);
}

.class-card .student-count {
  font-size: 0.9rem;
  color: #9ca3af;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.class-card .btn-enter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.6rem;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 600;
  background: var(--gray-100);
  color: var(--navy);
  transition: var(--transition);
}

.class-card:hover .btn-enter {
  background: var(--navy);
  color: var(--white);
}

/* Page Title (Sub-pages) */
.page-title {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 1rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #9ca3af;
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--sky);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.breadcrumb a:hover {
  color: var(--navy);
}

.breadcrumb .separator {
  font-size: 0.7rem;
}

.page-title h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.page-title h2 span {
  color: var(--sky);
}

.page-title .subtitle {
  font-size: 1.05rem;
  color: #6b7280;
  margin-top: 0.5rem;
}

/* Student Grid */
.student-grid {
  max-width: 1200px;
  margin: 2rem auto 4rem;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

.student-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.8rem 1.5rem;
  text-decoration: none;
  color: var(--dark);
  border: 1px solid var(--gray-200);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.student-card::after {
  content: '→';
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1rem;
  color: var(--gray-300);
  transition: var(--transition);
  opacity: 0;
  transform: translateX(-4px);
}

.student-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--sky-mid);
}

.student-card:hover::after {
  opacity: 1;
  transform: translateX(0);
  color: var(--sky);
}

.student-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sky-light), var(--gray-200));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.2rem;
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  overflow: hidden;
  border: 3px solid var(--white);
  box-shadow: 0 2px 12px rgba(23, 61, 136, 0.1);
  transition: var(--transition);
}

.student-card:hover .student-avatar {
  box-shadow: 0 4px 16px rgba(0, 155, 201, 0.2);
  border-color: var(--sky-light);
}

.student-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.student-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--navy);
  margin-bottom: 0.25rem;
}

.student-firstname {
  font-size: 0.85rem;
  color: #9ca3af;
  font-weight: 400;
}

/* Footer */
.footer {
  background: var(--dark);
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  padding: 2rem;
  font-size: 0.85rem;
}

.footer strong {
  color: var(--white);
  font-weight: 600;
}

.footer a {
  color: var(--sky);
  text-decoration: none;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.15s; }
.delay-3 { animation-delay: 0.2s; }
.delay-4 { animation-delay: 0.25s; }
.delay-5 { animation-delay: 0.3s; }
.delay-6 { animation-delay: 0.35s; }
.delay-7 { animation-delay: 0.4s; }
.delay-8 { animation-delay: 0.45s; }
.delay-9 { animation-delay: 0.5s; }
.delay-10 { animation-delay: 0.55s; }
.delay-11 { animation-delay: 0.6s; }
.delay-12 { animation-delay: 0.65s; }
.delay-13 { animation-delay: 0.7s; }

/* ========== RESPONSIVE ========== */

/* Tablette */
@media (max-width: 768px) {
  .header {
    padding: 0.8rem 1.2rem;
  }

  .header-inner {
    flex-wrap: wrap;
  }

  .header-nav {
    width: 100%;
    justify-content: center;
  }

  .hero {
    padding: 2.5rem 1.5rem 1.5rem;
  }

  .hero h2 {
    font-size: 2.2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .class-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2rem auto 3rem;
    padding: 0 1.5rem;
  }

  .page-title {
    padding: 2rem 1.5rem 0.5rem;
  }

  .page-title h2 {
    font-size: 1.8rem;
  }

  .student-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    padding: 0 1.5rem;
  }

  .student-card {
    padding: 1.4rem 1rem;
  }

  .student-avatar {
    width: 64px;
    height: 64px;
    font-size: 1.2rem;
  }
}

/* Smartphone */
@media (max-width: 480px) {
  .header-text h1 {
    font-size: 1rem;
  }

  .header-text p {
    font-size: 0.75rem;
  }

  .logo-placeholder, .logo-img {
    width: 42px;
    height: 42px;
  }

  .nav-link {
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
  }

  .hero h2 {
    font-size: 1.7rem;
  }

  .hero p {
    font-size: 0.92rem;
  }

  .class-card {
    padding: 2rem 1.5rem;
  }

  .student-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    padding: 0 1rem;
  }

  .student-card {
    padding: 1.2rem 0.8rem;
  }

  .student-avatar {
    width: 56px;
    height: 56px;
    font-size: 1rem;
  }

  .student-name {
    font-size: 0.88rem;
  }

  .page-title h2 {
    font-size: 1.5rem;
  }
}
