/* === Reset === */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* === Colors & Vars == */
:root {
  --bg: #0b0c10;
  --panel: rgba(255,255,255,0.05);
  --text: #f1f3f8;
  --muted: #8a8f9e;
  --accent: #5865f2;
  --notch-gap: 0.4rem;
  --notch-height: 54px;   /* matches .notch-bar height */
  --notch-left: 1.5rem;   /* matches .notch-bar side padding */
  --home-top: 8px;        /* where the Home button visually sits */
}

/* === Base === */
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* When settings are open, blur background */
body.blur-bg {
  filter: blur(8px) brightness(0.9);
  transition: filter 0.3s;
}
/* ensure popup isn't blurred when body gets blur */
body.blur-bg #settings-popup { filter: none !important; }

/* === Floating Sidebar === */
.floating-sidebar {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.8rem;
  border-radius: 16px;
  background: rgba(20, 20, 25, 0.6);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 1000;
}

.floating-sidebar .icon {
  font-size: 1.4rem;
  text-align: center;
  color: #ccc;
  padding: 0.7rem;
  border-radius: 12px;
  transition: all .25s ease;
}
.floating-sidebar .icon:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.floating-sidebar .icon.active {
  background: var(--accent);
  color: #fff;
}

/* === Notch Bar === */
.notch-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 54px;
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: var(--notch-gap);
  background: rgba(20, 20, 25, 0.6);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  z-index: 2001;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  padding: 0 1.5rem;
}

/* Hide only the notch contents (not the whole bar) when toggled */
.notch-bar.hide-content .notch-url-link,
.notch-bar.hide-content .notch-btn {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s, visibility 0.4s;
}

/* Completely hide the notch bar */
.notch-bar.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s, visibility 0.4s;
}

.notch-bar .home-btn,
.notch-bar #fullscreen-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(88,101,242,0.12);
  color: var(--accent);
  transition: background .2s;
  margin-right: 0.5rem;
  border: none;
  text-decoration: none;
  cursor: pointer;
}
.notch-bar .home-btn:hover,
.notch-bar #fullscreen-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* URL pill inside notch */
.notch-url-link {
  flex: 1;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: none;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-size: 1.1rem;
  font-family: inherit;
  outline: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-left: 0.5rem;
  text-decoration: none;
  word-break: break-all;
  transition: background .2s, color .2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notch-url-link:hover {
  background: var(--accent);
  color: #fff;
}

/* Floating toggle button that lives under Home by default */
.notch-toggle-btn {
  position: fixed;                   /* keep it aligned regardless of scroll */
  left: var(--notch-left);
  top: calc(var(--notch-height) + 8px);  /* sits just below the notch bar */
  z-index: 2002;

  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: rgba(88,101,242,0.12);
  color: var(--accent);
  cursor: pointer;

  backdrop-filter: blur(8px) saturate(160%);
  -webkit-backdrop-filter: blur(8px) saturate(160%);
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);

  transition: top .4s ease, opacity .25s ease, background .2s ease;
}

.notch-bar.hidden ~ .notch-toggle-btn {
  top: 8px;
}
/* Hover feel */
.notch-toggle-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* === Main content === */
.main {
  min-height: calc(100vh - 54px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 100vw;
  height: calc(100vh - 54px);
}

.centered {
  max-width: 500px;
  margin: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  background: linear-gradient(90deg, var(--accent), #9b6bfe);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* === Search box === */
.search-box {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  border: 1px solid rgba(255,255,255,0.1);
  background: var(--panel);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 25px rgba(0,0,0,0.4);
  transition: box-shadow .3s ease;
}
.search-box:focus-within {
  box-shadow: 0 8px 32px rgba(88,101,242,0.5);
  border-color: var(--accent);
}
.search-box input {
  flex: 1;
  padding: 1rem;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1rem;
  outline: none;
}
.search-box button {
  background: var(--accent);
  border: none;
  padding: 1rem 1.5rem;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.search-box button:hover { background: #4752c4; }

/* Output hint text */
#output {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Notch search input inside bar (if used) */
.notch-bar input#sj-address {
  flex: 1;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: none;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-size: 1.1rem;
  font-family: inherit;
  outline: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-left: 0.5rem;
  min-width: 120px;
  max-width: 350px;
  transition: background .2s, color .2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notch-bar input#sj-address:focus {
  background: var(--accent);
  color: #fff;
}

/* === Settings Modal === */
#settings-popup {
  min-width: 540px;
  min-height: 480px;
  padding: 3.5rem 2.5rem;
  background: rgba(30,30,40,0.90);
  backdrop-filter: blur(18px) saturate(180%);
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  z-index: 3000;
  transition: opacity 0.4s;
  opacity: 1;
}

/* === Spinner === */
@keyframes sj-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
