/* sty */
/* === GLOBAL === */
html {
  box-sizing: border-box;
  width: 100vw;
  overflow-x: hidden;
}

body {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background-color: #0d1117;
  color: #ffffff;
  margin: 0;
  padding: 8px;
  line-height: 1.5;
  font-size: 1.08em;
  -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

/* Add a container for content width control */
.main-container {
  max-width: 900px;
  margin: auto;
  background: transparent;
}

button, .about-btn, select, label, .node {
  min-width: 44px;
  min-height: 44px;
  font-size: 1em;
  touch-action: manipulation;
}

input[type="checkbox"], input[type="file"] {
  min-width: 24px;
  min-height: 24px;
}

h1 {
  text-align: center;
  color: #4CAF50;
  font-size: 28px;
  margin-bottom: 20px;
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

/* === CONTROLS BAR === */
#controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
  gap: 10px;
}

#controls button, 
#controls label {
  background: #222;
  color: #fff;
  border: 1px solid #555;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s, transform 0.2s;
}

#controls button:hover {
  background: #333;
  transform: scale(1.05);
}

select {
  background: #111;
  color: #fff;
  border: 1px solid #555;
  padding: 5px;
  margin-top: 5px;
  border-radius: 4px;
  min-width: 44px;
  min-height: 44px;
  font-size: 1em;
  touch-action: manipulation;
}

/* === COMPLETION TRACKER === */
#completion-tracker {
  text-align: center;
  margin-bottom: 15px;
  font-size: 16px;
  color: #fff;
}

/* === PROGRESS DONUT === */
#progress-donut {
  display: block;
  margin: 20px auto;
  max-width: 250px;
}

/* === XP BAR === */
#xp-bar {
  text-align: center;
  margin-bottom: 20px;
  background: #222;
  border: 1px solid #555;
  border-radius: 6px;
  padding: 10px;
  font-size: 14px;
}

#xp-bar div:first-child {
  margin-bottom: 5px;
  font-weight: bold;
  color: #ffd700;
}

/* XP Progress Bar Container */
#xp-bar div:nth-child(2) {
  position: relative;
  background: #444;
  width: 100%;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
}

/* XP Fill Animation */
#xp-bar div:nth-child(2) div {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, #4CAF50, #00ff88);
  width: 0;
  animation: fillXP 1s forwards;
}

/* XP Fill Keyframe */
@keyframes fillXP {
  from { width: 0; }
  to { width: 100%; }
}

/* === MINDMAP TREE === */
#mindmap-container {
  margin-top: 20px;
  padding-left: 10px;
}

/* Node Base */
.node {
  background: #444;
  padding: 8px 12px;
  border-radius: 6px;
  margin: 5px 0;
  cursor: pointer;
  color: #fff;
  display: inline-block;
  min-width: 120px;
  transition: transform 0.2s, box-shadow 0.3s;
}

.node:hover {
  transform: scale(1.03);
  box-shadow: 0 0 10px rgba(255,255,255,0.2);
}

/* Learning Node - Yellow Pulsing */
.node.learning {
  border: 2px dashed yellow;
  animation: pulseLearning 1.2s infinite;
}

@keyframes pulseLearning {
  0% { box-shadow: 0 0 5px yellow; }
  50% { box-shadow: 0 0 15px yellow; }
  100% { box-shadow: 0 0 5px yellow; }
}

/* Completed Node - Green Glow */
.node.completed {
  border: 2px solid #4CAF50;
  animation: glowCompleted 1.5s infinite;
}

@keyframes glowCompleted {
  0% { box-shadow: 0 0 5px #4CAF50; }
  50% { box-shadow: 0 0 15px #00ff88; }
  100% { box-shadow: 0 0 5px #4CAF50; }
}

/* Children Container */
.children {
  display: none;
  margin-left: 25px;
  margin-top: 5px;
  border-left: 1px dashed #555;
  padding-left: 10px;
}

.children.visible {
  display: block;
}

/* Notes Area */
textarea {
  font-family: inherit;
  font-size: 13px;
  background: #111;
  color: #fff;
  border: 1px solid #333;
  border-radius: 4px;
  width: 95%;
  margin-top: 8px;
  padding: 5px;
}

/* Install Banner */
#install-banner {
  display:none;
  position:fixed;
  bottom:20px;
  left:50%;
  transform:translateX(-50%);
  background:#222;
  padding:10px 20px;
  border-radius:10px;
  color:white;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

#install-banner button {
  margin-left: 10px;
  background: #4CAF50;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  color: #fff;
}

/* About Button */
.about-btn {
  display: inline-block;
  background: #2196F3;
  color: #fff !important;
  padding: 8px 18px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.05em;
  box-shadow: 0 2px 8px rgba(33,150,243,0.12);
  transition: background 0.2s;
  min-width: 44px;
  min-height: 44px;
}

.about-btn:hover, .about-btn:focus {
  background: #1769aa;
  text-decoration: underline;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
  .main-container {
    max-width: 100vw;
  }
  body {
    font-size: 1em;
    padding: 4px;
  }
  #controls {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  .about-btn {
    width: 100%;
    text-align: center;
    font-size: 1.1em;
    padding: 12px 0;
  }
  canvas, #mindmap-container {
    max-width: 100%;
  }
  h1 {
    font-size: 1.4em;
  }
}

/* Prevent horizontal scroll on mobile */
body, html {
  overflow-x: hidden;
}
