/* ===========================================
   CLEAN AI OVERLAY (NO DOT, NO CROP)
   =========================================== */
/* ===========================================
   CLEAN AI OVERLAY — WITH 3 DOTS
   =========================================== */

#ai-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;

  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);

  overflow: hidden;
}

.ai-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  width: 92%;
  max-width: 420px;
  padding: 0 6px;

  display: flex;
  flex-direction: column;
  align-items: center;
}

/* === Processing Title === */
.ai-title {
  font-size: 1.7em;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 18px;

  display: flex;
  align-items: center;
  gap: 6px;

  text-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
}

/* === Three-dot animation === */
.ai-dots {
  display: inline-flex;
  gap: 4px;
  margin-left: 3px;
}

.ai-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffffff;
  opacity: 0.6;

  animation: dotBlink 1.4s infinite ease-in-out;
}

.ai-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBlink {
  0%, 80%, 100% {
    opacity: 0.4;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

/* === Steps Log === */
.ai-steps {
  width: 100%;
  max-height: 260px;
  margin-bottom: 18px;
  padding-right: 6px;

  overflow-y: auto;
  scrollbar-width: none;

  color: #ffffff;
  font-size: 14px;
  line-height: 1.45;

  -webkit-overflow-scrolling: touch;
}
.ai-steps::-webkit-scrollbar { display: none; }

.ai-step-title {
  font-size: 12px;
  font-weight: 600;
  margin-top: 14px;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
  opacity: 0;

  animation: fadeSlide 0.3s forwards ease-out;
}

.ai-step-entry {
  padding-left: 12px;
  margin-left: 4px;
  margin-bottom: 4px;

  border-left: 2px solid rgba(255,255,255,0.25);
  opacity: 0;

  animation: fadeSlide 0.3s forwards ease-out;
}

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

/* === Progress Bar === */
#ai-progress-container {
  width: 100%;
}

#ai-progress-bar {
  width: 0%;
  height: 6px;
  border-radius: 4px;
  background: linear-gradient(90deg, #fff, #e6e6e6);
  transition: width 0.25s ease-out;
}

#ai-progress-info {
  text-align: center;
  margin-top: 8px;
  font-size: 14px;
  color: #e5e5e5;
}








/* ==============ends overlay================== */







/* ===== Modal Background ===== */
.stats-modal {
  display: none; /* hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 15, 15, 0.55);
  backdrop-filter: blur(6px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  animation: fadeInBg 0.3s ease;
}

/* ===== Modal Content ===== */
.stats-modal-content {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 16px;
  padding: 30px 35px;
  width: 90%;
  max-width: 600px; /* smaller and more compact */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  animation: fadeIn 0.3s ease;
  position: relative;
  color: #222;
  font-family: 'Inter', 'Segoe UI', sans-serif;
}

/* ===== Header ===== */
.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.stats-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: #333;
  letter-spacing: 0.5px;
}

.stats-close {
  position: absolute;
  top: 5px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 26px;
  color: #777;
  cursor: pointer;
  transition: color 0.2s ease;
}

.stats-close:hover {
  color: #222;
}

/* ===== Stats Grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 20px;
}

/* ===== Stat Card ===== */
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 25px 10px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.stat-card h1 {
  font-size: 36px;
  font-weight: 800;
  margin: 0;
  color: #2b2b2b;
}

.stat-card p {
  font-size: 15px;
  font-weight: 600;
  color: #555;
  margin: 6px 0;
}

.stat-card span {
  font-size: 13px;
  color: #888;
}

/* ===== Disabled State ===== */
.environment,
.social-interactions {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ends here */


/* AI pop-up box */

.ai-popup {
    position: absolute;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 10px 10px;
    width: 240px;
    text-align: left;
    z-index: 9999;
    transform-origin: top center;
    animation: aiPopupFadeIn 0.25s ease forwards;
  }

  .ai-popup.hidden {
    display: none;
  }
.ai-popup-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* keep text left-aligned */
  justify-content: center;
  width: 100%; /* full width within popup */
  box-sizing: border-box;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  cursor: pointer;
  transition: all 0.2s ease;
  border-left: 4px solid transparent;
  border-radius: 8px;
}

.ai-popup-item:hover {
  background: #f8faff;
  color: #2563eb;
  border-left-color: #2563eb;
}

/* Ensures subtext aligns perfectly with title text and doesn't overflow */
.ai-subtext {
  font-size: 12.5px;
  font-weight: 400;
  color: #6b7280;
  margin-top: 4px;
  line-height: 1.4;
  padding-left: 22px; /* aligns with icon + spacing */
  text-indent: 0;
  width: calc(100% - 22px);
  box-sizing: border-box;
}

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

  #ai-red-fighter:hover,
  .analyze-with-ai:hover {
    filter: brightness(1.15);
    cursor: pointer;
  }





  /* ===== AI Background Indicator ===== */
#ai-background-indicator {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 10px 16px;
  border-radius: 25px;
  font-size: 14px;
  font-family: "Inter", "Segoe UI", sans-serif;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.4s ease;
}


#ai-background-indicator.active {
  opacity: 1;
}

.ai-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #4CAF50;
  margin-right: 8px;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

.ai-indicator-text {
  letter-spacing: 0.3px;
}


#cancel-task {
  margin-left: 8px;
  background: #FF5242;
  color: white;
  border: none;
  outline: none;
  border-radius: 10px;
  /* padding: 8px; */
  text-align: center;
  height: 25px;
  cursor: pointer;
  z-index: 10000;
}