/* =========================
   20) Athlete Detail Page
   Premium Redesign: Glassmorphism, Advanced Gradients, Micro-animations
========================= */

:root {
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.4);
  --premium-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
}

.athlete-detail-page {
  padding: 4rem 0 6rem;
  background: radial-gradient(circle at top left, #f8fafc, #f1f5f9);
  min-height: calc(100vh - var(--nav-h));
  position: relative;
  overflow: hidden;
}

.athlete-detail-page::before {
  content: '';
  position: absolute;
  top: -10%;
  right: -5%;
  width: 40%;
  height: 40%;
  background: radial-gradient(circle, rgba(11, 58, 120, 0.03) 0%, transparent 70%);
  z-index: 0;
}

.athlete-detail-page .container-rtl {
  position: relative;
  z-index: 1;
}

.athlete-detail-card {
  max-width: 1000px;
  margin: 0 auto;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 32px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--premium-shadow);
  display: flex;
  flex-direction: column;
  animation: slideUpFade 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpFade {
  from {
    transform: translateY(30px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.athlete-detail-hero {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 3rem;
  padding: 3rem;
  align-items: center;
}

.athlete-detail-photo-wrap {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  background: #fff;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.athlete-detail-photo-wrap:hover {
  transform: scale(1.02);
}

.athlete-detail-photo {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  display: block;
}

.athlete-detail-main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.athlete-detail-title-group h1 {
  font-family: "Cairo", sans-serif;
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--primary-blue);
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.athlete-detail-badge {
  display: inline-flex;
  padding: 0.4rem 1rem;
  background: linear-gradient(135deg, var(--primary-blue), #0b3a78);
  color: #fff;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: 'Tajawal', sans-serif;
  margin-bottom: 0.5rem;
}

.athlete-detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.athlete-detail-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.athlete-detail-meta-label {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.athlete-detail-meta-value {
  font-size: 1.1rem;
  color: #1e293b;
  font-weight: 800;
  font-family: 'Tajawal', sans-serif;
}

.athlete-detail-bio {
  font-family: "Tajawal", sans-serif;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #334155;
  background: rgba(255, 255, 255, 0.4);
  padding: 1.5rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.athlete-detail-achievements {
  padding: 3rem;
  background: rgba(255, 255, 255, 0.3);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.athlete-detail-section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  font-family: "Cairo", sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-blue);
}

.athlete-detail-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.05), transparent);
}

.athlete-detail-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.athlete-detail-timeline-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 2rem;
  align-items: center;
}

.athlete-detail-timeline-year {
  font-family: 'Tajawal', sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--accent-orange);
  text-align: right;
  /* Aligned to right in RTL */
  white-space: nowrap;
}

.athlete-detail-timeline-content {
  background: #fff;
  padding: 1.25rem 1.75rem;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.02);
  font-family: 'Tajawal', sans-serif;
  font-size: 1.1rem;
  color: #1e293b;
  font-weight: 600;
  position: relative;
  text-align: right;
}

.athlete-detail-timeline-content::before {
  content: '';
  position: absolute;
  right: -8px;
  /* Stick to the right edge of the box */
  top: 50%;
  transform: translateY(-50%);
  border: 8px solid transparent;
  border-left-color: #fff;
  /* Point towards the year (right) */
}

.athlete-detail-back {
  margin-top: 3rem;
  text-align: center;
}

.athlete-detail-back a {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  border-radius: 100px;
  background: var(--primary-blue);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-family: 'Tajawal', sans-serif;
  transition: all 0.3s ease;
  box-shadow: 0 10px 20px rgba(11, 58, 120, 0.15);
}

.athlete-detail-back a:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(11, 58, 120, 0.25);
  background: #0b3a78;
}

.athlete-detail-back svg {
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}

.athlete-detail-back a:hover svg {
  transform: rotate(180deg) translateX(4px);
}

@media (max-width: 992px) {
  .athlete-detail-hero {
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    padding: 2.5rem;
  }
}

@media (max-width: 768px) {
  .athlete-detail-hero {
    grid-template-columns: 1fr;
    padding: 2rem;
    text-align: center;
  }

  .athlete-detail-photo-wrap {
    max-width: 300px;
    margin: 0 auto;
  }

  .athlete-detail-main {
    align-items: center;
  }

  .athlete-detail-title-group h1 {
    font-size: 2rem;
  }

  .athlete-detail-meta-grid {
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
  }

  .athlete-detail-achievements {
    padding: 2rem;
  }

  .athlete-detail-timeline-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .athlete-detail-timeline-year {
    text-align: center;
  }

  .athlete-detail-timeline-content::before {
    display: none;
  }
}