/* ============================================
   YAYASAN AR-RISALAH - Custom Styles
   Bootstrap 5.3 handles most styling.
   This file only contains overrides & extras.
   ============================================ */

/* --- 1. CSS Variables / Root --- */
:root {
  --font-heading: 'EB Garamond', serif;
  --font-body: 'Inter', sans-serif;
  --primary-dark: #0f172a;
  --primary-blue: #2563eb;
  --primary-blue-deep: #1d4ed8;
  --primary-blue-dark: #1e3a8a;
  --bs-primary: #2563eb;
  --bs-primary-rgb: 37, 99, 235;
  --section-padding: 5rem 0;
}

html, body {
  background-color: #f8fafc;
  overflow-x: clip;
  width: 100%;
  position: relative;
}

.parallax-wrapper {
  position: relative;
  overflow: hidden;
}
.parallax-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 120%;
  z-index: -1;
  background-size: cover;
  background-position: center;
  background-attachment: scroll;
}
.overlap-section {
  position: relative;
  border-top-left-radius: 40px;
  border-top-right-radius: 40px;
  margin-top: -60px;
  box-shadow: 0 -15px 40px rgba(0,0,0,0.08);
  /* Initial state for reveal animation */
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  will-change: transform, opacity;
}
.overlap-section.section-revealed {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}
.overlap-section.bg-light {
  background-color: #f8fafc !important;
}
.overlap-section.bg-dark {
  background-color: var(--primary-dark) !important;
}
.overlap-section:not(.bg-light):not(.bg-dark):not(.bg-primary) {
  background-color: #ffffff;
}

/* --- 2. Global Overrides --- */
html, body {
  font-family: var(--font-body);
  color: #334155;
  scroll-behavior: smooth;
}

h1, h2, h3, h4, h5, h6,
.font-heading {
  font-family: var(--font-heading);
  color: var(--primary-dark);
}

/* Headings inside dark/primary backgrounds inherit white */
.bg-dark h1, .bg-dark h2, .bg-dark h3, .bg-dark h4, .bg-dark h5, .bg-dark h6,
.bg-primary h1, .bg-primary h2, .bg-primary h3, .bg-primary h4, .bg-primary h5, .bg-primary h6,
footer h1, footer h2, footer h3, footer h4, footer h5, footer h6,
[class*="text-white"] h1, [class*="text-white"] h2, [class*="text-white"] h3,
[class*="text-white"] h4, [class*="text-white"] h5, [class*="text-white"] h6 {
  color: #ffffff;
}

section {
  padding: var(--section-padding);
}

/* --- Buttons Interaction --- */
.btn {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  will-change: transform;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(13, 110, 253, 0.25);
}

.btn:active {
  transform: translateY(0) scale(0.97);
}

/* --- Hover Dropdown (Desktop Only) --- */
@media (min-width: 992px) {
  .navbar-nav .dropdown:hover > .dropdown-menu {
    display: block;
    margin-top: 0;
    animation: bouncyFadeIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
  }
  .navbar-nav .dropdown-menu {
    border: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-radius: 10px;
    padding: 0.5rem 0;
  }
  .navbar-nav .dropdown-item {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
  }
  .navbar-nav .dropdown-item:hover {
    background: #f0f6ff;
    color: #0d6efd;
  }
}
@keyframes bouncyFadeIn {
  0% { opacity: 0; transform: translateY(-10px) scale(0.95); }
  70% { opacity: 1; transform: translateY(2px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- 3. Navbar Enhancements --- */
.navbar-toggler {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.navbar-toggler:hover,
.navbar-toggler:focus,
.navbar-toggler:active {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

@media (max-width: 991.98px) {
  .navbar-toggler {
    margin-right: 0;
  }
}

.navbar-brand span {
  font-family: var(--font-heading);
  font-size: 1.25rem;
}

.navbar-brand img {
  height: 50px !important;
  max-height: 50px !important;
  width: auto !important;
  max-width: 100% !important;
}

@media (min-width: 992px) {
  .navbar-brand img {
    height: 60px !important;
    max-height: 60px !important;
  }
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background-color: #ffffff !important;
  /* overflow:hidden dihapus — menyebabkan glitch sticky di beberapa browser */
}

.navbar.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.1) !important;
}

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

@media (min-width: 992px) {
  .navbar-nav .nav-link::before {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: -2px;
    left: 50%;
    background: linear-gradient(90deg, #0ea5e9, #a855f7, #ec4899, #0ea5e9);
    background-size: 300% 100%;
    border-radius: 4px;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform: translateX(-50%);
  }

  .navbar-nav .nav-link:hover::before,
  .navbar-nav .nav-link.active::before {
    width: 90%;
    animation: rainbowLine 2s linear infinite;
  }
}

@keyframes rainbowLine {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: #0d6efd !important;
}

/* --- 4. Hero / Carousel --- */
.hero-slide {
  height: 85vh;
  min-height: 500px;
  background-size: cover;
  background-position: center;
  position: relative;
}

/* Overlay dihapus karena teks dari gambar asli */

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

/* Page headers for inner pages */
.page-header {
  background-image: linear-gradient(rgba(15, 23, 42, 0.3), rgba(30, 58, 138, 0.4)), url('https://images.unsplash.com/photo-1541339907198-e08756dedf3f?q=80&w=2070&auto=format&fit=crop');
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-color: #1e3a8a; /* fallback */
  min-height: 50vh;
  display: flex;
  align-items: center;
  padding: 8rem 0 4rem;
  position: relative;
}

@keyframes playfulGradientBg {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- 5. Cards Enhancement --- */
.card {
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.4s ease;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  border-radius: 12px;
  transform: translateZ(0); /* Fix Safari border-radius overflow bug */
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(37, 99, 235, 0.1), 0 8px 10px -6px rgba(37, 99, 235, 0.05) !important;
  border-color: rgba(37, 99, 235, 0.3);
}

/* --- 6. Feature Icon --- */
.feature-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.4s ease;
}

.card:hover .feature-icon {
  transform: scale(1.15) rotate(5deg);
}

/* --- Card Images Hover --- */
.card-img-top {
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card:hover .card-img-top {
  transform: scale(1.08);
}

/* --- 7. Gallery --- */
@keyframes galleryEnter {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(15px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.gallery-item {
  overflow: hidden;
  cursor: pointer;
  position: relative;
  animation: galleryEnter 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.gallery-item img {
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

/* --- 8. PSB Timeline --- */
.timeline-step {
  position: relative;
  padding-left: 3rem;
}

.timeline-step::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 40px;
  bottom: -20px;
  width: 2px;
  background: #dee2e6;
}

.timeline-step:last-child::before {
  display: none;
}

.step-number {
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

/* --- 9. Stats Counter --- */
.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  font-family: var(--font-heading);
}

/* --- 10. Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1050;
  cursor: pointer;
}

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

/* --- 11. Footer Enhancement --- */
footer a {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: inline-block;
}

footer a:hover {
  color: #ffffff !important;
  transform: translateX(4px);
}

footer .d-flex a:hover {
  transform: translateY(-4px);
}

/* --- 12. Scroll Animation --- */
.fade-in-up {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

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

/* --- 13. Image Helpers --- */
.img-cover {
  object-fit: cover;
  width: 100%;
}

/* --- 14. Accessibility --- */
@media (prefers-reduced-motion: reduce) {
  .fade-in-up,
  .overlap-section,
  .card,
  .card-premium,
  .gallery-item img,
  .gallery-overlay,
  .back-to-top,
  .btn {
    transition: none !important;
    animation: none !important;
  }
  .overlap-section {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* --- 15. Easter Egg --- */
.secret-admin-link {
  color: inherit;
  text-decoration: none;
  transition: all 0.3s ease;
  background-image: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3, #ff0000);
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  /* Start with no color effect (camouflaged) by masking with the inherit color */
}

/* When not hovered, make it look like normal text */
.secret-admin-link:not(:hover) {
  background: none;
  color: inherit;
  -webkit-background-clip: border-box;
  background-clip: border-box;
}

.secret-admin-link:hover {
  animation: rainbow 2s linear infinite;
  cursor: default; /* So it doesn't look like a link */
}

@keyframes rainbow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* --- Premium Card Design System (Asymmetrical) --- */
.card-premium {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 28px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.03);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
  position: relative;
}

.card-premium:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 45px rgba(13, 110, 253, 0.08);
}

.card-premium::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at top right, rgba(13, 110, 253, 0.08), transparent 30%),
              radial-gradient(circle at bottom left, rgba(25, 135, 84, 0.05), transparent 30%);
  z-index: 0;
  pointer-events: none;
  /* Removed transform transition — pseudo-element resize triggers expensive repaints */
}

.card-premium > * {
  position: relative;
  z-index: 1;
}

/* Floating massive icon inside card */
.icon-watermark {
  position: absolute;
  bottom: -20px;
  right: -20px;
  font-size: 8rem;
  opacity: 0.04;
  transform: rotate(-15deg);
  z-index: 0;
  transition: all 0.5s ease;
}

.card-premium:hover .icon-watermark {
  transform: rotate(0deg) scale(1.1);
  opacity: 0.08;
}

/* Staggered Layout — pakai margin bukan transform agar tidak shift layout */
@media (min-width: 992px) {
  .stagger-even:nth-child(even) {
    margin-top: 40px;
  }
}

/* ============================================
   Alumni Carousel — Section Testimoni
   ============================================ */
.alumni-carousel-section {
  background: linear-gradient(135deg, #f0f5ff 0%, #ffffff 60%, #eef2ff 100%);
  position: relative;
  overflow: hidden;
}
.alumni-carousel-section::before {
  content: '';
  position: absolute;
  top: -80px;
  left: -80px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(37,99,235,0.07) 0%, transparent 70%);
  pointer-events: none;
}
.alumni-carousel-section::after {
  content: '';
  position: absolute;
  bottom: -80px;
  right: -80px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(37,99,235,0.06) 0%, transparent 70%);
  pointer-events: none;
}

/* Viewport / track */
.alumni-carousel-viewport {
  overflow: hidden;
  position: relative;
  width: 100%;
}
.alumni-carousel-track {
  display: flex;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  align-items: stretch;
}

/* Individual slide wrapper */
.alumni-carousel-slide {
  flex: 0 0 calc(100% / 3);
  padding: 0 12px;
  box-sizing: border-box;
}
@media (max-width: 991.98px) {
  .alumni-carousel-slide {
    flex: 0 0 100%;
  }
}

/* Card */
.alumni-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: 0 4px 24px rgba(37,99,235,0.08);
  border: 1px solid rgba(37,99,235,0.08);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.alumni-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 36px rgba(37,99,235,0.15);
}

/* CSS Avatar */
.alumni-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'EB Garamond', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  letter-spacing: -0.5px;
}
.alumni-avatar-1 { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); }
.alumni-avatar-2 { background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%); }
.alumni-avatar-3 { background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%); }
.alumni-avatar-4 { background: linear-gradient(135deg, #059669 0%, #047857 100%); }
.alumni-avatar-5 { background: linear-gradient(135deg, #d97706 0%, #b45309 100%); }
.alumni-avatar-6 { background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); }

/* Quote icon */
.alumni-quote-icon {
  color: rgba(37,99,235,0.2);
  font-size: 2.5rem;
  line-height: 1;
  font-family: Georgia, serif;
  margin-bottom: -0.5rem;
}

/* Text */
.alumni-testimoni {
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.75;
  flex: 1;
  font-style: italic;
}
.alumni-name {
  font-family: 'EB Garamond', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e3a8a;
  margin: 0;
}
.alumni-angkatan {
  font-size: 0.78rem;
  color: #2563eb;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.alumni-univ {
  font-size: 0.82rem;
  color: #64748b;
}

/* Divider line between avatar+meta and quote */
.alumni-card-divider {
  border: none;
  border-top: 1px solid rgba(37,99,235,0.1);
  margin: 0;
}

/* Nav buttons */
.alumni-nav-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(37,99,235,0.25);
  background: #ffffff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.25s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(37,99,235,0.1);
}
.alumni-nav-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 4px 16px rgba(37,99,235,0.3);
}

/* Dots */
.alumni-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.alumni-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(37,99,235,0.25);
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  padding: 0;
}
.alumni-dot.active {
  background: #2563eb;
  width: 24px;
  border-radius: 4px;
}

/* Prevent flash of animation on page load */
.no-transition,
.no-transition * {
  transition: none !important;
}

/* ============================================
   Alumni Carousel Photo Overrides
   ============================================ */
.alumni-card-photo {
  align-items: center;
  padding: 0;
  text-align: center;
  overflow: hidden;
  gap: 0;
}

.alumni-photo-wrap {
  width: 100%;
  position: relative;
  height: 180px;
  background: linear-gradient(135deg, rgba(37,99,235,0.05), rgba(37,99,235,0.1));
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 20px;
}

.alumni-photo {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  position: relative;
  z-index: 2;
  transform: translateY(40%);
}

.alumni-photo-badge {
  position: absolute;
  bottom: 0;
  right: calc(50% - 55px + 10px);
  width: 32px;
  height: 32px;
  background: #2563eb;
  border: 3px solid #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.9rem;
  z-index: 3;
  transform: translateY(50%);
}

.alumni-card-body {
  padding: 4rem 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.alumni-card-body .alumni-quote-icon {
  margin-top: -0.5rem;
}
