/* =============================================
   Mack's Dashboard — style.css
   ============================================= */

/* ----- Base ----- */
body {
  font-family: Arial, sans-serif;
  background-color: #000;
  color: #fff;
  text-align: center;
  padding: 20px;
  position: relative;
  min-height: 100vh;
}
#bgCanvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}
body > * {
  position: relative;
  z-index: 1;
}

/* ----- Clock & Date ----- */
#clock {
  font-size: 3em;
  margin-bottom: 10px;
  font-family: 'Courier New', monospace;
}
#date {
  font-size: 1em;
  margin-bottom: 10px;
  color: #aaa;
  font-family: 'Courier New', monospace;
}

/* ----- Weather ----- */
#weather {
  font-size: 1.5em;
  margin-bottom: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
#weather img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

/* ----- Buttons ----- */
.button-group {
  margin: 20px 0;
}
.button-group a {
  display: inline-block;
  margin: 10px;
  padding: 15px 25px;
  background-color: #03EBFF;
  color: #000;
  text-decoration: none;
  border-radius: 12px;
  font-weight: bold;
  transition: transform 0.1s, filter 0.2s;
  position: relative;
}
.button-group a:hover {
  transform: scale(1.1);
  filter: brightness(0.85);
}
.button-group a .kbd {
  display: inline-block;
  font-size: 0.65em;
  background: rgba(0,0,0,0.25);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: middle;
}
.button-group a[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.75em;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}

/* ----- Button colors — Personal ----- */
a.btn-files      { background-color: #03EBFF; }
a.btn-youtube    { background-color: #FF0000; color: #fff; }
a.btn-whatsapp   { background-color: #25D366; }
a.btn-duolingo   { background-color: #58CC02; }
a.btn-deezer     { background-color: #A238FF; color: #fff; }
a.btn-3cx        { background-color: #0070C0; color: #fff; }

/* ----- Button colors — A.I. ----- */
a.btn-claude     { background-color: #CC785C; color: #fff; }
a.btn-chatgpt    { background-color: #FFFFFF; color: #000; }
a.btn-gemini     { background-color: #4285F4; color: #fff; }
a.btn-cai        { background-color: #888888; color: #fff; }

/* ----- Button colors — Home Lab ----- */
a.btn-pihole     { background-color: #F60D1A; color: #fff; }
a.btn-nodered-e  { background-color: #8F0000; color: #fff; }
a.btn-nodered-d  { background-color: #8F0000; color: #fff; }
a.btn-piconnect  { background-color: #C51A4A; color: #fff; }
a.btn-cloudflare { background-color: #F6821F; color: #fff; }

/* ----- Button colors — School ----- */
a.btn-learnbeat  { background-color: #00A878; color: #fff; }
a.btn-gmail      { background-color: #ffffff; color: #000; }
a.btn-magister   { background-color: #003082; color: #fff; }
a.btn-musicbox   { background-color: #FF69B4; }

/* ----- Button colors — Custom ----- */
a.btn-custom-converttoit  { background-color: #990000; color: #fff; }
a.btn-custom-files        { background-color: #03EBFF; color: #000; }
a.btn-custom-mackthehunt  { background-color: #03EBFF; color: #000; }
a.btn-custom-skribbl      { background-color: #03EBFF; color: #000; }

/* ----- AI badge tooltip ----- */
.ai-badge {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  border: 1px solid #03EBFF;
  color: #03EBFF;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.7em;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}
.button-group a:hover .ai-badge { display: block; }

/* ----- Top layout ----- */
#top-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 20px;
  margin: 10px auto 10px;
  max-width: 900px;
  flex-wrap: wrap;
}
#top-layout #mack-section {
  margin: 0;
  flex: 1;
  min-width: 280px;
}
#clock-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
#welcome-bar {
  font-size: 0.8em;
  color: #555;
  font-family: 'Courier New', monospace;
  margin-bottom: 4px;
}

/* ----- Mack panel ----- */
#mack-section {
  display: none;
  background: linear-gradient(135deg, #0a0a1a, #0f0f2a);
  border: 1px solid #03EBFF;
  border-radius: 16px;
  padding: 16px 20px;
  margin: 10px auto 20px;
  max-width: 700px;
  text-align: left;
  box-shadow: 0 0 20px rgba(3,235,255,0.08);
}
#mack-section h3 { color: #03EBFF; margin: 0 0 12px; font-size: 0.95em; letter-spacing: 1px; font-family: 'Courier New', monospace; }
#mack-section .mack-links { display: flex; flex-wrap: wrap; gap: 8px; }
#mack-section .mack-links a {
  padding: 8px 14px;
  border-radius: 10px;
  background: #003082;
  color: #fff;
  text-decoration: none;
  font-size: 0.85em;
  font-weight: bold;
  transition: background 0.2s, transform 0.1s;
}
#mack-section .mack-links a:hover { background: #03EBFF; color: #000; transform: scale(1.05); }

/* ----- School mode ----- */
#school-mode-bar {
  display: none;
  background: #003082;
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 0.9em;
}
#school-mode-bar.visible { display: block; }
#school-panel {
  display: none;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  margin: 10px auto 20px;
  max-width: 800px;
  flex-wrap: wrap;
}
#school-panel.visible { display: flex; }
#school-info {
  background: #1a1a2e;
  border: 1px solid #003082;
  border-radius: 12px;
  padding: 20px;
  min-width: 200px;
  text-align: center;
  flex: 1;
}
#school-info #school-clock {
  font-size: 2.5em;
  font-family: 'Courier New', monospace;
  color: #03EBFF;
}
#school-info #school-date {
  font-size: 0.9em;
  color: #aaa;
  font-family: 'Courier New', monospace;
  margin-bottom: 10px;
}
#school-info #school-weather {
  font-size: 1em;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
#school-info #school-weather img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

/* ----- Homework box ----- */
#homework-box {
  display: none;
  background: #1a1a2e;
  border: 1px solid #003082;
  border-radius: 12px;
  padding: 15px 20px;
  flex: 2;
  min-width: 260px;
  text-align: left;
}
#homework-box.visible { display: block; }
#homework-box h3 { margin: 0 0 10px; color: #03EBFF; font-size: 1em; }
#homework-input {
  width: calc(100% - 80px);
  padding: 8px;
  border-radius: 8px;
  border: none;
  background: #2a2a3e;
  color: #fff;
  font-size: 0.9em;
}
#homework-add {
  padding: 8px 12px;
  margin-left: 6px;
  border-radius: 8px;
  border: none;
  background: #03EBFF;
  color: #000;
  font-weight: bold;
  cursor: pointer;
}
#homework-list { list-style: none; padding: 0; margin: 10px 0 0; }
#homework-list li {
  padding: 6px 0;
  border-bottom: 1px solid #2a2a3e;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9em;
}
#homework-list li span { cursor: pointer; color: #f66; font-size: 1.1em; }

/* ----- School toggle button ----- */
#school-toggle {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 100;
  padding: 8px 16px;
  border-radius: 20px;
  border: none;
  background: #003082;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.85em;
  transition: background 0.2s;
}
#school-toggle.active { background: #03EBFF; color: #000; }

/* ----- Storage widget ----- */
#storage-widget, #school-storage-widget {
  background: #1a1a2e;
  border: 1px solid #003082;
  border-radius: 12px;
  padding: 15px 20px;
  margin: 10px auto 20px;
  max-width: 600px;
  text-align: left;
}
#school-storage-widget { display: none; }
body.school-active #school-storage-widget { display: block; }
body.school-active #storage-widget { display: none; }
body.school-active #clock,
body.school-active #date,
body.school-active #weather { display: none; }

.storage-bar-bg {
  background: #2a2a3e;
  border-radius: 8px;
  height: 12px;
  margin: 8px 0;
  overflow: hidden;
}
.storage-bar-fill {
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, #03EBFF, #003082);
  transition: width 0.5s ease;
}
.storage-bar-fill.warn { background: linear-gradient(90deg, #f6821f, #f60d1a); }
.storage-label {
  font-size: 0.8em;
  color: #aaa;
  display: flex;
  justify-content: space-between;
}
.recent-files { list-style: none; padding: 0; margin: 10px 0 0; }
.recent-files li {
  font-size: 0.8em;
  padding: 4px 0;
  border-bottom: 1px solid #2a2a3e;
  color: #ccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-files li:last-child { border-bottom: none; }
.view-all-btn {
  margin-top: 8px;
  padding: 5px 12px;
  border-radius: 8px;
  border: none;
  background: #03EBFF;
  color: #000;
  font-weight: bold;
  font-size: 0.8em;
  cursor: pointer;
}
.all-files { display: none; }
.all-files.visible { display: block; }

/* ----- Add Button FAB ----- */
#add-btn-fab {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #03EBFF;
  color: #000;
  font-size: 1.6em;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(3,235,255,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
#add-btn-fab:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(3,235,255,0.6); }

/* ----- Add Button Modal ----- */
#add-btn-modal {
  display: none;
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 200;
  background: #1a1a2e;
  border: 1px solid #03EBFF;
  border-radius: 16px;
  padding: 20px;
  width: 300px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
#add-btn-modal.visible { display: block; }
#add-btn-modal h3 { color: #03EBFF; margin: 0 0 14px; font-size: 1em; }
#add-btn-modal input, #add-btn-modal select {
  width: 100%;
  padding: 8px;
  margin-bottom: 8px;
  border-radius: 8px;
  border: 1px solid #003082;
  background: #0f0f1a;
  color: #fff;
  font-size: 0.85em;
  box-sizing: border-box;
}
#add-btn-modal .color-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
#add-btn-modal .color-row input[type=color] { width: 40px; height: 34px; padding: 2px; border-radius: 6px; cursor: pointer; flex-shrink: 0; }
#add-btn-modal .color-row input[type=text] { flex: 1; margin-bottom: 0; }
#add-btn-preview {
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: bold;
  font-size: 0.85em;
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
#add-btn-preview img { width: 18px; height: 18px; object-fit: contain; }
.modal-btns { display: flex; gap: 8px; }
.modal-btns button { flex: 1; padding: 8px; border-radius: 8px; border: none; font-weight: bold; cursor: pointer; font-size: 0.85em; }
#add-btn-submit { background: #03EBFF; color: #000; }
#add-btn-cancel { background: #333; color: #fff; }
#add-btn-msg { font-size: 0.8em; margin-top: 8px; text-align: center; }
