:root {
  --theme-50: #f5f4fd;
  --theme-100: #e8e6fa;
  --theme-600: #5046e5;
  --theme-900: #1a174a;
  --blur: 10px;
}

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

body {
  font-family: "Funnel Display", sans-serif;
  background: radial-gradient(ellipse at 50% 50%, var(--theme-100) 0%, var(--theme-50) 100%);
  color: var(--theme-900);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: background 0.4s, color 0.4s;
}

/* ---------- Glassmorphism Helpers ---------- */
.glass {
  background: rgba(255 255 255 / .55);
  border: 1px solid rgba(255 255 255 / .65);
  border-radius: 24px;
  backdrop-filter: blur(var(--blur)) saturate(1.2);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.2);
  box-shadow: 0 8px 32px rgba(80 70 229 / .25);
}

/* ---------- Header ---------- */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 20px 5vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--theme-900);
}

a {
    text-decoration: none;
    color: inherit;
}


.logo svg {
  width: 36px;
  height: 36px;
}
.logo svg path {
    fill: var(--theme-600);
}

/* ---------- Main Content ---------- */
.container {
  width: 90%;
  max-width: 600px;
  text-align: center;
}

.card {
  padding: 40px;
  position: relative;
}

h1 {
  font-size: clamp(2rem, 6vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--theme-900) 0%, var(--theme-600) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

.subtitle {
  margin-bottom: 2rem;
  font-size: 1.1rem;
  opacity: .7;
}

.input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 2rem;
}

#urlInput {
  flex-grow: 1;
  padding: 12px 15px;
  border-radius: 50px;
  border: 1px solid transparent;
  background-color: rgba(255,255,255,0.5);
  color: var(--theme-900);
  font-size: 1rem;
  font-family: inherit;
}
#urlInput:focus {
    outline: none;
    border-color: var(--theme-600);
}

#checkButton {
  padding: 12px 28px;
  border-radius: 50px;
  border: none;
  background: var(--theme-900);
  color: var(--theme-50);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s;
}
#checkButton:hover {
  background: var(--theme-600);
}

/* ---------- Results ---------- */
.results-container {
  text-align: left;
  margin-top: 2rem;
  background: rgba(0,0,0,0.05);
  border-radius: 12px;
  padding: 10px 0;
  overflow: hidden;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
}

.result-item:not(:last-child) {
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.label {
  font-weight: 600;
  opacity: 0.8;
}

.value-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.value {
  font-family: monospace;
  word-break: break-all;
  font-size: 0.9rem;
}

a.value {
    color: var(--theme-900);
    text-decoration: none;
}
a.value:hover {
    text-decoration: underline;
}

.copy-btn, #externalLink {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--theme-900);
  padding: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.copy-btn:hover, #externalLink:hover {
    color: var(--theme-600);
}

.feather {
  width: 18px;
  height: 18px;
}

.error-message {
    color: #e53e3e;
    margin-top: 1.5rem;
    background: rgba(229, 62, 62, 0.1);
    padding: 10px 15px;
    border-radius: 8px;
}

/* ---------- Footer & Theme Toggle ---------- */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  display: flex;
  justify-content: flex-start;
}

.theme-toggle {
  cursor: pointer;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}
.theme-toggle svg {
  width: 22px;
  height: 22px;
  transition: transform .3s;
  position: absolute;
}
.theme-toggle:hover svg {
    transform: scale(1.1);
}
.theme-toggle .moon {
  display: none;
}

/* ---------- Dark Mode ---------- */
body.dark-mode {
  --theme-50: #000000;
  --theme-100: #1a174a;
  --theme-600: #5046e5;
  --theme-900: #ffffff;
}
body.dark-mode .glass {
    background: rgba(26, 23, 74, 0.5); /* Dark purple translucent */
    border-color: rgba(255 255 255 / .1);
    box-shadow: 0 8px 32px rgba(0 0 0 / .25);
}
body.dark-mode h1 {
    background: linear-gradient(135deg, var(--theme-900) 0%, var(--theme-600) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
body.dark-mode #urlInput {
    background-color: rgba(0,0,0,0.2);
    color: var(--theme-900);
    border-color: rgba(255,255,255,0.1);
}
body.dark-mode #urlInput::placeholder {
    color: rgba(255,255,255,0.5);
}
body.dark-mode #checkButton {
    background: var(--theme-600);
    color: var(--theme-900);
}
body.dark-mode #checkButton:hover {
    background: #6c63ff;
}
body.dark-mode .theme-toggle .sun {
  display: none;
}
body.dark-mode .theme-toggle .moon {
  display: block;
}
body.dark-mode a.value {
    color: var(--theme-900);
}
body.dark-mode .copy-btn, body.dark-mode #externalLink {
    color: var(--theme-900);
}
body.dark-mode .results-container {
    background: rgba(255,255,255,0.05);
}
body.dark-mode .result-item:not(:last-child) {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}


/* ---------- Stars ---------- */
#stars {
  display: none;
}
body.dark-mode #stars {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
#stars::before {
  content: '';
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  box-shadow: 50vw 10vh 0px 0px #fff, 10vw 20vh 1px 1px #fff, 80vw 30vh 0px 1px #fff, 30vw 40vh 1px 0px #fff, 60vw 50vh 0px 1px #fff, 90vw 60vh 1px 1px #fff, 20vw 70vh 0px 0px #fff, 70vw 80vh 1px 0px #fff, 40vw 90vh 0px 1px #fff, 5vw 5vh 1px 0px #fff, 95vw 95vh 0px 1px #fff, 25vw 35vh 1px 1px #fff, 75vw 65vh 0px 0px #fff;
  animation: twinkle 5s infinite;
}
@keyframes twinkle {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  header { padding: 14px 5vw; }
  .logo { font-size: 1.2rem; }
  .card { padding: 20px; }
  h1 { font-size: 1.8rem; }
  .input-group { flex-direction: column; }

  .result-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .value-group {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .value {
    font-size: 0.85rem;
  }
}