/* ===============================================
   COMP3421 — Lab 7: Tooltips & Progress Animations
   Student practice template.
   =============================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

:root {
  --space: 8px;
  --radius: 12px;
  --border: 1px;

  --text: #0f172a;
  --muted: #475569;
  --bg-page: #f8fafc;

  --accent: #2563eb;
  --accent-2: #60a5fa;

  --btn-bg: #111827;
  --btn-text: #ffffff;
  --btn-glow: rgba(37, 99, 235, 0.45);
}

/* Base styles for lab container */
.lab-container {
  width: min(1100px, 92vw);
  margin-inline: auto;
  padding-inline: calc(var(--space) * 2);
}

.section {
  margin-block: calc(var(--space) * 3);
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  margin: 0 0 calc(var(--space) * 1.25);
}

p {
  margin: 0 0 calc(var(--space) * 1.25);
  color: var(--muted);
}

.site-header,
.site-footer {
  padding-block: calc(var(--space) * 2.5);
  text-align: center;
}

/* Overview and Objectives sections */
.overview-section .card {
  background: linear-gradient(135deg, #dbeafe 0%, #f0f9ff 100%);
  border-left: 4px solid var(--accent);
}

.objectives-section .card {
  background: linear-gradient(135deg, #dcfce7 0%, #f0fdf4 100%);
  border-left: 4px solid #22c55e;
}

.objectives-section ul {
  margin-left: 20px;
}

.objectives-section li {
  margin: calc(var(--space) * 1) 0;
}

.submission-section .card {
  background: linear-gradient(135deg, #fef3c7 0%, #fef9e7 100%);
  border-left: 4px solid #f59e0b;
}

.submission-section ul {
  margin-left: 20px;
}

.submission-section li {
  margin: calc(var(--space) * 1) 0;
}

/* Questions section */
.questions-section .question-card {
  background: linear-gradient(135deg, #e0e7ff 0%, #f5f3ff 100%);
  border-left: 4px solid #6366f1;
}

.question-item {
  margin-top: calc(var(--space) * 3);
}

.question-item:first-of-type {
  margin-top: calc(var(--space) * 2);
}

.question-item h3 {
  color: var(--text);
  margin-bottom: calc(var(--space) * 1);
}

.answer-area {
  margin-top: calc(var(--space) * 2);
  padding: calc(var(--space) * 2);
  background: #f8fafc;
  border-radius: 8px;
  border: 2px dashed #cbd5e1;
}

.answer-area h4 {
  color: #475569;
  font-size: 0.95rem;
  margin-bottom: calc(var(--space) * 1.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.answer-box {
  min-height: 120px;
  padding: calc(var(--space) * 2);
  background: white;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.answer-box p {
  margin: 0;
  color: #94a3b8;
  line-height: 1.8;
}

.answer-box p em {
  font-style: italic;
}

.card {
  padding: calc(var(--space) * 3);
  border-radius: var(--radius);
  background: #fff;
  border: var(--border) solid #e5e7eb;
  box-shadow: 0 6px 14px rgba(2, 6, 23, 0.06);
}

.card+.card {
  margin-top: calc(var(--space) * 2);
}

/* Screenshot link styling */
.screenshot-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.screenshot-link:hover {
  color: var(--accent-2);
  text-decoration: underline;
}

/* Base body styling */
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  color: var(--text);
  background: var(--bg-page);
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===============================================
   TASK 1: Icon Buttons with Animated Tooltip Badges
   =============================================== */

/* Part A: Tooltip Container Setup (Steps 1-4) */
.tooltip-icons {
  /* TODO: Set display to flex */
  /* TODO: Set justify-content to center */
  /* TODO: Set gap to 40px */
  /* TODO: Set padding to 80px 0 */
  display: flex;
  justify-self: center;
  gap: 40px;
  padding: 80px;
}

/* Part B: Icon Button Base Styling (Steps 5-14) */
.icon-btn {
  /* TODO: Set position to relative */
  /* TODO: Set width to 60px */
  /* TODO: Set height to 60px */
  /* TODO: Set background to linear-gradient(135deg, #667eea 0%, #764ba2 100%) */
  /* TODO: Set border-radius to 50% */
  /* TODO: Set display to flex */
  /* TODO: Set align-items to center */
  /* TODO: Set justify-content to center */
  /* TODO: Set cursor to pointer */
  /* TODO: Set transition to transform 0.3s ease */
  position: relative;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.3s ease;
}

/* Part C: Icon Button Hover Effect (Steps 15-17) */
.icon-btn:hover {
  /* TODO: Set transform to translateY(-5px) */
  transform: translateY(-5px);
}

.icon-btn i {
  /* TODO: Set font-size to 24px */
  /* TODO: Set color to #fff */
  font-size: 24px;
  color: #fff;
}

/* Part D: Notification Badge Styling (Steps 18-31) */
.badge {
  /* TODO: Set position to absolute */
  /* TODO: Set top to -5px */
  /* TODO: Set right to -5px */
  /* TODO: Set width to 22px */
  /* TODO: Set height to 22px */
  /* TODO: Set background to #ff4757 */
  /* TODO: Set border-radius to 50% */
  /* TODO: Set color to #fff */
  /* TODO: Set font-size to 11px */
  /* TODO: Set font-weight to 700 */
  /* TODO: Set display to flex */
  /* TODO: Set align-items to center */
  /* TODO: Set justify-content to center */
  /* TODO: Set animation to pulse 2s infinite */
  position: absolute;
  top: -5px;
  right: -5px;
  width: 22px;
  height: 22px;
  background: #ff4757;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s infinite;
}

/* Part E: Pulse Animation (Steps 32-34) */
@keyframes pulse {
  /* TODO: At 0%, set box-shadow to 0 0 0 0 rgba(255, 71, 87, 0.7) */
  0%{
    box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7);
  }
  /* TODO: At 70%, set box-shadow to 0 0 0 10px rgba(255, 71, 87, 0) */
  70%{
    box-shadow: 0 0 0 10px rgba(255, 71, 87, 0);
  }
  /* TODO: At 100%, set box-shadow to 0 0 0 0 rgba(255, 71, 87, 0) */
  100%{
    box-shadow: 0 0 0 0 rgba(255, 71, 87, 0);
  }
}

/* Part F: Tooltip Base Styling (Steps 35-48) */
.icon-btn::before {
  /* TODO: Set content to attr(data-tooltip) */
  /* TODO: Set position to absolute */
  /* TODO: Set bottom to 100% */
  /* TODO: Set left to 50% */
  /* TODO: Set transform to translateX(-50%) translateY(-10px) */
  /* TODO: Set background to #2d3748 */
  /* TODO: Set color to #fff */
  /* TODO: Set padding to 8px 12px */
  /* TODO: Set border-radius to 6px */
  /* TODO: Set font-size to 13px */
  /* TODO: Set white-space to nowrap */
  /* TODO: Set opacity to 0 */
  /* TODO: Set pointer-events to none */
  /* TODO: Set transition to all 0.3s ease */
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: #2d3748;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

/* Part G: Tooltip Arrow (Steps 49-58) */
.icon-btn::after {
  /* TODO: Set content to "" */
  /* TODO: Set position to absolute */
  /* TODO: Set bottom to 100% */
  /* TODO: Set left to 50% */
  /* TODO: Set transform to translateX(-50%) */
  /* TODO: Set border-width to 6px */
  /* TODO: Set border-style to solid */
  /* TODO: Set border-color to #2d3748 transparent transparent transparent */
  /* TODO: Set opacity to 0 */
  /* TODO: Set transition to all 0.3s ease */
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #2d3748 transparent transparent transparent;
  opacity: 0;
  transition: all 0.3s ease;
}

/* Part H: Show Tooltip on Hover (Steps 59-61) */
.icon-btn:hover::before {
  /* TODO: Set opacity to 1 */
  /* TODO: Set transform to translateX(-50%) translateY(-15px) */
  opacity: 1;
  transform: translateX(-50) translateY(-15px);
}

.icon-btn:hover::after {
  /* TODO: Set opacity to 1 */
  opacity: 1;
}

/* Wrapper with dark background */
.tooltip-wrapper {
  background: #0f0f23;
  border-radius: 12px;
  margin: calc(var(--space) * 3) 0;
}

/* ===============================================
   TASK 2: Animated Skill Progress Bars
   =============================================== */

/* Part A: Skills Container Setup (Steps 1-3) */
.skills-container {
  /* TODO: Set max-width to 600px */
  /* TODO: Set margin to 0 auto */
  /* TODO: Set padding to 60px 40px */
  max-width: 600px;
  margin: 0 auto;
  padding: 60px 40px;
}

/* Part B: Skill Item Layout (Step 4) */
.skill-item {
  /* TODO: Set margin-bottom to 35px */
  margin-bottom: 35px;  
}

/* Part C: Skill Header Styling (Steps 5-8) */
.skill-header {
  /* TODO: Set display to flex */
  /* TODO: Set justify-content to space-between */
  /* TODO: Set align-items to center */
  /* TODO: Set margin-bottom to 12px */
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

/* Part D: Skill Name and Icon (Steps 9-16) */
.skill-name {
  /* TODO: Set display to flex */
  /* TODO: Set align-items to center */
  /* TODO: Set gap to 10px */
  /* TODO: Set font-size to 16px */
  /* TODO: Set font-weight to 600 */
  /* TODO: Set color to #2d3748 */
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: #2d3748;
}

.skill-name i {
  /* TODO: Set font-size to 20px */
  /* TODO: Set color to #667eea */
  font-size: 20px;
  color: #667eea;
}

/* Part E: Skill Percentage Display (Steps 17-19) */
.skill-percent {
  /* TODO: Set font-size to 14px */
  /* TODO: Set font-weight to 700 */
  /* TODO: Set color to #667eea */
  font-size: 14px;
  font-weight: 700;
  color: #667eea;
}

/* Part F: Progress Bar Background (Steps 20-25) */
.progress-bar {
  /* TODO: Set position to relative */
  /* TODO: Set width to 100% */
  /* TODO: Set height to 12px */
  /* TODO: Set background to #e2e8f0 */
  /* TODO: Set border-radius to 10px */
  /* TODO: Set overflow to hidden */
  position: relative;
  width: 100%;
  height: 12px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}

/* Part G: Progress Fill Animation (Steps 26-31) */
.progress-fill {
  /* TODO: Set height to 100% */
  /* TODO: Set width to 0 */
  /* TODO: Set background to linear-gradient(90deg, #667eea 0%, #764ba2 100%) */
  /* TODO: Set border-radius to 10px */
  /* TODO: Set transition to width 1.5s ease */
  /* TODO: Set position to relative */
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
  transition: width 1.5s ease;
  position: relative;
}

/* Part H: Progress Fill Glow Effect (Steps 32-39) */
.progress-fill::after {
  /* TODO: Set content to "" */
  /* TODO: Set position to absolute */
  /* TODO: Set top to 0 */
  /* TODO: Set left to 0 */
  /* TODO: Set width to 100% */
  /* TODO: Set height to 100% */
  /* TODO: Set background to linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent) */
  /* TODO: Set animation to shimmer 2s infinite */
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

/* Part I: Shimmer Animation (Steps 40-41) */
@keyframes shimmer {
  /* TODO: At 0%, set transform to translateX(-100%) */
  0%{
    transform: translateX(-100%);
  }
  /* TODO: At 100%, set transform to translateX(100%) */
  100%{
    transform: translateX(100%);
  }
}

/* Part J: Trigger Animation on Hover (Step 42) */
.skills-container:hover .progress-fill {
  /* TODO: Set width to var(--progress) */
  width: var(--progress);
}

/* Wrapper with background */
.skills-wrapper {
  background: #f9fafb;
  border-radius: 12px;
  margin: calc(var(--space) * 3) 0;
}
