/* Careers Premium Design */
:root {
  --careers-gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --careers-gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --careers-gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --careers-primary: #667eea;
  --careers-secondary: #764ba2;
}

/* Hero Section */
.careers-hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 160px 0 140px;
  margin-bottom: 0;
  isolation: isolate;
}

.careers-hero-background {
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 0;
  overflow: hidden;
}

.careers-hero .container-fluid { position: relative; z-index: 2; }
.careers-hero-spotlight {
  position: absolute;
  top: -20%;
  left: 50%;
  width: 1200px;
  height: 1200px;
  transform: translate(-50%, 0);
  pointer-events: none;
  background: radial-gradient(circle at 50% 40%, rgba(91, 131, 255, 0.6), rgba(111, 65, 255, 0.4) 35%, rgba(33, 29, 80, 0) 72%);
  filter: blur(36px);
  opacity: 0.6;
  mix-blend-mode: screen;
  z-index: 1;
}

.careers-hero-content {
  position: relative;
  z-index: 2;
  max-width: 560px;
  margin: 0 auto;
}
.careers-cta-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.3) 60%, rgba(118, 75, 162, 0.55) 100%);
  z-index: 1;
  pointer-events: none;
}

.careers-hero::before {
  content: '';
  position: absolute;
  bottom: 18%;
  left: -30%;
  width: 160%;
  height: 220px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(173, 214, 255, 0.25) 35%, rgba(175, 214, 255, 0.45) 50%, rgba(173, 214, 255, 0.25) 65%, rgba(255, 255, 255, 0) 100%);
  filter: blur(0.5px);
  z-index: 1;
  opacity: 0.0;
  pointer-events: none;
  animation: heroSweep 8s ease-in-out infinite;
}

@keyframes heroSweep {
  0%, 20% { transform: translateX(0) translateY(0); opacity: 0; }
  25% { opacity: 0.4; }
  45% { transform: translateX(55%) translateY(-12px); opacity: 0.7; }
  65% { transform: translateX(110%) translateY(3px); opacity: 0.35; }
  80%, 100% { transform: translateX(160%) translateY(0); opacity: 0; }
}

.careers-hero::after { display: none; }

.careers-hero .btn-lg {
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.15);
  transition: all 0.3s ease;
}

.careers-hero .btn-lg:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.22);
}

.careers-badge {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(99, 102, 241, 0.12));
  color: #1e3a8a;
  border: 1px solid rgba(59, 130, 246, 0.25);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
}

.careers-hero-title {
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #1e3a8a;
  font-weight: 700;
}

.careers-hero-subtitle {
  font-size: 1.25rem;
  line-height: 1.6;
  max-width: 700px;
  color: #4a5568;
  margin-left: auto;
  margin-right: auto;
}

.careers-hero-robot {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 420px;
  border-radius: 0;
  overflow: visible;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.careers-hero-robot::before {
  display: none;
}

.careers-hero-robot-glow {
  display: none;
}

.careers-hero-canvas {
  width: 100%;
  height: 100%;
  min-height: 360px;
  max-height: 520px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  position: relative;
  z-index: 2;
  border: 0;
  overflow: visible;
  display: block;
}

.careers-hero-robot-fallback {
  position: absolute;
  inset: 6%;
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 58%),
    radial-gradient(circle at 50% 80%, rgba(120, 90, 255, 0.3), rgba(120, 90, 255, 0) 65%),
    linear-gradient(155deg, rgba(102, 126, 234, 0.28), rgba(118, 75, 162, 0.42));
  z-index: 1;
  transition: opacity 0.6s ease;
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(30, 41, 59, 0.55);
  font-weight: 600;
  letter-spacing: 0.04em;
  backdrop-filter: blur(12px);
  mask-image: radial-gradient(circle at 50% 40%, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0) 88%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0) 88%);
  pointer-events: none;
}

.careers-hero-robot-fallback::before {
  content: '';
  position: absolute;
  inset: 18% 22% 28%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0) 70%);
  filter: blur(10px);
  opacity: 0.75;
  pointer-events: none;
}

.careers-hero-robot-fallback::after {
  content: 'Future Loading...';
  font-size: 0.95rem;
  text-transform: uppercase;
  color: rgba(30, 64, 175, 0.65);
  letter-spacing: 0.12em;
  animation: fallbackPulse 1.8s ease-in-out infinite;
}

@keyframes fallbackPulse {
  0%, 100% { opacity: 0.55; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

.careers-hero-robot.is-ready .careers-hero-robot-fallback {
  opacity: 0;
  visibility: hidden;
}

.careers-hero-robot.is-error .careers-hero-robot-fallback {
  opacity: 1;
  visibility: visible;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 58%),
    radial-gradient(circle at 50% 80%, rgba(255, 127, 127, 0.32), rgba(255, 127, 127, 0) 65%),
    linear-gradient(155deg, rgba(239, 68, 68, 0.18), rgba(220, 38, 38, 0.35));
  color: rgba(185, 28, 28, 0.65);
}

.careers-hero-robot.is-error .careers-hero-robot-fallback::after {
  content: '3D preview unavailable';
  color: rgba(185, 28, 28, 0.65);
}

.min-vh-60 { min-height: 60vh; }

/* Benefit Cards */
.benefit-card {
  padding: 2rem;
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid rgba(102, 126, 234, 0.08);
  transition: all 0.3s ease;
  height: 100%;
}

.benefit-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px -15px rgba(102, 126, 234, 0.2);
  border-color: rgba(102, 126, 234, 0.2);
}

.benefit-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: var(--careers-gradient-1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: #ffffff;
  font-size: 1.5rem;
  transition: transform 0.3s ease;
}

.benefit-card:hover .benefit-icon {
  transform: scale(1.1) rotate(5deg);
}

/* Culture Section */
.culture-check-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--careers-primary);
  font-size: 0.875rem;
}

.culture-visual-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  position: relative;
}

.culture-img-card {
  aspect-ratio: 1;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease;
}

.culture-img-card:hover {
  transform: scale(1.05);
  z-index: 2;
}

.culture-img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f8f9ff 0%, #e8ecff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.culture-img-1 { animation: cultureFade 3s ease-in-out infinite; }
.culture-img-2 { animation: cultureFade 3s ease-in-out 0.5s infinite; }
.culture-img-3 { animation: cultureFade 3s ease-in-out 1s infinite; }
.culture-img-4 { animation: cultureFade 3s ease-in-out 1.5s infinite; }

@keyframes cultureFade {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Filter Bar */
.careers-filter-bar {
  background: #ffffff;
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.08);
}

.careers-filter-bar .form-select,
.careers-filter-bar .form-control {
  border-radius: 12px;
  border: 1px solid rgba(102, 126, 234, 0.15);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
}

.careers-filter-bar .form-select:focus,
.careers-filter-bar .form-control:focus {
  border-color: var(--careers-primary);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* Job Cards */
.job-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 2rem;
  border: 1px solid rgba(102, 126, 234, 0.08);
  transition: all 0.3s ease;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.job-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--careers-gradient-1);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.job-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px -15px rgba(102, 126, 234, 0.25);
  border-color: rgba(102, 126, 234, 0.2);
}

.job-card:hover::before {
  transform: scaleX(1);
}

.job-department {
  font-size: 0.875rem;
  color: var(--careers-primary);
  font-weight: 500;
}

.job-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(102, 126, 234, 0.08);
}

.job-meta-item {
  font-size: 0.875rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.job-card-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(102, 126, 234, 0.08);
}

.job-apply-text {
  font-weight: 600;
  color: var(--careers-primary);
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.job-card:hover .job-apply-text {
  transform: translateX(4px);
}

.job-card:hover .job-apply-text i {
  animation: arrowSlide 0.6s ease infinite;
}

@keyframes arrowSlide {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

/* No Jobs Card */
.no-jobs-card {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
  border-radius: 20px;
  padding: 4rem 2rem;
  text-align: center;
  border: 1px solid rgba(102, 126, 234, 0.1);
}

/* CTA Section */
.careers-cta-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 100px 0;
  position: relative;
  overflow: hidden;
  color: #ffffff;
  isolation: isolate;
  margin-top: 0;
}

.careers-cta-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.3) 60%, rgba(118, 75, 162, 0.55) 100%);
  z-index: 1;
  pointer-events: none;
}

.careers-cta-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  filter: blur(100px);
  z-index: 0;
}

.careers-cta-section .container { position: relative; z-index: 3; }
.careers-cta-mesh {
  position: absolute;
  top: -15%;
  left: 50%;
  width: 150vw;
  max-width: 2000px;
  height: 130%;
  transform: translateX(-50%);
  z-index: 2;
  opacity: 0.55;
  pointer-events: none;
  mix-blend-mode: screen;
}
.careers-cta-section h2 { color: #ffffff !important; }
.careers-cta-section .lead { color: rgba(255, 255, 255, 0.95) !important; }
.careers-cta-section .btn-primary { color: var(--careers-primary); border: none; }
.careers-cta-section .btn-primary:hover { background: rgba(255, 255, 255, 0.95); color: #0052cc !important; transform: translateY(-2px); }
.careers-cta-section .btn-outline-primary { border-color: #ffffff; color: #ffffff; background: rgba(255, 255, 255, 0.1); }
.careers-cta-section .btn-outline-primary:hover { background: rgba(255, 255, 255, 0.2); }

/* Single Job Page */
#page-career-single {
  padding-top: 140px;
  padding-bottom: 80px;
}

#page-career-single .card {
  border: 1px solid rgba(102, 126, 234, 0.08);
  border-radius: 20px;
}

#page-career-single aside.card {
  border: 1px solid rgba(102, 126, 234, 0.12);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.02), rgba(118, 75, 162, 0.02));
}

/* Smooth Scrolling */
.smooth-scroll {
  scroll-behavior: smooth;
}

/* Section Spacing & Z-Index */
section[id="benefits"],
section[id="culture"],
section[id="open-roles"] {
  position: relative;
  z-index: 1;
  background-clip: padding-box;
}

section[id="benefits"] { background: #f7fafc !important; }
section[id="culture"] { background: #ffffff !important; }
section[id="open-roles"] { background: #f7fafc !important; }

/* Text Visibility Fixes */
.careers-hero h1,
.careers-hero p,
.careers-hero .btn {
  position: relative;
  z-index: 2;
}

.stat-number,
.stat-label {
  position: relative;
  z-index: 2;
}

/* Ensure no overlap */
.py-5 {
  position: relative;
}

/* Responsive */
@media (max-width: 991.98px) {
  .careers-hero { min-height: 70vh; padding: 120px 0 80px; }
  .careers-hero-title { font-size: 2.5rem; }
  .careers-hero-content { max-width: 100%; }
  .careers-hero-subtitle { margin-left: auto; margin-right: auto; }
  .careers-hero-robot { min-height: 320px; padding: 18px; margin: 0 auto; }
  .careers-hero-robot spline-viewer { min-height: 280px; }
  .culture-visual-grid { gap: 1rem; }
  .careers-cta-section { padding: 60px 0; }
}

@media (max-width: 575.98px) {
  .careers-hero { padding: 100px 0 60px; }
  .careers-hero-title { font-size: 2rem; }
  .careers-hero-subtitle { font-size: 1.125rem; }
  .benefit-card, .job-card { padding: 1.5rem; }
  .careers-filter-bar { padding: 1.5rem; }
}

@media (min-width: 992px) {
  .careers-hero { padding: 180px 0 150px; }
  .careers-hero-content { margin: 0; }
  .careers-hero-subtitle { margin-left: 0; margin-right: 0; }
}
