/* Master style.css for Digital Ducks Forensics */
:root {
  --bg: #070b14;
  --text: #e9eefb;
  --muted: rgba(233,238,251,.72);
  --muted2: rgba(233,238,251,.55);
  --line: rgba(255,255,255,.10);
  --accent: #7c3aed;
  --accent2: #06b6d4;
  --danger: #ef4444;
  --warning: #ff9800;
  --radius2: 26px;
  --max: 1100px;
  --shadow: 0 18px 50px rgba(0,0,0,.55);
}

* { box-sizing: border-box; scroll-behavior: smooth; }
body { margin: 0; font-family: ui-sans-serif, system-ui, -apple-system, sans-serif; color: var(--text); background: var(--bg); overflow-x: hidden; line-height: 1.6; }

/* Backgrounds & Layout */
.bg { position: fixed; inset: 0; z-index: -2; background-image: url('digital-ducks-background.png'); background-size: cover; background-position: center; filter: blur(16px) saturate(1.05); opacity: .22; transform: scale(1.05); }
.bgOverlay { position: fixed; inset: 0; z-index: -1; background: radial-gradient(900px 500px at 20% 10%, rgba(124,58,237,.25), transparent 60%), radial-gradient(900px 500px at 80% 15%, rgba(6,182,212,.18), transparent 55%), linear-gradient(180deg, rgba(7,11,20,.88), rgba(7,11,20,.96)); }
a { color: inherit; text-decoration: none; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 18px; }
main { padding: 46px 0 20px; }

/* Navigation Topbar */
.topbar { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(12px); background: rgba(7,11,20,.55); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; white-space: nowrap; z-index: 100; }
.logo { width: 34px; height: 34px; border-radius: 12px; background: linear-gradient(135deg, var(--accent), var(--accent2)); border: 1px solid rgba(255,255,255,.18); box-shadow: 0 12px 26px rgba(0,0,0,.45); }
.brand small { display: block; color: var(--muted2); font-weight: 650; margin-top: -2px; }
.nav-links { display: flex; gap: 20px; font-weight: 600; font-size: 0.9rem; flex-wrap: wrap; }
.nav-links a:hover { color: var(--accent2); transition: color 0.2s; }

/* Buttons & Pills */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; border-radius: 14px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06); color: var(--text); font-weight: 800; transition: all 0.2s ease; cursor: pointer; }
.btn:hover { background: rgba(255,255,255,.12); border-color: var(--accent2); transform: translateY(-1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: #6d28d9; border-color: #6d28d9; }
.btn-danger { background: rgba(239, 68, 68, 0.15); border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); border-color: #f87171; color: #f87171; }
.nav-pills { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.pill { font-size: 0.85rem; padding: 6px 14px; background: rgba(255,255,255,0.05); border-radius: 20px; border: 1px solid var(--line); transition: all 0.2s ease; cursor: pointer; }
.pill:hover { border-color: var(--accent); background: rgba(124,58,237,.1); }

/* Headers, Titles, and Logos */
.hero { text-align: center; padding: 60px 0 60px; }
.hero-logo { display: block; margin: 0 auto 20px auto; width: 100%; max-width: 280px; height: auto; filter: drop-shadow(0 10px 30px rgba(0,0,0,0.5)); transition: transform 0.3s ease; }
.hero-logo:hover { transform: scale(1.03); filter: drop-shadow(0 0 25px var(--accent2)); }
.page-logo { display: block; margin: 0 0 24px 0; width: 100%; max-width: 220px; height: auto; filter: drop-shadow(0 8px 20px rgba(0,0,0,0.5)); transition: transform 0.3s ease; }
.page-logo:hover { transform: scale(1.02); filter: drop-shadow(0 0 20px var(--accent2)); }
.page-header { padding: 0 0 40px; text-align: center; border-bottom: 1px solid var(--line); margin-bottom: 40px; }

h1 { margin: 0 0 16px; font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -1px; line-height: 1.1; }
.hero h1 span, .page-header h1 { background: linear-gradient(135deg, var(--accent2), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
h2 { margin: 40px 0 10px; font-size: 1.8rem; color: var(--accent2); }
.lead { color: var(--muted); max-width: 700px; margin: 0 auto 30px; font-size: 1.1rem; }
.hero p { color: var(--muted); max-width: 700px; margin: 0 auto 30px; font-size: 1.1rem; }
.hero-buttons { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* Grids & Cards */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 20px; }
.card { border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); border-radius: var(--radius2); padding: 30px; box-shadow: 0 14px 40px rgba(0,0,0,.35); transition: transform 0.3s ease, border-color 0.3s ease; display: flex; flex-direction: column; scroll-margin-top: 100px; }
.card:hover { transform: translateY(-4px); border-color: rgba(255,255,255,0.25); }
.card h2 { margin: 0 0 10px 0; font-size: 1.8rem; color: var(--accent2); display: flex; align-items: center; justify-content: space-between; }
.card h3 { margin: 0 0 12px; font-size: 1.4rem; color: #fff; }
.card strong { display: block; margin-bottom: 8px; font-size: 1.1rem; color: #fff; }
.card p { margin: 0 0 20px 0; color: var(--muted); flex-grow: 1; }
.card ul { margin: 0 0 16px 0; color: var(--muted); padding-left: 20px; }
.card li { margin-bottom: 8px; }

/* Badges & Tags */
.tag { display: inline-block; padding: 4px 10px; border-radius: 8px; background: rgba(255,255,255,0.1); font-size: 0.75rem; text-transform: uppercase; margin-bottom: 12px; border: 1px solid var(--line); font-weight: bold; letter-spacing: 1px; }
.tag-container { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tag-malware { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border-color: #ef4444; }
.tag-social { background: rgba(245, 158, 11, 0.2); color: #fcd34d; border-color: #f59e0b; }
.tag-network { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; border-color: #10b981; }
.tag.win { color: #60a5fa; border-color: #60a5fa; }
.tag.lin { color: #f472b6; border-color: #f472b6; }
.tag.web { color: #34d399; border-color: #34d399; }

/* Icons & Banners */
.feature-icon { font-size: 2.5rem; margin-bottom: 15px; display: inline-block; background: -webkit-linear-gradient(135deg, var(--accent2), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.status-banner { background: rgba(6, 182, 212, 0.1); border: 1px solid rgba(6, 182, 212, 0.3); padding: 12px; border-radius: 12px; text-align: center; font-size: 0.9rem; margin-bottom: 40px; color: var(--accent2); display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;}
.pulse { width: 8px; height: 8px; background: var(--accent2); border-radius: 50%; box-shadow: 0 0 10px var(--accent2); animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }

/* Specialized Components (Case Studies, Details, Dictionary) */
.target { color: var(--accent2); font-weight: bold; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.analogy-box { background: rgba(124,58,237,.15); border-left: 4px solid var(--accent); padding: 16px; border-radius: 0 12px 12px 0; margin-bottom: 20px; }
dt { font-weight: bold; color: var(--accent2); margin-top: 16px; font-size: 1.1rem; }
dd { margin-left: 0; color: var(--muted); margin-top: 4px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
dd:last-child { border-bottom: none; padding-bottom: 0; }
.case-timeline { border-left: 2px solid var(--line); margin: 20px 0; padding-left: 20px; }
.timeline-event { margin-bottom: 15px; position: relative; }
.timeline-event::before { content: ''; position: absolute; left: -25px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent2); box-shadow: 0 0 8px var(--accent2); }
.timeline-time { font-size: 0.8rem; color: var(--accent2); font-weight: bold; letter-spacing: 1px; display: block; margin-bottom: 4px; }
.impact-metrics { display: flex; gap: 15px; margin-top: 15px; flex-wrap: wrap; }
.metric { background: rgba(0,0,0,0.3); border: 1px solid var(--line); padding: 8px 12px; border-radius: 8px; font-size: 0.85rem; }
.metric strong { display: inline; color: #fff; margin-right: 5px; font-size: 0.85rem; }

/* Forms, Audits, & Quizzes */
.form-group { margin-bottom: 16px; }
label { display: block; font-size: 0.9rem; margin-bottom: 6px; color: var(--muted); font-weight: bold; }
input[type="text"], input[type="email"], textarea, .form-control { width: 100%; padding: 12px 16px; border-radius: 12px; background: rgba(0,0,0,0.3); border: 1px solid var(--line); color: var(--text); font-family: inherit; font-size: 1rem; transition: border-color 0.2s; resize: vertical; }
input:focus, textarea:focus, .form-control:focus { outline: none; border-color: var(--accent2); background: rgba(0,0,0,0.4); }

.audit-section { margin-bottom: 30px; }
.audit-section h3 { color: var(--accent); border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 16px; }
.form-group-check { display: flex; gap: 12px; align-items: flex-start; background: rgba(0,0,0,0.2); padding: 16px; border-radius: 12px; margin-bottom: 12px; border: 1px solid transparent; transition: border-color 0.2s; }
.form-group-check:hover { border-color: rgba(255,255,255,0.1); }
.form-group-check input[type="checkbox"] { margin-top: 4px; transform: scale(1.2); accent-color: var(--accent2); cursor: pointer; }
.form-group-check label { margin: 0; cursor: pointer; color: var(--text); font-size: 0.95rem; line-height: 1.4; font-weight: normal; }

.question-block { margin-bottom: 30px; }
.question-text { font-size: 1.1rem; font-weight: bold; margin-bottom: 12px; color: #fff; }
.options { display: flex; flex-direction: column; gap: 10px; }
.option-label { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,0.2); padding: 14px 18px; border-radius: 10px; cursor: pointer; border: 1px solid var(--line); transition: all 0.2s ease; font-weight: normal; }
.option-label:hover { border-color: var(--accent2); background: rgba(6,182,212,0.1); }
.option-label input[type="radio"] { accent-color: var(--accent2); transform: scale(1.2); cursor: pointer; }

#quiz-results, #audit-results { display: none; margin-top: 30px; padding: 24px; border-radius: 12px; background: rgba(0,0,0,0.4); border-left: 4px solid var(--accent2); animation: fadeIn 0.5s ease; }
#quiz-results h3, #audit-results h3 { margin-top: 0; color: #fff; }
#quiz-results ul, #audit-results ul { padding-left: 20px; color: var(--muted); margin-bottom: 0; }
#quiz-results li, #audit-results li { margin-bottom: 14px; line-height: 1.6; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Footer */
footer { padding: 34px 0; border-top: 1px solid var(--line); background: rgba(0,0,0,.14); margin-top: 80px; }
.copy { color: var(--muted2); font-weight: 650; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

@media (max-width: 980px) { .grid3, .grid2, .grid4 { grid-template-columns: 1fr; } }

/* --- NEW PHASE 1 UPGRADES: A11y, Duck AI, & Field Reports --- */

/* Accessibility (A11y) Toolbar */
.a11y-bar { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,0.3); padding: 4px 12px; border-radius: 20px; border: 1px solid var(--line); }
.a11y-btn { background: transparent; border: none; color: var(--muted); cursor: pointer; font-weight: bold; font-size: 1rem; padding: 4px 8px; border-radius: 6px; transition: all 0.2s; }
.a11y-btn:hover { color: var(--accent2); background: rgba(255,255,255,0.1); }
.a11y-separator { width: 1px; height: 16px; background: var(--line); }

/* --- HIGH CONTRAST MODE OVERRIDES --- */
body.high-contrast {
  --bg: #000000 !important;
  --text: #ffffff !important;
  --muted: #ffffff !important;
  --muted2: #ffff00 !important;
  --line: #ffffff !important;
  --accent: #ffff00 !important;
  --accent2: #00ffff !important;
  background: #000 !important;
}

/* Hide background animations and gradients in high contrast mode for readability */
body.high-contrast .bg, 
body.high-contrast .bgOverlay, 
body.high-contrast #duckRain,
body.high-contrast .glow-orb {
  display: none !important;
}

/* Ensure cards are visible with borders in high contrast */
body.high-contrast .card {
  background: #000 !important;
  border: 2px solid #fff !important;
  box-shadow: none !important;
}

body.high-contrast .btn {
  background: #000 !important;
  border: 2px solid #ffff00 !important;
  color: #ffff00 !important;
}

/* Floating Duck AI Assistant */
.duck-fab { position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px; background: linear-gradient(135deg, var(--accent), var(--accent2)); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; border: none; box-shadow: 0 10px 25px rgba(6, 182, 212, 0.4); cursor: pointer; z-index: 999; transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.duck-fab:hover { transform: scale(1.1) rotate(-10deg); }
.duck-panel { position: fixed; bottom: 100px; right: 30px; width: 350px; background: rgba(15, 20, 30, 0.95); backdrop-filter: blur(16px); border: 1px solid var(--accent2); border-radius: 20px; box-shadow: 0 20px 50px rgba(0,0,0,0.6); display: flex; flex-direction: column; z-index: 1000; overflow: hidden; transform: translateY(20px); opacity: 0; pointer-events: none; transition: all 0.3s ease; }
.duck-panel.active { transform: translateY(0); opacity: 1; pointer-events: all; }
.duck-head { background: rgba(6, 182, 212, 0.15); padding: 16px 20px; border-bottom: 1px solid var(--accent2); display: flex; justify-content: space-between; align-items: center; font-weight: bold; color: #fff; }
.duck-close { background: transparent; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; line-height: 1; opacity: 0.7; }
.duck-close:hover { opacity: 1; color: var(--danger); }
.duck-chat { padding: 20px; height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { padding: 10px 14px; border-radius: 14px; max-width: 85%; font-size: 0.9rem; line-height: 1.4; white-space: pre-wrap; }
.msg-ai { background: rgba(6, 182, 212, 0.15); border: 1px solid rgba(6, 182, 212, 0.3); align-self: flex-start; color: var(--text); border-bottom-left-radius: 4px; }
.msg-user { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.duck-input-area { padding: 14px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.duck-input-area input { flex: 1; padding: 10px 14px; border-radius: 20px; border: 1px solid var(--line); background: rgba(0,0,0,0.3); color: #fff; outline: none; }
.duck-input-area input:focus { border-color: var(--accent2); }

/* Field Reports / Review Cards */
.review-card { background: rgba(0,0,0,0.3); border: 1px solid var(--line); padding: 16px; border-radius: 12px; margin-bottom: 12px; }
.review-header { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.85rem; color: var(--muted); }
.review-name { font-weight: bold; color: var(--accent2); font-size: 1rem; }

/* --- GLOBAL FALLING DUCK ANIMATION --- */

#duckRain {
  position: fixed;
  inset: 0;
  pointer-events: none; /* Allows users to click buttons/links through the animation */
  overflow: hidden;
  z-index: 1; /* Sits just above the background but behind the main content */
}

.duck {
  position: absolute;
  top: -80px;
  font-size: clamp(18px, 2vw, 28px);
  color: rgba(192, 132, 252, 0.82);
  text-shadow:
    0 0 8px rgba(192, 132, 252, 0.45),
    0 0 16px rgba(124, 58, 237, 0.35),
    0 0 24px rgba(6, 182, 212, 0.18);
  opacity: 0.78;
  user-select: none;
  animation-name: fallDuck;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform;
}

/* Color variations for variety */
.duck:nth-child(3n) { color: rgba(124, 58, 237, 0.85); }
.duck:nth-child(4n) { color: rgba(6, 182, 212, 0.62); }

@keyframes fallDuck {
  0% { transform: translate3d(0, -90px, 0) rotate(0deg); opacity: 0; }
  8% { opacity: 0.85; }
  50% { transform: translate3d(18px, 50vh, 0) rotate(12deg); }
  100% { transform: translate3d(-14px, 110vh, 0) rotate(-10deg); opacity: 0; }
}

/* --- ENSURING TEXT IS READABLE --- */
/* We set main and topbar to z-index 50 so they stay in front of the ducks */
.topbar, main, footer {
  position: relative;
  z-index: 50;
}
/* Ensure backgrounds disappear in High Contrast mode */
body.high-contrast {
  background-color: #000 !important;
  background-image: none !important;
}

body.high-contrast .bg, 
body.high-contrast .bgOverlay, 
body.high-contrast #duckRain {
  display: none !important; /* Hides the ducks and gradients */
}

body.high-contrast .card {
  background: #000 !important;
  border: 2px solid #fff !important;
}
/* --- ENHANCED UPVOTE SYSTEM --- */
.upvote-btn {
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  font-weight: bold;
  margin-top: 15px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.upvote-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(124, 58, 237, 0.4);
}

.upvote-count {
  color: var(--accent2);
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

.upvote-btn:hover .upvote-count {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}
/* --- PROFESSIONAL PRINT OPTIMIZATION --- */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  /* Hide all digital UI elements during printing */
  .bg, .bgOverlay, .topbar, .duck-fab, .duck-panel, footer, .btn, #duckRain {
    display: none !important;
  }

  .container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .card {
    border: 2px solid #000000 !important;
    background: #ffffff !important;
    color: #000000 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    margin-bottom: 20px !important;
  }

  h1, h2, h3, strong, span, p {
    color: #000000 !important;
    text-shadow: none !important;
  }

  .page-header {
    border-bottom: 3px solid #000000 !important;
    margin-bottom: 30px !important;
  }

  /* Specifically for the checklist squares */
  .check-box {
    border: 2px solid #000000 !important;
    background: transparent !important;
  }
}

/* Base styling for checklists in digital mode */
.check-item { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.check-box { 
  width: 20px; 
  height: 20px; 
  border: 2px solid var(--accent2); 
  border-radius: 5px; 
  display: inline-block; 
  flex-shrink: 0; 
  margin-top: 2px; 
}