/* Shared theme variables + toggle dropdown styling, used by all MouseUtil pages */

:root,
[data-theme="dark"]{
  --bg: #191919;
  --text: #f5f5f4;
  --text-secondary: #d4d4d1;
  --muted: #9a9a97;
  --border: #2c2c29;
  --green: #4fae63;
  --green-btn: #2fd66b;
  --card: #1f1f1e;
  --blue: #5b9bd5;
  --amber: #d9a441;
  --purple: #9d7be0;
  --green-bg: #1f3327;
  --green-border: #2f4a35;
  --latest: #6fbf7f;
  --latest-text: #dbe9dd;
  --hover-bg: #262624;
  --hover-border: #3a3a37;
  --shadow: rgba(0,0,0,0.45);
  --icon-accent: #6fb3ee;
}

[data-theme="light"]{
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #40403c;
  --muted: #6b6b68;
  --border: #e3e3e0;
  --green: #2f9e4f;
  --green-btn: #22b455;
  --card: #f5f5f4;
  --blue: #2f6fb0;
  --amber: #a5730a;
  --purple: #7c5cbf;
  --green-bg: #eaf7ee;
  --green-border: #bfe6ca;
  --latest: #2f9e4f;
  --latest-text: #1f4a2c;
  --hover-bg: #eeeeec;
  --hover-border: #d3d3cf;
  --shadow: rgba(0,0,0,0.12);
  --icon-accent: #2f6fb0;
}

body{
  transition: background .2s ease, color .2s ease;
}

.top-bar{
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1000;
}

.breadcrumb{
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

.breadcrumb-link{
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  text-decoration: none;
}

.breadcrumb-link:hover{
  color: var(--muted);
}

.breadcrumb-logo{
  width: 18px;
  height: 18px;
  display: block;
}

.breadcrumb-sep{
  color: var(--muted);
}

.breadcrumb-current{
  color: var(--muted);
}

.theme-switcher{
  position: relative;
}

.icon-btn{
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .1s ease;
}
.icon-btn:hover{
  border-color: var(--icon-accent);
}
.icon-btn svg{
  width: 18px;
  height: 18px;
  display: block;
}

/* GitHub link button: the whole button fills solid with the accent color on
   hover (it navigates away in a new tab). The icon switches to --bg so it
   stays legible against the accent fill: dark in dark mode (light blue bg),
   light in light mode (darker blue bg) — always high-contrast either way. */
.top-bar > a.icon-btn:hover{
  background: var(--icon-accent);
  border-color: var(--icon-accent);
  color: var(--bg);
}

/* Theme toggle button: tinted background on hover/active, matching the
   download button's interaction style but with the blue accent color, and
   the icon itself turns accent-blue too — signaling this is an in-page
   dropdown rather than a navigating link. */
#theme-toggle:hover{
  border-color: var(--icon-accent);
  background: linear-gradient(color-mix(in srgb, var(--icon-accent) 15%, transparent), color-mix(in srgb, var(--icon-accent) 15%, transparent)), var(--card);
  color: var(--icon-accent);
}
#theme-toggle:active{
  border-color: var(--icon-accent);
  background: linear-gradient(color-mix(in srgb, var(--icon-accent) 28%, transparent), color-mix(in srgb, var(--icon-accent) 28%, transparent)), var(--card);
  color: var(--icon-accent);
}

#theme-toggle .theme-icon{
  display: flex;
  align-items: center;
  justify-content: center;
}
#theme-toggle .theme-icon svg{
  width: 18px;
  height: 18px;
  display: block;
}

.theme-menu{
  position: absolute;
  top: 0;
  right: 100%;
  margin-right: 8px;
  min-width: 150px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 10px 28px var(--shadow);
}
.theme-menu.open{
  display: flex;
}

.theme-option{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.theme-option:hover{
  background: var(--hover-bg);
}
.theme-option svg{
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.theme-option.active{
  color: var(--icon-accent);
}

.page-footer{
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 48px;
  padding-bottom: 48px;
}

/* ============ FOOTER (shared across all pages) ============ */
.site-footer{
  border-top: 1px solid var(--border);
  padding: 44px 0 40px;
}
.footer-inner{
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}
.footer-row{
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
}
.footer-brand{
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  color: var(--text);
}
.footer-brand img{ width: 24px; height: 24px; }
.footer-links{
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.footer-links a{
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-secondary);
}
.footer-links a:hover{ color: var(--text); }
.footer-bottom{
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.footer-bottom a{ color: var(--muted); text-decoration: none; }
.footer-bottom a:hover{ color: var(--text-secondary); }
@media (max-width:600px){
  .footer-row{ flex-direction: column; align-items: flex-start; }
  .footer-links{
    flex-wrap: nowrap;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
  }
  .footer-links a{ font-size: 13px; }
}

@media (max-width:600px){
  .top-bar{
    top: 14px;
    right: 14px;
    gap: 8px;
  }
  .icon-btn{
    width: 36px;
    height: 36px;
    border-radius: 9px;
  }
  .icon-btn svg{
    width: 16px;
    height: 16px;
  }
  .theme-menu{
    margin-right: 6px;
  }
  .breadcrumb{
    top: 14px;
    left: 14px;
    padding: 8px 10px;
    font-size: 13px;
  }
  .breadcrumb-logo{
    width: 16px;
    height: 16px;
  }
}
