/* ============================================================
   ancientfit-frontend/css/profile.css
   Profile Page Styles — Athlete Dashboard
   Theme: Dark glass-morphism with domain-specific accent colors
   ============================================================ */

/* ============================================================
   IMPORT FONTS
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Anton&family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================================================
   GLOBAL BOX-SIZING RESET — Prevents Horizontal Scroll
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  box-sizing: border-box;
  overflow-x: hidden;
  max-width: 100%;
}

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  /* Domain Colors */
  --profile-domain-workout: #FF8C00;
  --profile-domain-workout-glow: rgba(255, 140, 0, 0.25);
  --profile-domain-mountain: #DC143C;
  --profile-domain-mountain-glow: rgba(220, 20, 60, 0.25);
  --profile-domain-tachydronic: #FFD700;
  --profile-domain-tachydronic-glow: rgba(255, 215, 0, 0.25);

  /* Certificate Colors */
  --cert-l1: #CD7F32;
  --cert-l2: #C0C0C0;
  --cert-apex: #FFD700;
  --cert-aff: #00B894;

  /* Status Colors */
  --status-active: #00B894;
  --status-expiring: #FFB347;
  --status-expired: #FF4757;

  /* Spacing */
  --section-gap: 36px;
  --card-gap: 18px;
  --padding-section: 28px 32px 32px;
}

/* ============================================================
   PAGE BACKGROUND
   ============================================================ */
html {
  overflow-x: hidden;
  max-width: 100%;
  overflow-y: auto;
}

body {
  background: url(../Images/Scheduler/CardThreeCover.jpg) no-repeat center center fixed;
  background-size: cover;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  max-width: 100%;
  width: 100%;
  user-select: none;
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: -1;
}

/* ============================================================
   HEADER / NAVBAR CONTAINER FIX
   ============================================================ */
header {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  padding: 0 12px;
}

.nav-container {
  max-width: 1400px;
  margin: 12px auto;
  width: 100%;
  box-sizing: border-box;
}

/* ============================================================
   PROFILE MAIN LAYOUT
   ============================================================ */
.profile-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 24px 60px;
  min-height: 80vh;
  background: radial-gradient(ellipse at 50% 0%, rgba(211, 157, 85, 0.06), transparent 70%);
  box-sizing: border-box;
  width: 100%;
  overflow-x: hidden;
}

/* ============================================================
   PROFILE CONTENT — SECTION SPACING
   ============================================================ */
.profile-content {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* ============================================================
   SECTION CARDS
   ============================================================ */
.profile-section {
  background: rgba(0, 0, 0, 0.75);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: var(--padding-section);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
}

.profile-section::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  z-index: -1;
  pointer-events: none;
}

.profile-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 20%, rgba(255, 215, 0, 0.03), transparent 70%);
  opacity: 0.3;
  z-index: -1;
  pointer-events: none;
  animation: profileGlow 15s ease-in-out infinite alternate;
}

@keyframes profileGlow {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(5%, 5%) scale(1.1); }
}

.profile-section:hover {
  border-color: rgba(255, 215, 0, 0.15);
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
  gap: 12px;
}

.section-header h2 {
  font-family: 'Anton', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.03em;
  color: #fff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-header h2 i {
  color: var(--profile-domain-tachydronic);
  font-size: 1.2rem;
}

.section-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(255, 215, 0, 0.12);
  color: var(--profile-domain-tachydronic);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.section-badge.coming-soon {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.35);
}

/* ============================================================
   LOADING & ERROR STATES
   ============================================================ */
.profile-loading,
.profile-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
}

.profile-loading .loading-spinner {
  font-size: 3rem;
  color: var(--profile-domain-tachydronic);
  margin-bottom: 16px;
}

.profile-loading p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.95rem;
}

.profile-error i {
  font-size: 3rem;
  color: #FF4757;
  margin-bottom: 16px;
}

.profile-error h3 {
  color: #FF4757;
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.profile-error p {
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 20px;
}

.retry-btn {
  padding: 12px 32px;
  border-radius: 50px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  background: rgba(255, 215, 0, 0.1);
  color: #FFD700;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.retry-btn:hover {
  background: rgba(255, 215, 0, 0.2);
  transform: translateY(-2px);
}

/* ============================================================
   SECTION 1: PERSONAL INFO
   ============================================================ */
.personal-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.info-item {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.info-item .info-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.info-item .info-value {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  word-break: break-word;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.info-item .info-value .flag {
  margin-right: 6px;
}

.info-item .info-value .template-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(255, 215, 0, 0.12);
  color: var(--profile-domain-tachydronic);
}

/* ── Contact Support ── */
.contact-support-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.contact-support-section h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.contact-support-section h3 i {
  color: var(--profile-domain-tachydronic);
}

.contact-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.contact-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  flex-wrap: wrap;
  gap: 8px;
}

.contact-item .contact-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
}

.contact-item .contact-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  word-break: break-all;
}

.contact-item .contact-edit-btn {
  background: none;
  border: 1px solid rgba(255, 215, 0, 0.2);
  color: var(--profile-domain-tachydronic);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.contact-item .contact-edit-btn:hover {
  background: rgba(255, 215, 0, 0.1);
  border-color: rgba(255, 215, 0, 0.4);
}

.contact-support-note {
  margin-top: 14px;
  padding: 12px 16px;
  background: rgba(255, 215, 0, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 215, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  flex-wrap: wrap;
}

.contact-support-note i {
  color: var(--profile-domain-tachydronic);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.support-link {
  background: none;
  border: none;
  color: var(--profile-domain-tachydronic);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.8rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.support-link:hover {
  color: #fff;
}

/* ============================================================
   SECTION 2: CERTIFICATES — VERTICAL LAYOUT
   ============================================================ */
.certificates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.certificate-card {
  background: rgba(0, 0, 0, 0.55);
  border-radius: 18px;
  padding: 24px 20px 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.certificate-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  backdrop-filter: blur(8px) saturate(160%);
  -webkit-backdrop-filter: blur(8px) saturate(160%);
  z-index: -1;
  pointer-events: none;
}

.certificate-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
}

.certificate-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.certificate-card.level-L1::before { background: var(--cert-l1); }
.certificate-card.level-L2::before { background: var(--cert-l2); }
.certificate-card.level-APEX::before { background: var(--cert-apex); }
.certificate-card.level-AFF::before { background: var(--cert-aff); }

.cert-badge-wrapper {
  flex-shrink: 0;
  margin-bottom: 14px;
}

.cert-badge-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.3);
  padding: 6px;
  border: 1px solid rgba(255, 215, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: block;
}

.certificate-card:hover .cert-badge-img {
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.2);
}

.cert-title-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.cert-level-name {
  font-family: 'Anton', sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  color: #fff;
}

.level-badge {
  font-size: 0.6rem;
  padding: 2px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
}

.cert-id {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 12px;
  letter-spacing: 0.02em;
  font-weight: 400;
  word-break: break-all;
}

.cert-dates {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 16px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 8px;
}

.cert-dates span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.cert-dates i {
  font-size: 0.7rem;
}

.cert-location {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.cert-location i {
  font-size: 0.65rem;
  color: var(--profile-domain-tachydronic);
}

.cert-status-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  width: 100%;
  flex-wrap: wrap;
}

.cert-status-wrapper .status-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge.active {
  background: rgba(0, 184, 148, 0.15);
  color: var(--status-active);
}

.status-badge.expiring {
  background: rgba(255, 179, 71, 0.15);
  color: var(--status-expiring);
}

.status-badge.expired {
  background: rgba(255, 71, 87, 0.15);
  color: var(--status-expired);
}

.cert-status-wrapper .renew-btn {
  padding: 4px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 215, 0, 0.25);
  background: rgba(255, 215, 0, 0.08);
  color: var(--profile-domain-tachydronic);
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cert-status-wrapper .renew-btn:hover {
  background: rgba(255, 215, 0, 0.18);
  border-color: rgba(255, 215, 0, 0.4);
}

.cert-status-wrapper .renew-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.no-certificates {
  text-align: center;
  padding: 40px 20px;
}

.no-certificates i {
  font-size: 2.5rem;
  color: rgba(255, 255, 255, 0.1);
  margin-bottom: 12px;
}

.no-certificates p {
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 16px;
}

.no-certificates .btn-primary {
  display: inline-block;
  padding: 10px 28px;
  border-radius: 50px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.05));
  border: 1px solid rgba(255, 215, 0, 0.3);
  color: var(--profile-domain-tachydronic);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
}

.no-certificates .btn-primary:hover {
  background: rgba(255, 215, 0, 0.25);
  transform: translateY(-2px);
}

/* ============================================================
   SECTION 3: DOMAINS
   ============================================================ */
.domains-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--card-gap);
}

.domain-card {
  background: rgba(0, 0, 0, 0.55);
  border-radius: 18px;
  padding: 20px 18px 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.domain-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  backdrop-filter: blur(8px) saturate(160%);
  -webkit-backdrop-filter: blur(8px) saturate(160%);
  z-index: -1;
  pointer-events: none;
}

.domain-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.domain-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.12);
}

.domain-workout::before { background: var(--profile-domain-workout); }
.domain-workout .domain-icon { color: var(--profile-domain-workout); }
.domain-workout .domain-count { color: var(--profile-domain-workout); }

.domain-mountain::before { background: var(--profile-domain-mountain); }
.domain-mountain .domain-icon { color: var(--profile-domain-mountain); }
.domain-mountain .domain-count { color: var(--profile-domain-mountain); }

.domain-tachydronic::before { background: var(--profile-domain-tachydronic); }
.domain-tachydronic .domain-icon { color: var(--profile-domain-tachydronic); }
.domain-tachydronic .domain-count { color: var(--profile-domain-tachydronic); }

.domain-card .domain-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.domain-card h3 {
  font-family: 'Anton', sans-serif;
  font-size: 1.1rem;
  color: #fff;
  margin: 0 0 4px;
}

.domain-card .domain-count {
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.domain-card .domain-stats {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.domain-card .domain-stats span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.domain-card .domain-stats i {
  font-size: 0.65rem;
}

.domain-view-btn {
  padding: 6px 18px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.domain-view-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.domain-workout .domain-view-btn:hover {
  border-color: var(--profile-domain-workout);
  color: var(--profile-domain-workout);
}
.domain-mountain .domain-view-btn:hover {
  border-color: var(--profile-domain-mountain);
  color: var(--profile-domain-mountain);
}
.domain-tachydronic .domain-view-btn:hover {
  border-color: var(--profile-domain-tachydronic);
  color: var(--profile-domain-tachydronic);
}

/* ============================================================
   SECTION 4: TREND GRAPH — SCROLLABLE + ZOOMABLE
   ============================================================ */
.trend-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.trend-filter {
  padding: 6px 14px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 0.75rem;
  cursor: pointer;
  outline: none;
  font-family: 'Inter', sans-serif;
}

.trend-filter:focus {
  border-color: rgba(255, 215, 0, 0.3);
}

.trend-chart-container {
  position: relative;
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  padding: 16px;
  overflow: hidden;
  margin-top: 16px;
  box-sizing: border-box;
}

/* ── Chart Controls ── */
.chart-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.chart-control-btn {
  padding: 6px 16px;
  border-radius: 30px;
  border: 1px solid rgba(255, 215, 0, 0.2);
  background: rgba(255, 215, 0, 0.08);
  color: var(--profile-domain-tachydronic);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.chart-control-btn:hover {
  background: rgba(255, 215, 0, 0.18);
  border-color: rgba(255, 215, 0, 0.4);
}

.chart-control-btn i {
  margin-right: 4px;
}

.chart-hint {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.25);
  font-family: 'Inter', sans-serif;
}

.chart-hint i {
  margin-right: 4px;
}

/* ── Chart Wrapper ── */
.chart-wrapper {
  position: relative;
  width: 100%;
  height: 280px;
  min-height: 200px;
  cursor: grab;
}

.chart-wrapper:active {
  cursor: grabbing;
}

#trendChart {
  width: 100% !important;
  height: 100% !important;
}

#trendChart canvas {
  border-radius: 8px;
}

/* ── Trend Tooltip ── */
.trend-tooltip {
  position: absolute;
  background: rgba(8, 12, 20, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 12px;
  padding: 14px 18px;
  min-width: 160px;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: none;
}

.trend-tooltip .tooltip-date {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 4px;
  font-family: 'Inter', sans-serif;
}

.trend-tooltip .tooltip-duration {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--profile-domain-tachydronic);
  font-family: 'Anton', sans-serif;
}

.trend-tooltip .tooltip-details {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 4px;
  font-family: 'Inter', sans-serif;
}

/* ============================================================
   SECTION 5: SUMMARY STATS
   ============================================================ */
.summary-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.summary-stat {
  background: rgba(0, 0, 0, 0.55);
  border-radius: 16px;
  padding: 18px 16px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
}

.summary-stat::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  backdrop-filter: blur(8px) saturate(160%);
  -webkit-backdrop-filter: blur(8px) saturate(160%);
  z-index: -1;
  pointer-events: none;
}

.summary-stat .stat-number {
  font-family: 'Anton', sans-serif;
  font-size: 2rem;
  color: #fff;
  line-height: 1.2;
}

.summary-stat .stat-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.summary-stat .stat-icon {
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.stat-workout .stat-number { color: var(--profile-domain-workout); }
.stat-mountain .stat-number { color: var(--profile-domain-mountain); }
.stat-tachydronic .stat-number { color: var(--profile-domain-tachydronic); }
.stat-streak .stat-number { color: #FF6B6B; }

/* ============================================================
   SECTION 6: ACTIVITY HISTORY
   ============================================================ */
.history-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.history-filter {
  padding: 6px 14px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 0.7rem;
  cursor: pointer;
  outline: none;
}

.history-filter:focus {
  border-color: rgba(255, 215, 0, 0.3);
}

.history-refresh-btn {
  padding: 6px 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.history-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: rotate(45deg);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 4px;
}

.history-list::-webkit-scrollbar {
  width: 4px;
}
.history-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 2px;
}
.history-list::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.3);
  border-radius: 2px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.50);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  min-height: 60px;
}

.history-item::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  backdrop-filter: blur(6px) saturate(160%);
  -webkit-backdrop-filter: blur(6px) saturate(160%);
  z-index: -1;
  pointer-events: none;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(4px);
}

.history-item .h-icon {
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}

.history-item .h-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-item .h-type {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.history-item .h-date {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.3);
}

.history-item .h-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 2px;
}

.history-item .h-details span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.history-item .h-arrow {
  color: rgba(255, 255, 255, 0.15);
  font-size: 0.8rem;
  flex-shrink: 0;
  margin-left: 4px;
}

.history-empty,
.history-loading {
  text-align: center;
  padding: 40px 20px;
}

.history-empty i,
.history-loading i {
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.1);
  margin-bottom: 12px;
}

.history-empty p,
.history-loading span {
  color: rgba(255, 255, 255, 0.3);
}

.history-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.history-pagination button {
  padding: 6px 14px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.history-pagination button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.history-pagination button.active {
  background: rgba(255, 215, 0, 0.15);
  border-color: rgba(255, 215, 0, 0.3);
  color: var(--profile-domain-tachydronic);
}

/* ============================================================
   ACTIVITY DETAIL MODAL — FULLY RESPONSIVE
   ============================================================ */
.activity-detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalFadeIn 0.25s ease;
  overflow: hidden;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.activity-detail-content {
  background: rgba(0, 0, 0, 0.85);
  border-radius: 24px;
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  max-height: 85dvh;
  overflow-y: auto;
  border: 1px solid rgba(255, 215, 0, 0.15);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
  position: relative;
  box-sizing: border-box;
  padding: 0;
  margin: 0 12px;
}

.activity-detail-content::-webkit-scrollbar {
  width: 4px;
}
.activity-detail-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
}
.activity-detail-content::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.3);
}

.activity-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  background: rgba(8, 12, 20, 0.98);
  border-radius: 24px 24px 0 0;
}

.activity-detail-header h3 {
  font-family: 'Anton', sans-serif;
  font-size: 1.2rem;
  color: #fff;
  margin: 0;
}

.detail-close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.detail-close-btn:hover {
  color: #FF4757;
  transform: rotate(90deg);
}

.activity-detail-body {
  padding: 24px;
}

.detail-section {
  margin-bottom: 20px;
}
.detail-section:last-child {
  margin-bottom: 0;
}

.detail-section .detail-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.3);
  font-weight: 600;
  margin-bottom: 6px;
}

.detail-section .detail-value {
  font-size: 0.95rem;
  color: #fff;
  word-break: break-word;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.detail-grid .detail-item {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: center;
}

.detail-grid .detail-item .d-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.detail-grid .detail-item .d-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.3);
}

.exercise-log-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  margin-bottom: 6px;
  border-left: 3px solid rgba(255, 215, 0, 0.2);
  flex-wrap: wrap;
  gap: 6px;
}

.exercise-log-item .ex-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
}

.exercise-log-item .ex-metrics {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.exercise-log-item .ex-metrics span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   ACTIVITY DETAIL MAP CONTAINER
   ============================================================ */
#detailModalBody .detail-map-container {
  margin-top: 16px;
  border-radius: 12px;
  overflow: hidden;
  background: #0a1520;
  min-height: 200px;
}

#detailModalBody .detail-map-container .leaflet-container {
  width: 100% !important;
  height: 250px !important;
  border-radius: 12px;
}

#detailModalBody .gps-empty-state {
  text-align: center;
  padding: 30px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.8rem;
}

#detailModalBody .gps-empty-state i {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.15);
}

#detailModalBody .leaflet-control-attribution {
  background: rgba(0, 0, 0, 0.6) !important;
  color: rgba(255, 255, 255, 0.3) !important;
  font-size: 8px !important;
}

#detailModalBody .leaflet-control-attribution a {
  color: rgba(255, 215, 0, 0.5) !important;
}

#detailModalBody .map-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 250px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.85rem;
}

#detailModalBody .map-loading i {
  margin-right: 10px;
  font-size: 1.2rem;
  color: var(--profile-domain-tachydronic);
}

/* ============================================================
   RESPONSIVE — ALL BREAKPOINTS
   ============================================================ */

/* ── Tablet (≤900px) ── */
@media (max-width: 900px) {
  .profile-main {
    padding: 80px 16px 40px;
  }

  .profile-section {
    padding: 20px 18px 24px;
  }

  .personal-info-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .certificates-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .domains-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .summary-stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .section-header h2 {
    font-size: 1.25rem;
  }

  .chart-wrapper {
    height: 240px;
    min-height: 180px;
  }

  .chart-controls {
    flex-wrap: wrap;
    gap: 8px;
  }

  .chart-hint {
    font-size: 0.6rem;
  }

  .activity-detail-content {
    margin: 0 8px;
    max-height: 90vh;
    max-height: 90dvh;
  }

    /* ── HISTORY ITEMS (Tablet) ── */
  .history-item .h-details {
    flex-wrap: wrap;
    gap: 6px 12px;
    font-size: 0.65rem;
  }

  .history-item .h-details span {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
}

/* ── Mobile (≤600px) ── */
@media (max-width: 600px) {
  .profile-main {
    padding: 70px 12px 30px;
  }

  .profile-section {
    padding: 16px 14px 20px;
    border-radius: 18px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .section-header h2 {
    font-size: 1.1rem;
  }

  .section-badge {
    font-size: 0.6rem;
    padding: 3px 10px;
  }

  .personal-info-grid {
    grid-template-columns: 1fr 1fr;
  }

  .certificates-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .certificate-card {
    padding: 20px 16px 18px;
  }

  .cert-badge-img {
    width: 60px;
    height: 60px;
    padding: 5px;
  }

  .cert-level-name {
    font-size: 1rem;
  }

  .cert-dates {
    font-size: 0.7rem;
    gap: 8px 12px;
  }

  .domains-grid {
    grid-template-columns: 1fr 1fr;
  }

  .summary-stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .contact-info-grid {
    grid-template-columns: 1fr;
  }

/* ── HISTORY ITEMS (Mobile) ── */
.history-item {
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  align-items: flex-start;
}

.history-item .h-icon {
  width: 36px;
  height: 36px;
  font-size: 1rem;
  flex-shrink: 0;
}

.history-item .h-info {
  flex: 1 1 100%;
  order: 2;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-item .h-type {
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.history-item .h-date {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
  display: block;
}

.history-item .h-details {
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  width: 100%;
}

.history-item .h-details span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.65rem;
}

.history-item .h-arrow {
  order: 3;
  margin-left: auto;
  flex-shrink: 0;
}

  /* ── CHART ── */
  .chart-wrapper {
    height: 220px;
    min-height: 160px;
  }

  .chart-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .chart-control-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .chart-hint {
    text-align: center;
    font-size: 0.6rem;
  }

  .trend-chart-container {
    padding: 12px;
  }

  .trend-controls {
    width: 100%;
  }

  .trend-controls select {
    flex: 1;
    min-width: 0;
  }

  .history-controls {
    width: 100%;
  }

  .history-controls select {
    flex: 1;
    min-width: 0;
  }

  /* ── MODAL ── */
  .activity-detail-modal {
    padding: 10px;
  }

  .activity-detail-content {
    max-height: 90vh;
    max-height: 90dvh;
    margin: 0;
    border-radius: 16px;
    width: 98%;
  }

  .activity-detail-header {
    padding: 14px 16px;
    border-radius: 16px 16px 0 0;
  }

  .activity-detail-header h3 {
    font-size: 1rem;
  }

  .detail-close-btn {
    font-size: 1.2rem;
  }

  .activity-detail-body {
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .detail-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .detail-grid .detail-item {
    padding: 10px 8px;
  }

  .detail-grid .detail-item .d-value {
    font-size: 0.95rem;
  }

  .detail-grid .detail-item .d-label {
    font-size: 0.55rem;
  }

  .exercise-log-item {
    padding: 6px 10px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .exercise-log-item .ex-metrics {
    font-size: 0.65rem;
    gap: 8px;
    flex-wrap: wrap;
  }

  .exercise-log-item .ex-metrics span {
    white-space: nowrap;
  }

  #detailModalBody .detail-map-container .leaflet-container {
    height: 180px !important;
  }

  #detailModalBody .map-loading {
    height: 180px;
  }

  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  #detailModalBody .detail-map-container .leaflet-container {
    height: 200px !important;
  }

  #detailModalBody .map-loading {
    height: 200px;
  }
}

/* ── Small Mobile (≤380px) ── */
@media (max-width: 380px) {
  .profile-main {
    padding: 60px 10px 20px;
  }

  .profile-section {
    padding: 14px 12px 16px;
    border-radius: 14px;
  }

  .section-header h2 {
    font-size: 1rem;
  }

  .personal-info-grid {
    grid-template-columns: 1fr;
  }

  .domains-grid {
    grid-template-columns: 1fr;
  }

  .summary-stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .certificate-card {
    padding: 16px 14px 16px;
  }

  .cert-badge-img {
    width: 50px;
    height: 50px;
    padding: 4px;
  }

  .cert-level-name {
    font-size: 0.9rem;
  }

  .cert-id {
    font-size: 0.75rem;
  }

  .cert-dates {
    font-size: 0.65rem;
    flex-direction: column;
    gap: 4px;
  }

  .cert-status-wrapper {
    flex-direction: column;
    gap: 8px;
  }

/* ── HISTORY ITEMS (Small Mobile) ── */
.history-item {
  padding: 8px 12px;
  gap: 6px;
  align-items: flex-start;
}

.history-item .h-icon {
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.history-item .h-info {
  flex: 1 1 100%;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.history-item .h-type {
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.history-item .h-date {
  font-size: 0.6rem;
}

.history-item .h-details {
  font-size: 0.6rem;
  gap: 3px 8px;
  flex-wrap: wrap;
  width: 100%;
}

.history-item .h-details span {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 6px;
  border-radius: 16px;
  font-size: 0.55rem;
}

.history-item .h-arrow {
  font-size: 0.65rem;
  flex-shrink: 0;
}

  /* ── CHART ── */
  .chart-wrapper {
    height: 180px;
    min-height: 140px;
  }

  .trend-chart-container {
    padding: 10px;
  }

  .chart-control-btn {
    font-size: 0.6rem;
    padding: 5px 12px;
  }

  .chart-hint {
    font-size: 0.55rem;
  }

  .trend-controls select {
    font-size: 0.65rem;
    padding: 4px 10px;
  }

  .history-controls select {
    font-size: 0.65rem;
    padding: 4px 10px;
  }

  /* ── MODAL ── */
  .activity-detail-content {
    border-radius: 12px;
    max-height: 92vh;
    max-height: 92dvh;
  }

  .activity-detail-body {
    padding: 12px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .detail-grid .detail-item {
    padding: 8px 6px;
  }

  .detail-grid .detail-item .d-value {
    font-size: 0.85rem;
  }

  .exercise-log-item {
    padding: 4px 8px;
  }

  .exercise-log-item .ex-name {
    font-size: 0.75rem;
  }

  .exercise-log-item .ex-metrics {
    font-size: 0.6rem;
    gap: 4px;
    flex-wrap: wrap;
  }

  .detail-section .detail-value {
    font-size: 0.85rem;
    word-break: break-word;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  #detailModalBody .detail-map-container .leaflet-container {
    height: 160px !important;
  }

  #detailModalBody .map-loading {
    height: 160px;
  }
}

/* ── Extra Small (≤320px) ── */
@media (max-width: 320px) {
  .profile-main {
    padding: 50px 8px 16px;
  }

  .profile-section {
    padding: 12px 10px 14px;
    border-radius: 12px;
  }

  .section-header h2 {
    font-size: 0.9rem;
  }

  .section-header h2 i {
    font-size: 0.9rem;
  }

  .section-badge {
    font-size: 0.55rem;
    padding: 2px 8px;
  }

  .personal-info-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .info-item {
    padding: 10px 12px;
  }

  .info-item .info-value {
    font-size: 0.85rem;
  }

  .certificates-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .certificate-card {
    padding: 14px 12px 14px;
  }

  .cert-badge-img {
    width: 44px;
    height: 44px;
    padding: 3px;
  }

  .cert-level-name {
    font-size: 0.85rem;
  }

  .cert-id {
    font-size: 0.7rem;
  }

  .cert-dates {
    font-size: 0.6rem;
    flex-direction: column;
    gap: 2px;
  }

  .cert-location {
    font-size: 0.6rem;
  }

  .cert-status-wrapper {
    flex-direction: column;
    gap: 6px;
  }

  .cert-status-wrapper .status-badge {
    font-size: 0.55rem;
    padding: 3px 10px;
  }

  .cert-status-wrapper .renew-btn {
    font-size: 0.55rem;
    padding: 3px 12px;
  }

  .domains-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .domain-card {
    padding: 14px 12px 14px;
  }

  .domain-card h3 {
    font-size: 0.95rem;
  }

  .summary-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .summary-stat {
    padding: 12px 10px;
  }

  .summary-stat .stat-number {
    font-size: 1.5rem;
  }

  .summary-stat .stat-label {
    font-size: 0.6rem;
  }

/* ── HISTORY ITEMS (Extra Small) ── */
.history-item {
  padding: 6px 8px;
  gap: 4px;
  align-items: flex-start;
}

.history-item .h-icon {
  width: 24px;
  height: 24px;
  font-size: 0.65rem;
  flex-shrink: 0;
}

.history-item .h-info {
  flex: 1 1 100%;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.history-item .h-type {
  font-size: 0.6rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.history-item .h-date {
  font-size: 0.5rem;
}

.history-item .h-details {
  font-size: 0.5rem;
  gap: 2px 6px;
  flex-wrap: wrap;
  width: 100%;
}

.history-item .h-details span {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.04);
  padding: 1px 4px;
  border-radius: 12px;
  font-size: 0.45rem;
}

.history-item .h-arrow {
  font-size: 0.55rem;
  flex-shrink: 0;
}

  /* ── CHART ── */
  .chart-wrapper {
    height: 160px;
    min-height: 120px;
  }

  .trend-chart-container {
    padding: 8px;
  }

  .chart-controls {
    gap: 4px;
  }

  .chart-control-btn {
    font-size: 0.55rem;
    padding: 4px 10px;
  }

  .chart-hint {
    font-size: 0.5rem;
  }

  .trend-controls {
    gap: 6px;
  }

  .trend-controls select {
    font-size: 0.6rem;
    padding: 3px 8px;
  }

  .history-controls {
    gap: 6px;
  }

  .history-controls select {
    font-size: 0.6rem;
    padding: 3px 8px;
  }

  .history-refresh-btn {
    font-size: 0.65rem;
    padding: 4px 8px;
  }

  .contact-info-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .contact-item {
    padding: 8px 12px;
  }

  .contact-item .contact-value {
    font-size: 0.8rem;
  }

  .contact-item .contact-edit-btn {
    font-size: 0.55rem;
    padding: 3px 8px;
  }

  .contact-support-note {
    font-size: 0.7rem;
    padding: 8px 12px;
  }

  .no-certificates {
    padding: 24px 16px;
  }

  .no-certificates i {
    font-size: 2rem;
  }

  .no-certificates p {
    font-size: 0.85rem;
  }

  .no-certificates .btn-primary {
    font-size: 0.75rem;
    padding: 8px 20px;
  }



  /* ── MODAL ── */
  .activity-detail-content {
    max-width: 100%;
    margin: 4px;
    border-radius: 10px;
  }

  .activity-detail-header h3 {
    font-size: 0.85rem;
  }

  .activity-detail-body {
    padding: 10px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-grid .detail-item {
    padding: 6px 8px;
  }

  .detail-grid .detail-item .d-value {
    font-size: 0.8rem;
  }

  .exercise-log-item {
    padding: 4px 6px;
  }

  .exercise-log-item .ex-name {
    font-size: 0.7rem;
  }

  .exercise-log-item .ex-metrics {
    font-size: 0.55rem;
    gap: 4px;
  }

  #detailModalBody .detail-map-container .leaflet-container {
    height: 140px !important;
  }

  #detailModalBody .map-loading {
    height: 140px;
  }

  .history-pagination button {
    font-size: 0.65rem;
    padding: 4px 10px;
  }
}
/* ============================================================
   SECURITY ENHANCEMENTS — Verified Badge, Copy Button, Toast
   ============================================================ */

/* ── Verified Email Badge ── */
.email-with-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.email-masked {
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.02em;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 184, 148, 0.15);
    border: 1px solid rgba(0, 184, 148, 0.3);
    border-radius: 30px;
    padding: 3px 12px 3px 8px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #00b894;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}

.verified-badge i {
    font-size: 0.7rem;
    color: #00b894;
}

/* ── AncientFit ID with Copy Button ── */
.id-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.id-text {
    font-family: 'Inter', monospace;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.02em;
}

.id-with-copy {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.copy-id-btn {
    background: none;
    border: none;
    color: rgba(255, 215, 0, 0.5);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: all 0.25s ease;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.copy-id-btn:hover {
    color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
    transform: scale(1.1);
}

.copy-id-btn:active {
    transform: scale(0.9);
}

/* ── Tooltip on Hover (pure CSS) ── */
.copy-id-btn::after {
    content: 'Click to copy ID';
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.6rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    border: 1px solid rgba(255, 215, 0, 0.15);
}

.copy-id-btn::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.copy-id-btn:hover::after,
.copy-id-btn:focus::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.copy-id-btn:hover::before,
.copy-id-btn:focus::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Copy Toast Notification ── */
.copy-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(8, 12, 20, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 99999;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    animation: toastSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 220px;
}

.copy-toast i {
    font-size: 1.2rem;
    color: #00b894;
}

.copy-toast i.fa-exclamation-circle {
    color: #ff6b6b;
}

.copy-toast span {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: #fff;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* ── Toast Dismiss Animation ── */
.copy-toast.dismiss {
    animation: toastDismiss 0.3s ease forwards;
}

@keyframes toastDismiss {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(40px) scale(0.95);
    }
}

/* ── Responsive Toast ── */
@media (max-width: 600px) {
    .copy-toast {
        bottom: 20px;
        right: 16px;
        left: 16px;
        min-width: auto;
        padding: 12px 18px;
        justify-content: center;
    }

    .copy-toast span {
        font-size: 0.8rem;
    }

    .verified-badge {
        font-size: 0.6rem;
        padding: 2px 10px 2px 6px;
    }
}

@media (max-width: 380px) {
    .copy-toast {
        bottom: 16px;
        right: 12px;
        left: 12px;
        padding: 10px 14px;
    }

    .copy-toast span {
        font-size: 0.75rem;
    }

    .copy-id-btn {
        font-size: 0.75rem;
        padding: 3px 4px;
    }
}

/* ============================================================
   RIVALBOARD CHRONICLE — COMPLETE STYLES
   ============================================================ */

/* ── Chronicle Container ── */
#chronicleContainer {
    margin-top: 12px;
    width: 100%;
    box-sizing: border-box;
}

/* ── Chronicle Header ── */
.chronicle-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.08);
}

.chronicle-title {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.chronicle-title h2 {
    font-family: 'Anton', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 0.03em;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chronicle-title h2 i {
    color: #FFD700;
    font-size: 1.3rem;
}

.chronicle-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 20px;
    background: rgba(255, 215, 0, 0.12);
    color: #FFD700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.chronicle-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

/* ── Chronicle Stats Grid ── */
.chronicle-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.chronicle-stat {
    background: rgba(0, 0, 0, 0.55);
    border-radius: 16px;
    padding: 16px 14px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px) saturate(160%);
    -webkit-backdrop-filter: blur(8px) saturate(160%);
}

.chronicle-stat::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    backdrop-filter: blur(8px) saturate(160%);
    -webkit-backdrop-filter: blur(8px) saturate(160%);
    z-index: -1;
    pointer-events: none;
}

.chronicle-stat:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 215, 0, 0.15);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.chronicle-stat-icon {
    font-size: 1.1rem;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.4);
}

.chronicle-stat-number {
    font-family: 'Anton', sans-serif;
    font-size: 1.6rem;
    color: #fff;
    line-height: 1.2;
}

.chronicle-stat-label {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.chronicle-stat.stat-best .chronicle-stat-number {
    color: #FFD700;
}

.chronicle-stat.stat-qualified .chronicle-stat-number {
    color: #00B894;
}

.chronicle-stat.stat-comparison .chronicle-stat-number {
    font-size: 0.7rem;
    line-height: 1.3;
    color: #FFD700;
}

/* ── The Arena Widget ── */
.arena-widget {
    background: rgba(0, 0, 0, 0.65);
    border-radius: 20px;
    padding: 24px 28px 28px;
    margin-bottom: 28px;
    border: 1px solid rgba(255, 215, 0, 0.10);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px) saturate(160%);
    -webkit-backdrop-filter: blur(8px) saturate(160%);
}

.arena-widget::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(255, 215, 0, 0.04), transparent 70%);
    opacity: 0.3;
    z-index: -1;
    pointer-events: none;
}

.arena-widget::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    backdrop-filter: blur(8px) saturate(160%);
    -webkit-backdrop-filter: blur(8px) saturate(160%);
    z-index: -1;
    pointer-events: none;
}

.arena-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 8px;
}

.arena-header h3 {
    font-family: 'Anton', sans-serif;
    font-size: 1.2rem;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.arena-header h3 i {
    color: #FFD700;
}

.arena-tagline {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
}

/* ── Arena Grid (3 cards) ── */
.arena-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.arena-card {
    background: rgba(0, 0, 0, 0.50);
    border-radius: 16px;
    padding: 18px 16px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.arena-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 215, 0, 0.15);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.arena-card-icon {
    font-size: 1.3rem;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.3);
}

.arena-card-value {
    font-family: 'Anton', sans-serif;
    font-size: 1.5rem;
    color: #FFD700;
    line-height: 1.2;
}

.arena-card-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.arena-card-sub {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.2);
    margin-top: 2px;
}

.arena-kin .arena-card-value { color: #FFD700; }
.arena-global .arena-card-value { color: #FFD700; }
.arena-egypt .arena-card-value { color: #FFD700; }

/* ── Arena Milestone ── */
.arena-milestone {
    background: rgba(255, 215, 0, 0.04);
    border-radius: 16px;
    padding: 16px 20px;
    border: 1px solid rgba(255, 215, 0, 0.08);
    margin-bottom: 16px;
}

.arena-milestone-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.arena-milestone-icon {
    font-size: 1.1rem;
    color: #FFD700;
}

.arena-milestone-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.arena-qualified-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 20px;
    background: rgba(0, 184, 148, 0.15);
    color: #00B894;
    border: 1px solid rgba(0, 184, 148, 0.2);
    margin-left: auto;
}

.arena-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.arena-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.arena-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: arenaShimmer 2s infinite;
}

@keyframes arenaShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.arena-progress-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 6px;
    text-align: right;
    font-weight: 500;
}

/* ── Arena Kin Messenger ── */
.arena-messenger {
    background: rgba(255, 215, 0, 0.06);
    border-radius: 14px;
    padding: 16px 20px;
    border: 1px solid rgba(255, 215, 0, 0.12);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.arena-messenger-crown {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #FFD700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.arena-messenger-crown i {
    font-size: 1.1rem;
}

.arena-messenger-message {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    padding: 4px 12px;
    background: rgba(255, 215, 0, 0.04);
    border-radius: 8px;
    border-left: 2px solid #FFD700;
    flex: 1;
    min-width: 120px;
}

/* ── Chronicle Filters ── */
.chronicle-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.chronicle-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 120px;
}

.chronicle-filter-group label {
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chronicle-filter {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.8rem;
    cursor: pointer;
    outline: none;
    transition: all 0.25s ease;
    font-family: 'Inter', sans-serif;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23FFD700'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
}

.chronicle-filter:focus {
    border-color: rgba(255, 215, 0, 0.3);
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.06);
}

.chronicle-filter option {
    background: #0c1420;
    color: #fff;
}

/* ── Chronicle Timeline ── */
.chronicle-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 4px;
}

.chronicle-timeline::-webkit-scrollbar {
    width: 4px;
}
.chronicle-timeline::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 2px;
}
.chronicle-timeline::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 2px;
}

/* ── Chronicle Entry ── */
.chronicle-entry {
    background: rgba(0, 0, 0, 0.50);
    border-radius: 14px;
    padding: 16px 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: chronicleEntryIn 0.4s ease forwards;
    opacity: 0;
    transform: translateY(8px);
}

@keyframes chronicleEntryIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chronicle-entry:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 215, 0, 0.10);
    transform: translateX(4px);
}

.chronicle-entry-best {
    border-color: rgba(255, 215, 0, 0.20);
    background: rgba(255, 215, 0, 0.04);
}

.chronicle-entry-best .chronicle-score {
    color: #FFD700;
    font-weight: 700;
}

/* ── Entry Glow (Best Score) ── */
.chronicle-entry-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 70% 50%, rgba(255, 215, 0, 0.04), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.chronicle-entry > * {
    position: relative;
    z-index: 1;
}

/* ── Entry Header ── */
.chronicle-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.chronicle-entry-name {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.chronicle-entry-icon {
    font-size: 1rem;
}

.chronicle-entry-title {
    font-weight: 600;
    color: #fff;
    font-size: 0.95rem;
}

.chronicle-record-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 12px;
    background: rgba(255, 215, 0, 0.15);
    color: #FFD700;
    border: 1px solid rgba(255, 215, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chronicle-entry-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Chronicle Type Badges ── */
.chronicle-type-badge {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
}

.chronicle-type-badge i {
    font-size: 0.6rem;
}

.chronicle-type-badge.memorial {
    background: rgba(205, 127, 50, 0.15);
    color: #CD7F32;
    border-color: rgba(205, 127, 50, 0.25);
}

.chronicle-type-badge.championship {
    background: rgba(255, 215, 0, 0.12);
    color: #FFD700;
    border-color: rgba(255, 215, 0, 0.25);
}

/* ── Chronicle Status Badges ── */
.chronicle-status-badge {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
}

.chronicle-status-badge i {
    font-size: 0.6rem;
}

.chronicle-status-badge.qualified {
    background: rgba(0, 184, 148, 0.12);
    color: #00B894;
    border-color: rgba(0, 184, 148, 0.25);
}

.chronicle-status-badge.not-qualified {
    background: rgba(255, 71, 87, 0.10);
    color: #FF4757;
    border-color: rgba(255, 71, 87, 0.2);
}

.chronicle-status-badge.registered {
    background: rgba(255, 215, 0, 0.12);
    color: #FFD700;
    border-color: rgba(255, 215, 0, 0.25);
}

.chronicle-status-badge.pending {
    background: rgba(255, 179, 71, 0.10);
    color: #FFB347;
    border-color: rgba(255, 179, 71, 0.2);
}

/* ── Entry Body ── */
.chronicle-entry-body {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.chronicle-entry-body > div {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chronicle-entry-body i {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.2);
}

.chronicle-score {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.chronicle-score-best {
    font-weight: 700;
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.chronicle-entry-rank {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
}

.chronicle-dedication {
    font-style: italic;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
}

/* ── Entry Footer ── */
.chronicle-entry-footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    justify-content: flex-end;
}

.chronicle-entry-id {
    font-size: 0.55rem;
    font-family: monospace;
    color: rgba(255, 255, 255, 0.15);
    letter-spacing: 0.02em;
}

/* ── Chronicle Empty State ── */
.chronicle-empty {
    text-align: center;
    padding: 40px 20px;
    background: rgba(0, 0, 0, 0.30);
    border-radius: 16px;
    border: 1px dashed rgba(255, 255, 255, 0.06);
}

.chronicle-empty i {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.08);
    margin-bottom: 12px;
}

.chronicle-empty p {
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 16px;
}

.chronicle-reset-btn {
    padding: 8px 24px;
    border-radius: 30px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    background: rgba(255, 215, 0, 0.08);
    color: #FFD700;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Inter', sans-serif;
}

.chronicle-reset-btn:hover {
    background: rgba(255, 215, 0, 0.18);
    border-color: rgba(255, 215, 0, 0.4);
    transform: translateY(-2px);
}

/* ── Chronicle Chart ── */
.chronicle-chart-container {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 16px;
    padding: 18px 20px 20px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    margin-top: 8px;
}

.chronicle-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.chronicle-chart-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chronicle-chart-header h3 i {
    color: #FFD700;
    font-size: 0.9rem;
}

.chronicle-chart-note {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.2);
    font-style: italic;
}

.chronicle-chart-wrapper {
    position: relative;
    width: 100%;
    height: 250px;
    min-height: 180px;
}

#chronicleTrendChart {
    width: 100% !important;
    height: 100% !important;
}

#chronicleTrendChart canvas {
    border-radius: 8px;
}

/* ── Chronicle Loading & Error ── */
.chronicle-loading,
.chronicle-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    gap: 12px;
}

.chronicle-loading i {
    font-size: 2rem;
    color: #FFD700;
}

.chronicle-loading span {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

.chronicle-error i {
    font-size: 2rem;
    color: #FF4757;
}

.chronicle-error span {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

.chronicle-retry-btn {
    padding: 8px 24px;
    border-radius: 30px;
    border: 1px solid rgba(255, 71, 87, 0.3);
    background: rgba(255, 71, 87, 0.08);
    color: #FF4757;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Inter', sans-serif;
    margin-top: 4px;
}

.chronicle-retry-btn:hover {
    background: rgba(255, 71, 87, 0.18);
    border-color: rgba(255, 71, 87, 0.5);
    transform: translateY(-2px);
}

/* ============================================================
   CHRONICLE — RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
    .chronicle-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }

    .chronicle-stat-number {
        font-size: 1.3rem;
    }

    .arena-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .chronicle-entry-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .chronicle-entry-badges {
        align-self: flex-start;
    }
}

@media (max-width: 600px) {
    .chronicle-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chronicle-stat {
        padding: 12px 10px;
    }

    .chronicle-stat-number {
        font-size: 1.1rem;
    }

    .chronicle-stat-label {
        font-size: 0.55rem;
    }

    .arena-grid {
        grid-template-columns: 1fr 1fr;
    }

    .arena-card {
        padding: 14px 12px;
    }

    .arena-card-value {
        font-size: 1.2rem;
    }

    .chronicle-filters {
        flex-direction: column;
        gap: 12px;
        padding: 14px 16px;
    }

    .chronicle-filter-group {
        min-width: auto;
    }

    .chronicle-entry {
        padding: 14px 16px;
    }

    .chronicle-entry-title {
        font-size: 0.85rem;
    }

    .chronicle-entry-body {
        font-size: 0.7rem;
        gap: 8px 14px;
    }

    .chronicle-chart-container {
        padding: 14px 14px 16px;
    }

    .chronicle-chart-wrapper {
        height: 200px;
        min-height: 140px;
    }

    .arena-messenger {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .arena-messenger-message {
        border-left: none;
        border-top: 2px solid #FFD700;
        padding-top: 10px;
        text-align: center;
    }

    .arena-milestone-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .arena-qualified-badge {
        margin-left: 0;
    }

    .chronicle-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 380px) {
    .chronicle-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .chronicle-stat {
        padding: 10px 8px;
    }

    .chronicle-stat-number {
        font-size: 1rem;
    }

    .arena-grid {
        grid-template-columns: 1fr;
    }

    .chronicle-entry-body {
        flex-direction: column;
        gap: 4px;
    }

    .chronicle-chart-wrapper {
        height: 160px;
        min-height: 120px;
    }
}

/* ── Arena Qualification Status ── */
.arena-qualification-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-radius: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    border: 1px solid transparent;
}

.arena-qualification-status.qualified {
    background: rgba(0, 184, 148, 0.10);
    border-color: rgba(0, 184, 148, 0.25);
}

.arena-qualification-status.qualified .arena-qualification-icon {
    color: #00B894;
}

.arena-qualification-status.not-qualified {
    background: rgba(255, 179, 71, 0.08);
    border-color: rgba(255, 179, 71, 0.20);
}

.arena-qualification-status.not-qualified .arena-qualification-icon {
    color: #FFB347;
}

.arena-qualification-status.expired {
    background: rgba(255, 71, 87, 0.08);
    border-color: rgba(255, 71, 87, 0.20);
}

.arena-qualification-status.expired .arena-qualification-icon {
    color: #FF4757;
}

.arena-qualification-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.arena-qualification-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    flex: 1;
}

.arena-qualification-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
}

/* ── Arena Register Link ── */
.arena-register-link {
    margin-top: 12px;
    text-align: center;
}

.arena-register-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    border-radius: 50px;
    background: linear-gradient(135deg, #00B894, #006666);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

.arena-register-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 184, 148, 0.3);
}

.arena-register-btn i {
    font-size: 1rem;
}

/* ── Already Registered Badge ── */
.arena-register-link.already-registered {
    margin-top: 12px;
    text-align: center;
}

.arena-registered-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 50px;
    background: rgba(0, 184, 148, 0.10);
    border: 1px solid rgba(0, 184, 148, 0.2);
    color: #00B894;
    font-weight: 600;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
}

.arena-registered-badge i {
    font-size: 1rem;
}

/* ── Chronicle Qualification Label ── */
.chronicle-qualification-label {
    font-size: 0.55rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.chronicle-qualification-label.current {
    background: rgba(0, 184, 148, 0.10);
    color: #00B894;
    border: 1px solid rgba(0, 184, 148, 0.15);
}

.chronicle-qualification-label.previous {
    background: rgba(255, 179, 71, 0.08);
    color: #FFB347;
    border: 1px solid rgba(255, 179, 71, 0.12);
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .arena-qualification-status {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 14px;
    }

    .arena-qualification-text {
        font-size: 0.8rem;
    }

    .arena-qualification-badge {
        font-size: 0.6rem;
        padding: 2px 10px;
    }

    .arena-register-btn {
        width: 100%;
        justify-content: center;
        font-size: 0.8rem;
        padding: 10px 20px;
    }
}

@media (max-width: 380px) {
    .arena-qualification-text {
        font-size: 0.7rem;
    }

    .arena-qualification-badge {
        font-size: 0.55rem;
    }

    .arena-register-btn {
        font-size: 0.7rem;
        padding: 8px 16px;
    }

    .chronicle-qualification-label {
        font-size: 0.5rem;
        padding: 1px 8px;
    }
}

