/* ===== Custom CSS for PSKorner ===== */

:root {
  /* PSKorner brand system — Deep Professional Blue + Strategic Red */
  --primary: #1A3F8B;
  --primary-dark: #142F68;
  --accent: #BF1B07;
  --accent-dark: #8F1405;
  --secondary: #5B677A;
  --dark: #1F2933;
  --light: #FAF9F6;
  --border: #E7E9EE;
  --text: #1F2933;
  --text-light: #5B677A;
}

/* ===== Smooth Scrolling & Animations ===== */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

* {
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

p {
  font-family: 'Manrope', sans-serif;
  line-height: 1.6;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--primary-dark);
}

/* ===== Navigation Enhancements ===== */
nav {
  background: transparent !important;
  transition: all 0.3s ease;
}

nav.scrolled {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px) !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Darken plain nav links on scroll — but never the CTA button (any link with a bg-* utility). */
nav.scrolled a:not([class*="bg-"]) {
  color: #374151 !important;
}

nav.scrolled a:not([class*="bg-"]):hover {
  color: var(--primary) !important;
}

nav a {
  position: relative;
  font-weight: 500;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
  transition: color 0.3s ease;
}

nav a:hover {
  color: white;
}

/* Underline animation for plain nav links only — never the CTA button or logo. */
nav a:not([class*="bg-"]):not(.logo-link)::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

nav a:not([class*="bg-"]):not(.logo-link):hover::after {
  width: 100%;
}

/* ===== Partner logo marquee ===== */
.partner-marquee {
  display: flex;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.partner-track {
  display: flex;
  align-items: center;
  gap: 3.5rem;
  padding: 0 1.75rem;
  width: max-content;
  animation: partner-scroll 40s linear infinite;
}
.partner-marquee:hover .partner-track {
  animation-play-state: paused;
}
.partner-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.partner-logo img {
  height: 44px;
  width: auto;
  max-width: 170px;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.55;
  transition: filter 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}
.partner-logo:hover img {
  filter: grayscale(0);
  opacity: 1;
  transform: scale(1.05);
}
@keyframes partner-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ===== Hero Section ===== */
.hero-section {
  background: #000;
  position: relative;
  overflow: hidden;
}

/* Full-cover YouTube background video */
.hero-video {
  overflow: hidden;
}

.hero-video iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 56.25vw;      /* keep 16:9 relative to viewport width */
  min-height: 100%;
  min-width: 177.78vh;  /* keep 16:9 relative to viewport height */
  /* Overscan: crop YouTube's top title bar and bottom chrome out of view */
  transform: translate(-50%, -50%) scale(1.35);
  border: 0;
  pointer-events: none;
}

/* Background <video>: fill the hero and never respond to taps */
.hero-video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* Hide the native play button/controls some mobile browsers show over a
   background video that isn't auto-playing (iOS Safari, Android Chrome). */
.hero-video video::-webkit-media-controls,
.hero-video video::-webkit-media-controls-enclosure,
.hero-video video::-webkit-media-controls-panel,
.hero-video video::-webkit-media-controls-play-button,
.hero-video video::-webkit-media-controls-start-playback-button,
.hero-video video::-webkit-media-controls-overlay-play-button {
  display: none !important;
  -webkit-appearance: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><path d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/></g></g></svg>');
  opacity: 0.1;
}

.hero-title {
  font-size: clamp(2rem, 8vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  opacity: 0.9;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* ===== Card Animations ===== */
.card {
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: white;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card:hover {
  border-color: var(--primary);
  box-shadow: 0 12px 24px rgba(26, 63, 139, 0.15);
  transform: translateY(-8px);
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ===== Button Styles ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

/* Keep the pill shape even when .btn-primary/.btn-secondary is used without .btn */
.btn-primary,
.btn-secondary {
  border-radius: 9999px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(26, 63, 139, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 8px 25px rgba(26, 63, 139, 0.4);
  transform: translateY(-2px);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(191, 27, 7, 0.3);
}

.btn-secondary:hover {
  box-shadow: 0 8px 25px rgba(191, 27, 7, 0.4);
  transform: translateY(-2px);
}

/* ===== Unified button hover: red background, white text =====
   Applies to pill buttons (rounded-full) and .btn classes. The small footer
   social icons (bg-white/5) are excluded so they keep their own hover. */
a[class*="rounded-full"]:not([class*="bg-white/5"]):hover,
button[class*="rounded-full"]:hover,
.btn:hover,
.btn-primary:hover,
.btn-secondary:hover {
  background-color: var(--accent) !important;   /* Strategic Red #BF1B07 */
  background-image: none !important;
  color: #ffffff !important;
  border-color: var(--accent) !important;
}

/* Keep icons/text inside a hovered button white too. */
a[class*="rounded-full"]:not([class*="bg-white/5"]):hover i,
a[class*="rounded-full"]:not([class*="bg-white/5"]):hover span,
button[class*="rounded-full"]:hover i,
button[class*="rounded-full"]:hover span,
.btn:hover i,
.btn-primary:hover i,
.btn-secondary:hover i {
  color: #ffffff !important;
}

/* ===== Badge Styles ===== */
.badge {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--primary);
  color: white;
}

.badge.accent {
  background: var(--accent);
}

.badge.secondary {
  background: var(--secondary);
}

/* ===== Play Button ===== */
.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(191, 27, 7, 0.4);
  z-index: 10;
}

.play-btn:hover {
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow: 0 12px 32px rgba(191, 27, 7, 0.5);
}

/* ===== Grid Animations ===== */
.grid-item {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
}

.grid-item:nth-child(1) { animation-delay: 0.1s; }
.grid-item:nth-child(2) { animation-delay: 0.2s; }
.grid-item:nth-child(3) { animation-delay: 0.3s; }
.grid-item:nth-child(4) { animation-delay: 0.4s; }
.grid-item:nth-child(5) { animation-delay: 0.5s; }
.grid-item:nth-child(6) { animation-delay: 0.6s; }

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* ===== Site Logo (nav) ===== */
.site-logo {
  transition: filter 0.3s ease;
}

/* White logo sits on the transparent nav over the hero/video.
   When the nav turns solid white on scroll, darken the logo and the
   mobile toggle so they stay visible. */
nav.scrolled .site-logo {
  filter: brightness(0) saturate(100%) invert(19%) sepia(38%) saturate(1800%) hue-rotate(196deg) brightness(95%) contrast(95%);
}

nav.scrolled .menu-toggle {
  color: #1F2933 !important;
}

/* ===== Mobile Menu (right-slide drawer) ===== */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 360px;
  height: 100vh;
  height: 100dvh;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 60;
  box-shadow: -12px 0 44px rgba(0, 0, 0, 0.20);
}

.mobile-menu.active {
  right: 0;
}

/* Branded header with logo + close */
.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
  padding: 0 1rem 0 1.5rem;
  background: linear-gradient(135deg, #1A3F8B 0%, #0B1836 100%);
  flex-shrink: 0;
}

.mobile-menu-close {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  color: #ffffff;
  font-size: 1.5rem;
  transition: background 0.2s ease;
}

.mobile-menu-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

.mobile-menu-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0 1rem;
  overscroll-behavior: contain;
}

.mobile-link {
  display: flex;
  align-items: center;
  padding: 0.875rem 1.5rem;
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: #1F2933;
  border-bottom: 1px solid var(--border);
}

.mobile-link:hover {
  background: var(--light);
  color: var(--primary);
}

/* Collapsible groups (Knowledge / Media) */
.mobile-acc {
  border-bottom: 1px solid var(--border);
}

.mobile-acc-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.5rem;
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: #1F2933;
  background: transparent;
  cursor: pointer;
}

.mobile-acc-trigger:hover {
  background: var(--light);
  color: var(--primary);
}

.mobile-chevron {
  font-size: 1.15rem;
  color: var(--secondary);
  transition: transform 0.3s ease, color 0.2s ease;
}

.mobile-acc.open .mobile-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.mobile-acc-panel {
  max-height: 0;
  overflow: hidden;
  background: #F7F8FA;
  transition: max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-sublink {
  display: block;
  padding: 0.7rem 1.5rem 0.7rem 3.5rem;
  font-family: 'Manrope', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-light);
}

.mobile-sublink:hover {
  color: var(--primary);
  background: #eef2fb;
}

/* Dim backdrop behind the open menu */
.mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 24, 54, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  z-index: 55;
}

.mobile-menu-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* ===== Scroll Animations ===== */
.scroll-fade {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

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

/* ===== Form Styles ===== */
input, textarea {
  width: 100%;
  padding: 0.875rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 63, 139, 0.1);
}

/* ===== Loading State ===== */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }

  nav {
    padding: 1rem !important;
  }
}

/* ===== Utilities ===== */
.text-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.shadow-sm {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.shadow-md {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.shadow-lg {
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.shadow-xl {
  box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
}

.blur-bg {
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.95);
}
