/* ===== CIK-Bench Project Page — Custom Styles ===== */

:root {
  --danger: #e74c3c;
  --danger-dark: #c0392b;
  --warning: #f39c12;
  --success: #27ae60;
  --dark-bg: #0f1419;
  --dark-card: #1a1f2e;
  --accent-blue: #3498db;
  --text-light: #ecf0f1;
  --text-muted: #95a5a6;
}

body {
  font-family: 'Charter', 'Bitstream Charter', 'Sitka Text', Cambria, serif;
}

/* ===== Hero ===== */
.hero-section {
  background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 40%, #2c1810 100%);
  padding: 4rem 0 3rem;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 50%, rgba(231,76,60,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(243,156,18,0.06) 0%, transparent 60%);
  animation: pulse-bg 8s ease-in-out infinite alternate;
}

@keyframes pulse-bg {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

.hero-section * {
  position: relative;
  z-index: 1;
}

.paper-title {
  font-size: 2.8rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 0.3rem;
}

.paper-title .highlight {
  background: linear-gradient(90deg, var(--danger), var(--warning));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.paper-subtitle {
  font-size: 1.5rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 1.5rem;
}

.paper-subtitle .highlight {
  background: linear-gradient(90deg, var(--danger), var(--warning));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.paper-subtitle .highlight-blue {
  background: linear-gradient(90deg, var(--accent-blue), #1abc9c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.claw-icon {
  font-size: 1.3em;
  vertical-align: -0.05em;
}

.venue-badge {
  display: inline-block;
  background: rgba(231,76,60,0.15);
  border: 1px solid rgba(231,76,60,0.4);
  color: var(--danger);
  padding: 0.3rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  letter-spacing: 0.05em;
}

.author-list {
  color: var(--text-light);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.author-list a {
  color: #7fb3e0;
  text-decoration: none;
}

.author-list a:hover {
  text-decoration: underline;
}

.affiliation {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* Link buttons */
.hero-buttons .button {
  margin: 0.3rem;
  font-weight: 600;
  border-radius: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.hero-buttons .button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.hero-buttons .button .icon img {
  height: 18px;
  filter: brightness(0) invert(1);
}

/* ===== Teaser Figure ===== */
.teaser-section {
  background: #fafafa;
  padding: 2.5rem 0 2rem;
}

.teaser-section img {
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
}

.teaser-caption {
  font-size: 0.95rem;
  color: #555;
  margin-top: 1rem;
  line-height: 1.6;
  text-align: justify;
}

/* ===== Stats Banner ===== */
.stats-banner {
  background: linear-gradient(135deg, var(--dark-bg) 0%, #1e2736 100%);
  padding: 3rem 0;
}

.stat-card {
  text-align: center;
  padding: 1.5rem 1rem;
}

.stat-number {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.3rem;
}

.stat-number.danger { color: var(--danger); }
.stat-number.warning { color: var(--warning); }
.stat-number.success-color { color: var(--success); }
.stat-number.blue { color: var(--accent-blue); }

.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.3;
}

/* ===== Section Styles ===== */
.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--danger);
  border-radius: 2px;
}

.content-text {
  text-align: justify;
  line-height: 1.8;
  font-size: 1.05rem;
  color: #333;
}

/* ===== CIK Taxonomy Cards ===== */
.cik-card {
  border-radius: 12px;
  padding: 1.8rem;
  height: 100%;
  transition: transform 0.3s, box-shadow 0.3s;
  border: 1px solid #eee;
  background: #fff;
}

.cik-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 35px rgba(0,0,0,0.1);
}

.cik-card.capability { border-top: 4px solid var(--danger); }
.cik-card.identity { border-top: 4px solid var(--warning); }
.cik-card.knowledge { border-top: 4px solid var(--accent-blue); }

.cik-icon {
  font-size: 2.5rem;
  margin-bottom: 0.8rem;
}

.cik-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.cik-card .tag-list {
  margin-top: 0.8rem;
}

.cik-card .tag-list code {
  display: inline-block;
  background: #f5f5f5;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  margin: 0.15rem;
  color: #555;
}

/* ===== Demo Section ===== */
.demo-section {
  background: #f8f9fa;
  padding: 3.5rem 0;
}

.demo-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: transform 0.3s, box-shadow 0.3s;
  margin-bottom: 1.5rem;
}

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

.demo-card .demo-gif {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  background: #1a1f2e;
  display: block;
}

.demo-card .demo-gif-placeholder {
  width: 100%;
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #1a1f2e, #2c3e50);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #7f8c8d;
  font-size: 1rem;
  gap: 0.5rem;
}

.demo-card .demo-gif-placeholder .placeholder-icon {
  font-size: 3rem;
  opacity: 0.5;
}

.demo-card .demo-info {
  padding: 1rem 1.2rem;
}

.demo-card .demo-info h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.demo-card .demo-info p {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.4;
}

.demo-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  margin-bottom: 0.4rem;
}

.demo-label.attack { background: rgba(231,76,60,0.12); color: var(--danger); }
.demo-label.defense { background: rgba(39,174,96,0.12); color: var(--success); }

/* ===== Results Table ===== */
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 1.5rem 0;
}

.results-table th {
  background: var(--dark-bg);
  color: #fff;
  padding: 0.8rem 1rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.results-table th:first-child {
  text-align: left;
  border-radius: 8px 0 0 0;
}

.results-table th:last-child {
  border-radius: 0 8px 0 0;
}

.results-table td {
  padding: 0.7rem 1rem;
  text-align: center;
  border-bottom: 1px solid #eee;
}

.results-table td:first-child {
  text-align: left;
  font-weight: 600;
}

.results-table tbody tr:hover {
  background: #fef9f0;
}

.cell-high { color: var(--danger); font-weight: 700; }
.cell-mid { color: var(--warning); font-weight: 600; }
.cell-low { color: var(--success); font-weight: 600; }

/* ===== ASR Bar ===== */
.asr-bar-container { margin: 0.5rem 0; }

.asr-bar {
  height: 26px;
  border-radius: 4px;
  background: #f0f0f0;
  overflow: hidden;
  position: relative;
}

.asr-bar-fill {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  transition: width 1.2s ease-out;
  width: 0;
}

.asr-bar-fill.high { background: linear-gradient(90deg, #e74c3c, #c0392b); }
.asr-bar-fill.mid { background: linear-gradient(90deg, #f39c12, #e67e22); }
.asr-bar-fill.low { background: linear-gradient(90deg, #27ae60, #219a52); }

.asr-model-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.15rem;
  display: flex;
  justify-content: space-between;
}

/* ===== Case Study ===== */
.case-study-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e8e8e8;
  overflow: hidden;
  height: 100%;
}

.case-study-header {
  padding: 1rem 1.2rem 0.8rem;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.case-study-header.knowledge { border-bottom: 3px solid var(--accent-blue); }
.case-study-header.identity { border-bottom: 3px solid var(--warning); }
.case-study-header.capability { border-bottom: 3px solid var(--danger); }

.case-study-body { padding: 1rem 1.2rem; }

.attack-flow {
  position: relative;
  padding-left: 1.5rem;
}

.attack-flow::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ddd;
}

.attack-flow .step {
  position: relative;
  margin-bottom: 1rem;
  padding-left: 1rem;
}

.attack-flow .step::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid;
}

.attack-flow .step.inject::before { border-color: var(--warning); background: rgba(243,156,18,0.2); }
.attack-flow .step.trigger::before { border-color: var(--danger); background: rgba(231,76,60,0.2); }
.attack-flow .step.result::before { border-color: #333; background: rgba(0,0,0,0.15); }

.attack-flow .step-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.2rem;
}

.attack-flow .step-label.ph1 { color: var(--warning); }
.attack-flow .step-label.ph2 { color: var(--danger); }
.attack-flow .step-label.outcome { color: #333; }

.attack-flow .step p {
  font-size: 0.85rem;
  color: #555;
  line-height: 1.5;
  margin: 0;
}

.attack-flow .step code {
  background: #f5f5f5;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.8rem;
}

/* ===== Findings Box ===== */
.findings-box {
  background: #fffbf0;
  border: 1px solid #f5e6cc;
  border-left: 4px solid var(--warning);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.findings-box.danger {
  background: #fff5f5;
  border-color: #f5cccc;
  border-left-color: var(--danger);
}

/* ===== GIF Carousel ===== */
.gif-carousel {
  position: relative;
  margin-bottom: 2rem;
  padding: 0 48px;
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  gap: 16px;
  padding: 8px 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.carousel-track::-webkit-scrollbar { display: none; }

.carousel-slide {
  flex: 0 0 420px;
  min-width: 420px;
}

.carousel-slide .gif-player {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.carousel-slide .gif-img {
  width: 100%;
  display: block;
}

.carousel-label {
  background: var(--dark-bg);
  color: #fff;
  padding: 8px 12px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #ddd;
  font-size: 1rem;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: background 0.2s, box-shadow 0.2s;
  z-index: 2;
}

.carousel-btn:hover {
  background: #f5f5f5;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

.carousel-prev { left: 0; }
.carousel-next { right: 0; }

/* ===== Scenario Grid ===== */
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.scenario-item {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 1rem;
  transition: box-shadow 0.2s;
  position: relative;
}

.scenario-icon {
  position: absolute;
  top: 5px;
  right: 8px;
  max-width: clamp(70px, 30%, 150px);
  max-height: 85px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  opacity: 0.85;
}

.scenario-item[data-scenario] { cursor: pointer; }

.scenario-item:hover {
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
}

.scenario-item.active {
  border-color: var(--danger);
  box-shadow: 0 4px 15px rgba(231,76,60,0.15);
}

.scenario-item .scenario-id {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--danger);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.scenario-item h5 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0.2rem 0;
  padding-right: 32%;
}

.scenario-item p {
  font-size: 0.82rem;
  color: #666;
  margin: 0;
  line-height: 1.4;
}

.impact-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.impact-tag.privacy { background: rgba(52,152,219,0.12); color: var(--accent-blue); }
.impact-tag.risk { background: rgba(231,76,60,0.12); color: var(--danger); }

/* ===== BibTeX ===== */
.bibtex-section {
  background: #f8f9fa;
  padding: 2.5rem 0;
}

.bibtex-block {
  background: var(--dark-bg);
  color: #abb2bf;
  padding: 1.5rem;
  border-radius: 10px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  overflow-x: auto;
  position: relative;
}

.bibtex-block .copy-btn {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #aaa;
  padding: 0.3rem 0.7rem;
  border-radius: 5px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.bibtex-block .copy-btn:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--dark-bg);
  color: var(--text-muted);
  padding: 2rem 0;
  text-align: center;
  font-size: 0.85rem;
}

.site-footer a {
  color: #7fb3e0;
  text-decoration: none;
}

/* ===== Tradeoff Visual ===== */
.tradeoff-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.tradeoff-side {
  text-align: center;
  padding: 1.5rem 2rem;
  border-radius: 10px;
  min-width: 200px;
}

.tradeoff-side.evolution { background: #f0faf4; border: 1px solid #c8e6d4; }
.tradeoff-side.safety { background: #fff5f5; border: 1px solid #f5cccc; }

.tradeoff-arrow { font-size: 2rem; color: #999; }

.tradeoff-side .tradeoff-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.tradeoff-side h4 { font-weight: 700; font-size: 1rem; margin-bottom: 0.3rem; }
.tradeoff-side p { font-size: 0.85rem; color: #666; margin: 0; }

/* ===== Workflow Steps ===== */
.workflow-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.workflow-step {
  background: #fff;
  border-radius: 10px;
  padding: 1rem 1.5rem;
  text-align: center;
  border: 2px solid #eee;
  min-width: 180px;
}

.workflow-step.phase1 { border-color: var(--warning); }
.workflow-step.phase2 { border-color: var(--danger); }

.workflow-step .step-icon { font-size: 1.5rem; margin-bottom: 0.3rem; }
.workflow-step h5 { font-size: 0.85rem; font-weight: 700; margin: 0.3rem 0; }
.workflow-step p { font-size: 0.78rem; color: #666; margin: 0; }
.workflow-arrow { font-size: 1.5rem; color: #ccc; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .paper-title { font-size: 1.8rem; }
  .paper-subtitle { font-size: 1.1rem; }
  .stat-number { font-size: 2.2rem; }
  .section-title { font-size: 1.4rem; }
  .hero-section { padding: 2rem 0 1.5rem; }
  .scenario-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .scenario-icon { max-width: clamp(50px, 25%, 100px); max-height: 60px; }
  .scenario-item h5 { padding-right: 28%; }
  .hero-icon { width: clamp(80px, 18%, 140px); }
  .hero-thumbs { grid-template-columns: repeat(3, 1fr); }
  .thumb-icon { max-width: clamp(30px, 50%, 80px); max-height: 50px; }
}

/* ===== Fake Terminal Placeholder ===== */
.fake-terminal {
  width: 100%;
  aspect-ratio: 16/10;
  background: #1e1e2e;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.72rem;
  line-height: 1.6;
  position: relative;
}

.fake-terminal .terminal-bar {
  background: #313244;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.fake-terminal .terminal-bar .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.fake-terminal .terminal-bar .dot.red { background: #f38ba8; }
.fake-terminal .terminal-bar .dot.yellow { background: #f9e2af; }
.fake-terminal .terminal-bar .dot.green { background: #a6e3a1; }

.fake-terminal .terminal-bar .title {
  color: #6c7086;
  font-size: 0.7rem;
  margin-left: 0.5rem;
}

.fake-terminal .terminal-body {
  padding: 0.6rem 0.8rem;
  color: #cdd6f4;
}

.fake-terminal .line {
  white-space: nowrap;
  overflow: hidden;
  opacity: 0;
  animation: typeLine 8s infinite;
}

.fake-terminal .line .prompt { color: #a6e3a1; }
.fake-terminal .line .cmd { color: #89b4fa; }
.fake-terminal .line .str { color: #f9e2af; }
.fake-terminal .line .comment { color: #6c7086; }
.fake-terminal .line .danger-text { color: #f38ba8; }
.fake-terminal .line .ok { color: #a6e3a1; }
.fake-terminal .line .dim { color: #585b70; }

.fake-terminal .line:nth-child(1) { animation-delay: 0s; }
.fake-terminal .line:nth-child(2) { animation-delay: 0.5s; }
.fake-terminal .line:nth-child(3) { animation-delay: 1.0s; }
.fake-terminal .line:nth-child(4) { animation-delay: 1.5s; }
.fake-terminal .line:nth-child(5) { animation-delay: 2.0s; }
.fake-terminal .line:nth-child(6) { animation-delay: 2.5s; }
.fake-terminal .line:nth-child(7) { animation-delay: 3.0s; }
.fake-terminal .line:nth-child(8) { animation-delay: 3.5s; }
.fake-terminal .line:nth-child(9) { animation-delay: 4.0s; }

@keyframes typeLine {
  0%       { opacity: 0; transform: translateX(-8px); }
  5%       { opacity: 1; transform: translateX(0); }
  80%      { opacity: 1; transform: translateX(0); }
  90%,100% { opacity: 0; transform: translateX(0); }
}

.fake-terminal .cursor-blink::after {
  content: '\2588';
  color: #cdd6f4;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ===== Hero GIF + Thumbnails ===== */
.hero-gif-wrap {
  margin-bottom: 1rem;
}

.hero-gif-wrap .gif-player {
  position: relative;
}

.hero-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  width: clamp(100px, 20%, 180px);
  height: auto;
  max-height: 110px;
  object-fit: contain;
  background: rgba(255,255,255,0.85);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 5;
  transition: opacity 0.3s;
}

.hero-thumbs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 0.8rem;
}

.hero-thumb {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  transition: border-color 0.3s, transform 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.hero-thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.hero-thumb.active {
  border-color: var(--danger);
}

.hero-thumb > img:first-child {
  width: 100%;
  display: block;
}

.thumb-icon {
  position: absolute;
  top: 4px;
  left: 4px;
  max-width: clamp(40px, 60%, 120px);
  max-height: 80px;
  width: auto;
  height: auto;
  object-fit: contain;
  background: rgba(255,255,255,0.88);
  border-radius: 5px;
  padding: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* ===== GIF Player ===== */
.gif-player {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  cursor: pointer;
}

.gif-player .gif-img {
  width: 100%;
  display: block;
  transition: filter 0.4s;
}

.gif-play-hint {
  display: none;
}

/* Overlay annotations */
.gif-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 3;
}

.gif-label {
  position: absolute;
  padding: 4px 12px;
  border-radius: 4px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}

.gif-label.danger { background: rgba(231,76,60,0.88); color: #fff; }
.gif-label.warning { background: rgba(243,156,18,0.88); color: #fff; }
.gif-label.info { background: rgba(52,152,219,0.88); color: #fff; }

.gif-label.pulse {
  animation: label-pulse 2s ease-in-out infinite;
}

@keyframes label-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231,76,60,0.5); }
  50% { box-shadow: 0 0 0 8px rgba(231,76,60,0); }
}

/* Highlight box */
.gif-highlight {
  position: absolute;
  border: 6px solid rgba(231,76,60,0.8);
  border-radius: 4px;
  pointer-events: none;
  animation: highlight-glow 2s ease-in-out infinite;
}

.gif-highlight.thin { border-width: 3px; }

/* Show highlight only when its step is active */
.gif-highlight[data-step] { display: none; }
.gif-player[data-active-step="0"] .gif-highlight[data-step="0"] { display: block; }
.gif-player[data-active-step="1"] .gif-highlight[data-step="1"] { display: block; }

@keyframes highlight-glow {
  0%, 100% { border-color: rgba(231,76,60,0.8); box-shadow: inset 0 0 12px rgba(231,76,60,0.15); }
  50% { border-color: rgba(231,76,60,0.4); box-shadow: inset 0 0 6px rgba(231,76,60,0.05); }
}

/* Hover hint text */
.gif-hover-hint {
  font-size: 0.78rem;
  color: #999;
  margin-top: 0.6rem;
  text-align: center;
}

/* ===== Step Indicator ===== */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.8rem;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1.05rem;
  color: #bbb;
  font-weight: 600;
  transition: color 0.4s;
}

.step-item.active { color: var(--danger); }

.step-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #ddd;
  background: #fff;
  transition: all 0.4s;
  flex-shrink: 0;
}

.step-item.active .step-dot {
  border-color: var(--danger);
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(231,76,60,0.2);
}

.step-connector {
  width: 48px;
  height: 3px;
  background: #e0e0e0;
  margin: 0 6px;
  transition: background 0.4s;
  flex-shrink: 0;
}

.step-connector.active { background: var(--danger); }

/* ===== Lightbox ===== */
.gif-lightbox {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.gif-lightbox.open { opacity: 1; pointer-events: all; }

.gif-lightbox-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.88);
}

.gif-lightbox-content {
  position: relative;
  max-width: 92vw;
  max-height: 92vh;
  transform: scale(0.92);
  transition: transform 0.3s;
}

.gif-lightbox.open .gif-lightbox-content { transform: scale(1); }

.gif-lightbox-content img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  display: block;
}

.gif-lightbox-close {
  position: absolute;
  top: -14px; right: -14px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #fff;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  transition: transform 0.2s;
  color: #333;
}

.gif-lightbox-close:hover { transform: scale(1.15); }

/* ===== Animation on scroll ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
