/* ============================================================
   🔥 SYSMI STREAK HUB MODAL (CYBERPUNK FLAMES)
   Style moderne, dynamique et immersif pour le suivi des flammes
   ============================================================ */

:root {
  --streak-fire: #ff3b00;
  --streak-amber: #ff8c00;
  --streak-gold: #ffd700;
  --streak-cyan: #00f0ff;
  --streak-bg: rgba(13, 14, 22, 0.95);
  --streak-card-bg: rgba(22, 23, 38, 0.7);
  --streak-card-border: rgba(255, 140, 0, 0.25);
  --streak-glow: 0 0 25px rgba(255, 69, 0, 0.35);
}

/* --- WRAPPER & BACKDROP --- */
.streak-modal-wrapper {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: streakFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.streak-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 12, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* --- DIALOG --- */
.streak-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--streak-bg);
  border: 1px solid var(--streak-card-border);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.75), var(--streak-glow);
  color: #f1f2f8;
  display: flex;
  flex-direction: column;
  animation: streakPopUp 0.3s cubic-bezier(0.34, 1.45, 0.7, 1) forwards;
}

/* Hide scrollbar */
.streak-modal-dialog::-webkit-scrollbar {
  width: 6px;
}
.streak-modal-dialog::-webkit-scrollbar-thumb {
  background: rgba(255, 140, 0, 0.3);
  border-radius: 4px;
}

/* --- CLOSE BUTTON --- */
.streak-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #a0a5b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.streak-modal-close:hover {
  background: rgba(255, 69, 0, 0.2);
  border-color: var(--streak-fire);
  color: #ffffff;
  transform: rotate(90deg) scale(1.08);
}

/* --- HERO SECTION --- */
.streak-hero {
  position: relative;
  padding: 36px 24px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: radial-gradient(circle at 50% 20%, rgba(255, 69, 0, 0.22) 0%, transparent 70%);
}

.streak-flame-hero-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.streak-flame-halo {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 69, 0, 0.5) 0%, rgba(255, 215, 0, 0.2) 50%, transparent 75%);
  filter: blur(14px);
  animation: streakHaloPulse 2.4s ease-in-out infinite alternate;
}

.streak-flame-icon-large {
  font-size: 58px;
  line-height: 1;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 16px rgba(255, 69, 0, 0.8));
  animation: streakFlameFlicker 1.8s ease-in-out infinite;
  user-select: none;
}

.streak-counter-number {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 10%, #ffd700 50%, #ff4500 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  margin-bottom: 4px;
}

.streak-counter-sub {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #ff9800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.streak-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 140, 0, 0.14);
  border: 1px solid rgba(255, 140, 0, 0.4);
  font-size: 12px;
  font-weight: 700;
  color: #ffc107;
  box-shadow: 0 0 12px rgba(255, 140, 0, 0.2);
}

/* --- COUNTDOWN BOX --- */
.streak-countdown-box {
  margin: 0 20px 16px 20px;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(18, 19, 32, 0.85);
  border: 1px solid rgba(255, 140, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.streak-countdown-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.streak-countdown-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #8f95af;
  display: flex;
  align-items: center;
  gap: 5px;
}

.streak-countdown-status {
  font-size: 12px;
  font-weight: 500;
  color: #a0f0a0;
}
.streak-countdown-status.urgent {
  color: #ff9f43;
}

.streak-countdown-digits {
  font-family: 'JetBrains Mono', 'Fira Code', 'Roboto Mono', monospace;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffd700;
  background: rgba(255, 215, 0, 0.08);
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 215, 0, 0.25);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.15);
  white-space: nowrap;
}

/* --- 7-DAY CALENDAR TRACKER --- */
.streak-calendar-section {
  padding: 0 20px 16px 20px;
}

.streak-calendar-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.streak-calendar-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #d1d4e5;
  display: flex;
  align-items: center;
  gap: 6px;
}

.streak-calendar-pill-tag {
  font-size: 11px;
  font-weight: 600;
  color: #ff9800;
  background: rgba(255, 152, 0, 0.1);
  padding: 2px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 152, 0, 0.2);
}

.streak-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.streak-day-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 4px;
  border-radius: 14px;
  background: var(--streak-card-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.25s ease;
  position: relative;
}

.streak-day-name {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: #7b819a;
  margin-bottom: 6px;
}

.streak-day-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: #555b72;
  margin-bottom: 4px;
}

.streak-day-indicator {
  font-size: 9px;
  font-weight: 700;
  color: #646a82;
  letter-spacing: -0.2px;
}

/* Active Completed Day */
.streak-day-card.completed {
  background: linear-gradient(145deg, rgba(255, 69, 0, 0.22), rgba(255, 140, 0, 0.12));
  border-color: rgba(255, 140, 0, 0.45);
  box-shadow: 0 0 12px rgba(255, 140, 0, 0.2);
}
.streak-day-card.completed .streak-day-name {
  color: #ffa726;
}
.streak-day-card.completed .streak-day-icon {
  background: linear-gradient(135deg, #ff4500, #ff8c00);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 69, 0, 0.5);
}
.streak-day-card.completed .streak-day-indicator {
  color: #4caf50;
  font-weight: 800;
}

/* Today (Active) */
.streak-day-card.today {
  border-color: #ffd700;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.35);
  background: linear-gradient(145deg, rgba(255, 215, 0, 0.18), rgba(255, 69, 0, 0.15));
  transform: translateY(-2px);
}
.streak-day-card.today .streak-day-name {
  color: #ffd700;
}
.streak-day-card.today .streak-day-icon {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #111;
  animation: streakTodayBounce 1.5s ease-in-out infinite;
}
.streak-day-card.today .streak-day-indicator {
  color: #ffd700;
  font-weight: 800;
}

/* Day 7 Special Reward Card */
.streak-day-card.reward-day {
  border-color: rgba(255, 215, 0, 0.35);
}
.streak-day-card.reward-day::after {
  content: "🎁";
  position: absolute;
  top: -6px;
  right: -4px;
  font-size: 11px;
}

/* --- STATS & MULTIPLIERS GRID --- */
.streak-perks-section {
  padding: 0 20px 20px 20px;
}

.streak-perks-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.streak-perk-card {
  padding: 12px 10px;
  border-radius: 14px;
  background: var(--streak-card-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.streak-perk-icon {
  font-size: 20px;
  margin-bottom: 2px;
}

.streak-perk-val {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
}

.streak-perk-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: #8b91a7;
  letter-spacing: 0.3px;
}

/* --- ACTIONS FOOTER --- */
.streak-modal-footer {
  padding: 16px 20px 24px 20px;
  display: flex;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.streak-btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.streak-btn-share {
  background: linear-gradient(135deg, #ff4500, #ff8c00);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(255, 69, 0, 0.35);
}
.streak-btn-share:hover {
  background: linear-gradient(135deg, #ff5722, #ffa000);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255, 69, 0, 0.5);
}

.streak-btn-dismiss {
  background: rgba(255, 255, 255, 0.06);
  color: #c4c7d7;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.streak-btn-dismiss:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* --- HERO STREAK PILL (NAV / HOME / PROFILE) --- */
.hero-streak-pill,
.streak-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: linear-gradient(135deg, #ff4500, #ff8c00) !important;
  color: #ffffff !important;
  padding: 5px 12px !important;
  border-radius: 999px !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  border: 1px solid rgba(255, 215, 0, 0.4) !important;
  box-shadow: 0 0 14px rgba(255, 69, 0, 0.45) !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  user-select: none !important;
  text-decoration: none !important;
}

.hero-streak-pill:hover,
.streak-badge:hover {
  transform: translateY(-2px) scale(1.05) !important;
  box-shadow: 0 0 22px rgba(255, 140, 0, 0.7) !important;
  border-color: #ffd700 !important;
}

.hero-streak-pill:active,
.streak-badge:active {
  transform: scale(0.96) !important;
}

.hero-streak-pill .streak-flame-icon,
.streak-badge .streak-flame-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: streakFlameFlicker 1.8s ease-in-out infinite;
}

/* --- ANIMATIONS --- */
@keyframes streakFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes streakPopUp {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(16px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes streakHaloPulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.15); opacity: 0.95; }
}

@keyframes streakFlameFlicker {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.08) rotate(-3deg); }
  50% { transform: scale(1.02) rotate(2deg); }
  75% { transform: scale(1.1) rotate(-1deg); }
}

@keyframes streakTodayBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 540px) {
  .streak-modal-dialog {
    max-height: 94vh;
    border-radius: 20px;
  }
  .streak-hero {
    padding: 28px 16px 16px 16px;
  }
  .streak-counter-number {
    font-size: 32px;
  }
  .streak-countdown-box {
    margin: 0 14px 14px 14px;
    padding: 12px;
    flex-direction: column;
    align-items: flex-start;
  }
  .streak-countdown-digits {
    align-self: flex-end;
  }
  .streak-calendar-section {
    padding: 0 14px 14px 14px;
  }
  .streak-days-grid {
    gap: 4px;
  }
  .streak-day-card {
    padding: 8px 2px;
  }
  .streak-day-icon {
    width: 26px;
    height: 26px;
    font-size: 13px;
  }
  .streak-perks-section {
    padding: 0 14px 16px 14px;
  }
  .streak-modal-footer {
    padding: 14px 14px 20px 14px;
  }
}
