@keyframes float {
  0%, 100% {transform:translateY(0);}
  50% {transform:translateY(-8px);}
}

@keyframes rotate {
  0% {transform:rotate(0deg);}
  100% {transform:rotate(360deg);}
}

@keyframes ripple {
  0% {transform:translate(-50%,-50%) scale(0); opacity:1;}
  100% {transform:translate(-50%,-50%) scale(1); opacity:0;}
}

@keyframes fadeIn {
  from {opacity:0; transform:translateY(10px);}
  to {opacity:1; transform:translateY(0);}
}

@keyframes pulse {
  0% {box-shadow: 0 0 0 0 rgba(129, 140, 248, 0.4);}
  70% {box-shadow: 0 0 0 10px rgba(129, 140, 248, 0);}
  100% {box-shadow: 0 0 0 0 rgba(129, 140, 248, 0);}
}

@keyframes borderGlow {
  0% {
    border-color: rgba(129, 140, 248, 0.4);
    box-shadow: 0 0 8px rgba(129, 140, 248, 0.15), 0 0 12px rgba(129, 140, 248, 0.08);
  }
  25% {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.18), 0 0 12px rgba(99, 102, 241, 0.1);
  }
  50% {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.18), 0 0 12px rgba(139, 92, 246, 0.1);
  }
  75% {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.18), 0 0 12px rgba(99, 102, 241, 0.1);
  }
  100% {
    border-color: rgba(129, 140, 248, 0.4);
    box-shadow: 0 0 8px rgba(129, 140, 248, 0.15), 0 0 12px rgba(129, 140, 248, 0.08);
  }
}

@keyframes borderGlowFocus {
  0% {
    border-color: rgba(129, 140, 248, 0.5);
    box-shadow: 0 0 12px rgba(129, 140, 248, 0.2), 0 0 18px rgba(129, 140, 248, 0.12), 0 0 24px rgba(129, 140, 248, 0.08);
  }
  25% {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.25), 0 0 18px rgba(99, 102, 241, 0.15), 0 0 24px rgba(99, 102, 241, 0.1);
  }
  50% {
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.25), 0 0 18px rgba(139, 92, 246, 0.15), 0 0 24px rgba(139, 92, 246, 0.1);
  }
  75% {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.25), 0 0 18px rgba(99, 102, 241, 0.15), 0 0 24px rgba(99, 102, 241, 0.1);
  }
  100% {
    border-color: rgba(129, 140, 248, 0.5);
    box-shadow: 0 0 12px rgba(129, 140, 248, 0.2), 0 0 18px rgba(129, 140, 248, 0.12), 0 0 24px rgba(129, 140, 248, 0.08);
  }
}

/* Force light mode and prevent dark mode extensions from overriding */
html,
html *,
html * *,
html * * * {
  color-scheme: light !important;
}

:root {
  --bg: #0a0b14;
  --surface: #131525;
  --accent: rgba(129, 140, 248, 0.2);
  --primary: #fff;
  --secondary: #a9adc1;
  --highlight: #818cf8;
  --highlight-dark: #6366f1;
  --sidebar-width: 300px;
  --toggle-size: 30px;
  --footer-height: 70px;
  --offset-open: 20px;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --border-radius: 10px;
  color-scheme: light !important;
  
  /* Button colors that are harder for extensions to override */
  --btn-bg-from: rgba(15, 16, 27, 0.8);
  --btn-bg-to: rgba(15, 16, 27, 0.8);
  --btn-text: #ffffff;
  --link-color: #818cf8;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', system-ui, sans-serif;
}

html {
  color-scheme: light !important;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--primary);
  display: flex;
  padding-top: 60px;
  font-weight: 300;
  line-height: 1.6;
  color-scheme: light !important;
  position: relative;
  overflow-x: hidden;
}

.binary-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.binary-column {
  position: absolute;
  top: -100%;
  font-family: 'Courier New', monospace;
  font-size: 18px;
  color: rgba(169, 173, 193, 0.20);
  line-height: 1.5;
  white-space: pre;
  animation: binaryFall linear infinite;
  user-select: none;
  letter-spacing: 3px;
  font-weight: 300;
  opacity: 0.20;
}

@keyframes binaryFall {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(calc(100vh + 100%));
  }
}

/* Navigation */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  background: rgba(19, 21, 37, 0.8);
  backdrop-filter: blur(10px);
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--accent);
  z-index: 1000;
}

.top-logo {
  margin-right: auto;
  text-decoration: none;
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  letter-spacing: 0.5px;
}

.top-logo .logo-img {
  width: 28px;
  height: auto;
  margin-right: 6px;
  margin-top: -2px;
  margin-bottom: -2px;
}

.top-logo span {
  background: linear-gradient(90deg, var(--primary), var(--highlight));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.top-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1rem;
  color: var(--secondary);
  font-weight: 400;
}

.top-center a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.top-center a:hover {
  color: var(--highlight);
}

.top-right {
  display: flex;
  align-items: center;
}

.top-right a {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.top-right a:hover {
  background: var(--accent);
  text-decoration: none;
}

.logged-in-text {
  margin-right: 1rem;
  font-size: 0.9rem;
  color: var(--secondary);
}

.top-right a.admin-panel {
  margin-left: 1rem;
  background: rgba(129, 140, 248, 0.15);
}

.top-right a.admin-panel:hover {
  background: rgba(129, 140, 248, 0.25);
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--accent);
  transition: transform 0.3s ease;
  position: fixed;
  top: 54px;
  left: 0;
  bottom: 0;
  z-index: 1200;
}

.sidebar.collapsed {
  transform: translateX(-100%);
}

.sidebar-content {
  height: calc(100% - var(--footer-height));
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--surface);
}

.sidebar-content::-webkit-scrollbar {
  width: 4px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: var(--surface);
  border-radius: 4px;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  border: none;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.25);
}

.sidebar h2 {
  font-size: 1.1375rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
  color: var(--highlight);
  letter-spacing: 0.5px;
}

.sidebar-content p,
.sidebar-content li {
  font-size: 0.9375rem;
}

.sidebar-content span:not(.click-count) {
  font-size: 0.9375rem;
}

.sidebar-links {
  list-style: none;
  padding: 0;
}

.sidebar-links li {
  margin: 1rem 0;
  word-break: break-all;
  cursor: grab;
  position: relative;
  padding: 14px 40px 14px 14px;
  background: rgba(26, 28, 46, 0.95);
  border-radius: var(--border-radius);
  border: 1px solid var(--accent);
  transition: all 0.3s ease;
  overflow: hidden;
}

.sidebar-links li:hover {
  background: rgba(40, 44, 70, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.2);
}

.sidebar-links li:active {
  cursor: grabbing;
  transform: translateY(0);
}

.sidebar-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  display: block;
  margin-bottom: 4px;
  font-size: 0.8875rem;
}

.sidebar-links a:hover {
  text-decoration: none;
}

.sidebar-links a.shortlink {
  font-size: 0.7875rem;
  color: var(--highlight);
  background: rgba(26, 28, 46, 0.6);
  padding: 5px 10px 5px 0;
  border-radius: 6px;
  display: block;
  margin-bottom: 4px;
  margin-left: 0;
  max-width: calc(100% - 5px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.2s;
  font-family: 'Outfit', monospace;
  font-weight: 400;
}

.sidebar-links a.shortlink:hover {
  background: rgba(40, 44, 70, 0.8);
}

.sidebar-links li .eye-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  cursor: pointer;
  fill: var(--secondary);
  margin: 0;
  opacity: 0.7;
  transition: all 0.2s, transform 0.2s;
  z-index: 2;
}

.sidebar-links li .eye-icon:hover {
  opacity: 1;
  transform: scale(1.1);
  fill: rgba(255, 255, 255, 0.9);
}

.sidebar-links li small {
  display: block;
  color: var(--secondary);
  line-height: 1.5;
  font-size: 0.7875rem;
}

.sidebar-links li small.timestamp {
  display: inline-block;
  color: var(--primary);
  background: rgba(49, 51, 75, 0.8);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.6375rem;
  margin-top: 8px;
  font-weight: 500;
}

.sidebar-links li small.dest-url {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 10px);
  color: var(--secondary);
  display: block;
  margin-top: 0;
  margin-bottom: 0;
  line-height: 1.3;
}

#trash-can {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--footer-height);
  padding: 10px 0;
  background: var(--surface);
  text-align: center;
  z-index: 10;
  transition: background 0.3s ease;
}

#trash-can svg {
  opacity: 0.7;
  transition: all 0.2s ease;
}

#trash-can:hover svg {
  opacity: 1;
  transform: scale(1.05);
}

#trash-can.hover {
  background: rgba(239, 68, 68, 0.15);
  border-radius: 4px;
}

#trash-can.hover svg {
  opacity: 1;
  fill: rgba(239, 68, 68, 0.9);
}

#sidebarToggle {
  position: fixed;
  top: 54px;
  width: var(--toggle-size);
  height: var(--toggle-size);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 2000;
  transition: all 0.3s ease;
  user-select: none;
  line-height: var(--toggle-size);
  font-family: monospace;
  font-size: 1.2rem;
  padding: 0;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#sidebarToggle:hover {
  background: rgba(40, 44, 70, 0.9);
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
}

.open #sidebarToggle {
  left: calc(var(--sidebar-width) - var(--toggle-size) - var(--offset-open));
}

.closed #sidebarToggle {
  left: 0;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.container {
  width: 100%;
  max-width: 600px;
  padding: 2rem;
  background: var(--surface);
  border-radius: var(--border-radius);
  border: 1px solid var(--accent);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  animation: float 6s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

.hero-section {
  text-align: center;
  margin-bottom: 1rem;
}

.hero-logo {
  width: 70px;
  height: auto;
  margin-top: -10px;
  margin-bottom: 0px;
}

.auth-logo-container {
  text-align: center;
  margin-bottom: 1rem;
}

.auth-logo {
  width: 70px;
  height: auto;
  margin-top: -10px;
  margin-bottom: 0px;
}

h1 {
  font-weight: 700;
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 2.5rem;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, var(--primary), var(--highlight));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Form Elements */
.form-group {
  margin-bottom: 1rem;
}

input[type="url"],
input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 0.875rem 1rem;
  background: rgba(15, 16, 27, 0.8);
  border: 1px solid rgba(129, 140, 248, 0.2);
  border-radius: var(--border-radius);
  color: var(--primary);
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.16,0.71,0.34,0.99);
  font-family: 'Outfit', sans-serif;
}

input[type="url"]:focus,
input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
  outline: none;
  border-color: rgba(129, 140, 248, 0.5);
  animation: borderGlowFocus 4s ease-in-out infinite;
}

input::placeholder {
  color: var(--secondary);
  opacity: 0.7;
}

select {
  width: 100%;
  padding: 0.875rem 1rem;
  padding-right: 2.5rem;
  background: rgba(15, 16, 27, 0.8);
  border: 1px solid rgba(129, 140, 248, 0.2);
  border-radius: var(--border-radius);
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.16,0.71,0.34,0.99);
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23818cf8' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  color: var(--secondary) !important;
  opacity: 0.7 !important;
}

select:hover {
  border-color: rgba(129, 140, 248, 0.4);
}

select option {
  background: var(--surface);
  color: var(--primary);
  padding: 0.75rem 1rem;
  border: none;
  font-size: 0.95rem;
  font-family: 'Outfit', sans-serif;
}

select option:hover {
  background: rgba(40, 44, 70, 0.9);
}

select option:checked {
  background: rgba(26, 28, 46, 0.95);
  color: var(--highlight);
  font-weight: 500;
}

.alias-group {
  position: relative;
}

.error-popup {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  background: var(--error);
  color: white;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
  transition: opacity 0.5s ease-out;
  z-index: 10;
}

.error-popup.fade-out {
  opacity: 0;
}

/* Mobile Options */
.mobile-options-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.875rem;
  margin-bottom: 1rem;
  width: 100%;
  grid-template-areas: 
    "gps device-info clipboard"
    "snap-pic scan-link temporary";
}

/* Grid positioning based on checkbox IDs */
.mobile-options-container .checkbox-wrapper:has(#gps) { grid-area: gps; }
.mobile-options-container .checkbox-wrapper:has(#device_info) { grid-area: device-info; }
.mobile-options-container .checkbox-wrapper:has(#clipboard) { grid-area: clipboard; }
.mobile-options-container .checkbox-wrapper:has(#snap_pic) { grid-area: snap-pic; }
.mobile-options-container .checkbox-wrapper:has(#scan_link) { grid-area: scan-link; }
.mobile-options-container .checkbox-wrapper:has(#temporary) { grid-area: temporary; }

/* Fallback for browsers that don't support :has() */
.checkbox-wrapper[onclick*="gps"] { grid-area: gps; }
.checkbox-wrapper[onclick*="device_info"] { grid-area: device-info; }
.checkbox-wrapper[onclick*="clipboard"] { grid-area: clipboard; }
.checkbox-wrapper[onclick*="snap_pic"] { grid-area: snap-pic; }
.checkbox-wrapper[onclick*="scan_link"] { grid-area: scan-link; }
.checkbox-wrapper[onclick*="temporary"] { grid-area: temporary; }

/* Special layout for when only 3 options are available (GPS, Device Info, Scan Link) */
.mobile-options-container.three-options-only {
  grid-template-areas: "gps device-info scan-link";
}

.mobile-options-container.three-options-only .checkbox-wrapper[onclick*="scan_link"] {
  grid-area: scan-link;
}

/* Special layout for when 4 options are available (GPS, Device Info, Scan Link, Temporary) */
.mobile-options-container.four-options-only {
  grid-template-columns: repeat(2, 1fr);
  grid-template-areas: 
    "gps device-info"
    "scan-link temporary";
}

/* Checkbox Styling */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  cursor: pointer;
  background: rgba(26, 28, 46, 0.8);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  transition: all 0.3s ease;
  min-width: 110px;
  flex: 1;
  position: relative;
  overflow: hidden;
}

.checkbox-wrapper:hover {
  background: rgba(40, 44, 70, 0.8);
  transform: translateY(-2px);
  border-color: var(--highlight);
}

.checkbox-wrapper:active, 
.checkbox-wrapper.clicked {
  transform: translateY(0);
}

.checkbox-wrapper.clicked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  height: 150%;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  transform: translate(-50%,-50%) scale(0);
  animation: ripple 0.3s ease-out;
}

.checkbox-wrapper input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  background: rgba(15, 16, 27, 0.8);
  border: 1px solid var(--accent);
  border-radius: 6px;
  margin-right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-wrapper input[type="checkbox"]::before {
  content: '✔';
  color: var(--bg);
  font-size: 12px;
  display: none;
}

.checkbox-wrapper input[type="checkbox"]:checked {
  background: var(--highlight);
  border-color: var(--highlight);
}

.checkbox-wrapper input[type="checkbox"]:checked::before {
  display: block;
}

.checkbox-wrapper label {
  color: var(--primary);
  font-size: 0.95rem;
  user-select: none;
  white-space: nowrap;
  font-weight: 500;
}

/* Ultra-specific button selectors to prevent dark mode override */
html body button,
html body input[type="submit"],
html body input[type="button"],
html body .btn,
html body form button,
html body form input[type="submit"],
html body form input[type="button"],
html body div button,
html body div input[type="submit"],
html body div input[type="button"] {
  width: 100% !important;
  padding: 1rem !important;
  background: var(--btn-bg-from) !important;
  background-color: var(--btn-bg-from) !important;
  color: var(--btn-text) !important;
  border: 1px solid rgba(129, 140, 248, 0.4) !important;
  border-radius: var(--border-radius) !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.16,0.71,0.34,0.99) !important;
  position: relative !important;
  letter-spacing: 0.5px !important;
  font-size: 1rem !important;
  color-scheme: light !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  outline: none !important;
  text-shadow: none !important;
  animation: borderGlow 4s ease-in-out infinite !important;
}

html body button:hover,
html body input[type="submit"]:hover,
html body input[type="button"]:hover,
html body .btn:hover,
html body form button:hover,
html body form input[type="submit"]:hover,
html body form input[type="button"]:hover,
html body div button:hover,
html body div input[type="submit"]:hover,
html body div input[type="button"]:hover {
  background: var(--btn-bg-from) !important;
  background-color: var(--btn-bg-from) !important;
  border-color: rgba(129, 140, 248, 0.5) !important;
  color: var(--btn-text) !important;
  transform: translateY(-1px) !important;
  animation: borderGlow 4s ease-in-out infinite !important;
}

html body button:active,
html body input[type="submit"]:active,
html body input[type="button"]:active,
html body .btn:active,
html body form button:active,
html body form input[type="submit"]:active,
html body form input[type="button"]:active,
html body div button:active,
html body div input[type="submit"]:active,
html body div input[type="button"]:active {
  transform: translateY(0) !important;
  background: var(--btn-bg-from) !important;
  background-color: var(--btn-bg-from) !important;
  color: var(--btn-text) !important;
  border-color: rgba(129, 140, 248, 0.2) !important;
  box-shadow: none !important;
  animation: none !important;
}

html body button:focus,
html body input[type="submit"]:focus,
html body input[type="button"]:focus,
html body .btn:focus,
html body form button:focus,
html body form input[type="submit"]:focus,
html body form input[type="button"]:focus,
html body div button:focus,
html body div input[type="submit"]:focus,
html body div input[type="button"]:focus {
  background: var(--btn-bg-from) !important;
  background-color: var(--btn-bg-from) !important;
  color: var(--btn-text) !important;
  outline: none !important;
  border-color: rgba(129, 140, 248, 0.5) !important;
  animation: borderGlowFocus 4s ease-in-out infinite !important;
}

/* Ultra-specific auth link selectors */
html body a.auth-link,
html body .top-right a.auth-link,
html body div a.auth-link,
html body nav a.auth-link,
html body a.logout-link,
html body .top-right a.logout-link,
html body div a.logout-link,
html body nav a.logout-link {
  color: var(--link-color) !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  color-scheme: light !important;
  background: transparent !important;
  text-shadow: none !important;
}

html body a.auth-link:hover,
html body .top-right a.auth-link:hover,
html body div a.auth-link:hover,
html body nav a.auth-link:hover,
html body a.logout-link:hover,
html body .top-right a.logout-link:hover,
html body div a.logout-link:hover,
html body nav a.logout-link:hover {
  text-decoration: underline !important;
  color: var(--link-color) !important;
  background: transparent !important;
}

html body a.auth-link:visited,
html body .top-right a.auth-link:visited,
html body div a.auth-link:visited,
html body nav a.auth-link:visited,
html body a.logout-link:visited,
html body .top-right a.logout-link:visited,
html body div a.logout-link:visited,
html body nav a.logout-link:visited {
  color: var(--link-color) !important;
  background: transparent !important;
}

html body a.auth-link:focus,
html body .top-right a.auth-link:focus,
html body div a.auth-link:focus,
html body nav a.auth-link:focus,
html body a.logout-link:focus,
html body .top-right a.logout-link:focus,
html body div a.logout-link:focus,
html body nav a.logout-link:focus {
  color: var(--link-color) !important;
  background: transparent !important;
}

html body a.auth-link:active,
html body .top-right a.auth-link:active,
html body div a.auth-link:active,
html body nav a.auth-link:active,
html body a.logout-link:active,
html body .top-right a.logout-link:active,
html body div a.logout-link:active,
html body nav a.logout-link:active {
  color: var(--link-color) !important;
  background: transparent !important;
}

/* Even more specific targeting for top-nav auth links and logout link */
html body .top-nav .top-right a.auth-link,
html body .top-nav .top-right.logged-out a.auth-link,
html body div.top-nav div.top-right a.auth-link,
html body div.top-nav div.top-right.logged-out a.auth-link,
html body .top-nav .top-right a.logout-link,
html body div.top-nav div.top-right a.logout-link {
  color: var(--highlight) !important;
  text-decoration: none !important;
  font-size: 0.95rem !important;
  cursor: pointer !important;
  padding: 6px 12px !important;
  border-radius: 6px !important;
  transition: all 0.2s ease !important;
  background: transparent !important;
  color-scheme: light !important;
  -webkit-text-fill-color: var(--highlight) !important;
  -webkit-appearance: none !important;
  text-shadow: none !important;
  box-shadow: none !important;
}

html body .top-nav .top-right a.auth-link:hover,
html body .top-nav .top-right.logged-out a.auth-link:hover,
html body div.top-nav div.top-right a.auth-link:hover,
html body div.top-nav div.top-right.logged-out a.auth-link:hover,
html body .top-nav .top-right a.logout-link:hover,
html body div.top-nav div.top-right a.logout-link:hover {
  background: var(--accent) !important;
  text-decoration: none !important;
  color: var(--highlight) !important;
  -webkit-text-fill-color: var(--highlight) !important;
}

/* Sidebar auth links */
html body .sidebar p a.auth-link,
html body .sidebar-content p a.auth-link,
html body div.sidebar div.sidebar-content p a.auth-link {
  color: var(--highlight) !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  color-scheme: light !important;
  background: transparent !important;
  -webkit-text-fill-color: var(--highlight) !important;
}

html body .sidebar p a.auth-link:hover,
html body .sidebar-content p a.auth-link:hover,
html body div.sidebar div.sidebar-content p a.auth-link:hover {
  text-decoration: underline !important;
  color: var(--highlight) !important;
  background: transparent !important;
  -webkit-text-fill-color: var(--highlight) !important;
}

.generated-url {
  margin-top: 2rem;
  padding: 1.25rem;
  background: rgba(26, 28, 46, 0.8);
  border-radius: var(--border-radius);
  text-align: center;
  border: 1px solid var(--accent);
  animation: fadeIn 0.4s ease-out;
}

.generated-url a {
  color: var(--highlight);
  text-decoration: none;
  font-weight: 500;
  word-break: break-all;
  position: relative;
  font-family: 'Outfit', monospace;
}

.generated-url a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--highlight);
  transition: width 0.3s ease;
}

.generated-url a:hover::after {
  width: 100%;
}

.error-card {
  background: rgba(26, 28, 46, 0.85);
  border-radius: var(--border-radius);
  border: 1px solid var(--accent);
  padding: 2rem;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  margin-bottom: 1.5rem;
}

.error-title {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1rem;
  letter-spacing: -0.3px;
  text-align: center;
}

.error-code {
  font-size: 1.1rem;
  color: var(--highlight);
  margin-bottom: 1rem;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.error-message {
  font-size: 1rem;
  color: var(--secondary);
  margin-bottom: 2rem;
  line-height: 1.7;
  text-align: center;
  max-width: 100%;
}

.error-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.6rem;
  border-radius: var(--border-radius);
  border: 1px solid rgba(129, 140, 248, 0.2);
  background: var(--btn-bg-from);
  color: var(--btn-text);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.16,0.71,0.34,0.99);
  min-width: 180px;
}

.btn-link:hover {
  border-color: var(--highlight);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-link.secondary {
  background: transparent;
  border-color: var(--accent);
  color: var(--highlight);
}

.btn-link.secondary:hover {
  background: rgba(129, 140, 248, 0.1);
  box-shadow: none;
}

.error-details {
  text-align: center;
  color: var(--secondary);
  font-size: 0.9rem;
  background: rgba(15, 16, 27, 0.65);
  border-radius: var(--border-radius);
  border: 1px solid rgba(129, 140, 248, 0.15);
  padding: 1rem 1.5rem;
  margin-top: 1rem;
}

.error-details p {
  margin: 0;
}

.google-logo {
  display: inline-block;
  margin-top: 1rem;
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
  background: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.google-logo:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.google-icon,
.discord-icon {
  width: 24px;
  height: 24px;
  display: block;
}

#analytics-modal {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 20px 0;
}

#analytics-modal.hidden {
  display: none;
}

.analytics-content {
  background: var(--surface);
  padding: 24px;
  border-radius: var(--border-radius);
  width: 1400px;
  height: 900px;
  overflow: auto;
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--surface);
  margin: 0 auto;
  border: 1px solid var(--accent);
}

.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 15px;
}

.analytics-title {
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--primary);
}

.analytics-subtitle {
  font-size: 0.9rem;
  color: var(--secondary);
  margin-top: 4px;
}

.analytics-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

#close-analytics {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  border-radius: var(--border-radius) !important;
  box-shadow: none !important;
  fill: var(--secondary) !important;
  color: var(--secondary) !important;
  border: none !important;
  padding: 0 !important;
  font-size: 1.5rem !important;
  cursor: pointer;
  transition: color 0.2s, fill 0.2s, transform 0.2s;
}

#close-analytics svg {
  width: 32px !important;
  height: 32px !important;
  display: block;
}

#copy-json-btn {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  border-radius: var(--border-radius) !important;
  box-shadow: none !important;
  fill: var(--secondary) !important;
  color: var(--secondary) !important;
  border: none !important;
  padding: 0 !important;
  font-size: 1rem !important;
  cursor: pointer;
  transition: color 0.2s, fill 0.2s, transform 0.2s;
  transform: scale(0.8) !important;
}

#copy-json-btn svg, #copy-json-btn > svg, #copy-json-btn * svg, #copy-json-btn::before, #copy-json-btn::after {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
  display: block !important;
  margin: 0 auto !important;
  padding: 0 !important;
  font-size: 1rem !important;
  transform: scale(0.3) !important;
}

#copy-json-btn:hover, #close-analytics:hover {
  color: var(--primary) !important;
  fill: var(--highlight) !important;
  background: var(--accent) !important;
  box-shadow: none !important;
  transform: translateY(-2px) scale(1.05);
}

.analytics-tab-nav {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--accent);
  width: 100%;
}

/* Ultra-specific analytics tab selectors to override any purple styling */
#analytics-modal .analytics-tab,
.analytics-content .analytics-tab,
html body #analytics-modal .analytics-tab,
html body .analytics-content .analytics-tab {
  flex: 1;
  padding: 10px 16px !important;
  background: var(--surface) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  color: #aaa !important;
  cursor: pointer !important;
  font-size: 0.9rem !important;
  border-radius: 6px !important;
  margin-right: 4px !important;
  transition: all 0.2s ease !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  text-align: center !important;
}

#analytics-modal .analytics-tab:hover,
.analytics-content .analytics-tab:hover,
html body #analytics-modal .analytics-tab:hover,
html body .analytics-content .analytics-tab:hover {
  color: #e2e8f0 !important;
  background: var(--surface) !important;
  border-color: rgba(255,255,255,0.15) !important;
}

#analytics-modal .analytics-tab.active,
.analytics-content .analytics-tab.active,
html body #analytics-modal .analytics-tab.active,
html body .analytics-content .analytics-tab.active {
  color: #e2e8f0 !important;
  background: var(--surface) !important;
  border-color: rgba(255,255,255,0.2) !important;
}

.timeline-container {
  position: relative;
  margin-top: 20px;
}

.timeline {
  position: relative;
  padding-left: 20px;
  margin-bottom: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
}

.timeline-item {
  position: relative;
  padding: 15px;
  margin-bottom: 15px;
  background: rgba(26, 28, 46, 0.8);
  border-radius: var(--border-radius);
  border: 1px solid var(--accent);
  transition: all 0.2s ease;
}

.timeline-item:hover {
  background: rgba(40, 44, 70, 0.8);
  transform: translateX(5px);
  border-color: var(--highlight);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -25px;
  top: 22px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--highlight);
  border: 2px solid var(--surface);
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--secondary);
  margin-bottom: 8px;
}

.timeline-details {
  font-size: 0.9rem;
}

.timeline-ip {
  background: rgba(0,0,0,0.3);
  padding: 3px 8px;
  border-radius: 4px;
  font-family: monospace;
  margin-right: 10px;
}

.timeline-location {
  color: var(--secondary);
}

.timeline-agent {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px 8px;
  background: rgba(15, 16, 27, 0.8);
  border-radius: 4px;
}

.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.stat-card {
  background: rgba(26, 28, 46, 0.8);
  border-radius: var(--border-radius);
  padding: 15px;
  border: 1px solid var(--accent);
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--primary);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--secondary);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 0.9rem;
}

.data-table th {
  text-align: left;
  padding: 12px 15px;
  background: rgba(26, 28, 46, 0.8);
  color: var(--primary);
  font-weight: 500;
  border-bottom: 1px solid var(--accent);
}

.data-table td {
  padding: 10px 15px;
  border-bottom: 1px solid var(--accent);
}

.data-table tbody tr:hover {
  background: rgba(40, 44, 70, 0.5);
}

.data-table .ip-address {
  font-family: monospace;
}

.data-table .location {
  color: var(--secondary);
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--secondary);
}

.empty-state svg {
  opacity: 0.3;
  margin-bottom: 15px;
}

.empty-state-message {
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.empty-state-desc {
  font-size: 0.9rem;
  max-width: 400px;
  margin: 0 auto;
}

.data-pill {
  display: inline-block;
  background: rgba(50,50,50,0.8);
  padding: 4px 10px;
  border-radius: 30px;
  font-size: 0.85rem;
  margin-right: 8px;
  margin-bottom: 8px;
  border: 1px solid rgba(80,80,80,0.8);
}

.data-count {
  margin-left: 5px;
  background: rgba(255,255,255,0.1);
  padding: 2px 6px;
  border-radius: 30px;
  font-size: 0.75rem;
}

#analytics-json {
  background: rgba(15, 16, 27, 0.8);
  color: var(--primary);
  padding: 15px;
  border-radius: var(--border-radius);
  border: 1px solid var(--accent);
  font-family: 'Consolas','Monaco','Courier New',monospace;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin-top: 10px;
  overflow-x: auto;
  line-height: 1.5;
  height: calc(100% - 50px);
  max-height: none;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#analytics-json::-webkit-scrollbar {
  display: none;
}

.json-key {
  color: var(--highlight);
  font-weight: 500;
}

.json-string {
  color: #10b981;
}

.json-number {
  color: #3b82f6;
}

.json-boolean {
  color: #f59e0b;
}

.json-null {
  color: var(--secondary);
}

.geo-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.geo-item {
  background: rgba(26, 28, 46, 0.8);
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--accent);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
}

.geo-label {
  color: var(--secondary);
  margin-right: 4px;
  font-size: 0.75rem;
}

.geo-value {
  color: var(--primary);
}

.geo-flag {
  color: #ddd;
  margin-right: 6px;
}

.proxy-tag {
  background: #f44336;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
}

.proxy-tag-corner {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
}

.timeline-isp {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--secondary);
  overflow: hidden;
  text-overflow: ellipsis;
}

.ip-address {
  position: relative;
  font-family: monospace;
}

.ip-proxy-indicator {
  margin-top: 4px;
}

@media (max-width: 1450px) {
  .analytics-content {
    width: 95%;
    height: 90vh;
  }
}

.version {
  position: fixed;
  bottom: 10px;
  right: 10px;
  font-size: 1rem;
  color: var(--secondary);
}

.desktop-only { display: inline; }
.mobile-only { display: none; }
.text-center { text-align: center; }
.center-margin { text-align: center; margin-top: 1rem; }
.ml-1 { margin-left: 1rem; }
.ml-10 { margin-left: 10px; }
.ml-1rem { margin-left: 1rem; }

#math-captcha {
  display: none;
  overflow: hidden;
  max-height: 0;
  margin-top: 1rem;
}

@media (max-width: 1140px) {
  .sidebar {
    width: 80vw;
    max-width: var(--sidebar-width);
  }
  
  .sidebar-content {
    height: 100%;
  }
  
  #trash-can {
    display: none;
  }
  
  #sidebarToggle {
    left: calc(min(80vw, var(--sidebar-width)) - var(--toggle-size) - 20px);
  }
  
  .open #sidebarToggle {
    left: calc(min(80vw, var(--sidebar-width)) - var(--toggle-size) - 20px);
  }
  
  .container {
    width: 90%;
    padding: 3rem;
  }
  
  .top-center {
    display: none;
  }
  
  .top-right.logged-out {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    padding-right: 0px;
  }
  
  .top-right.logged-out a.auth-link:first-child {
    margin-right: 4px;
  }
  
  .top-right .logged-in-text {
    display: none !important;
  }
  
  .top-right .logout-link {
    position: static;
    margin-left: 0.5rem;
  }
  
  .desktop-only {
    display: none;
  }
  
  .mobile-only {
    display: inline;
  }
}

@media (max-width: 600px) {
  .top-nav a.admin-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
  }
  
  .container {
    width: 95%;
    max-width: none;
    padding: 2rem;
  }
}

/* Options toggle button for mobile */
.options-toggle {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: rgba(26, 28, 46, 0.8);
  padding: 0.875rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--accent);
  color: var(--primary);
  cursor: pointer;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
  width: 95%;
  margin: 0 auto 1rem;
}

.options-toggle:hover {
  background: rgba(40, 44, 70, 0.8);
  border-color: var(--highlight);
}

.options-toggle-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.options-toggle.active .options-toggle-icon {
  transform: rotate(180deg);
}

@media (max-width: 480px) {
  .options-toggle {
    display: flex;
  }
  
  .mobile-options-container {
    display: none;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 95%;
    margin: 0 auto 1.2rem;
    grid-template-areas: 
      "gps"
      "device-info"
      "clipboard"
      "snap-pic"
      "scan-link"
      "temporary";
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  
  .mobile-options-container.show {
    display: grid;
    max-height: 500px;
  }
  
  /* Handle three-options-only case in mobile */
  .mobile-options-container.three-options-only {
    grid-template-areas: 
      "gps"
      "device-info"
      "scan-link";
  }
  
  /* Handle four-options-only case in mobile */
  .mobile-options-container.four-options-only {
    grid-template-areas: 
      "gps"
      "device-info"
      "scan-link"
      "temporary";
  }
  
  .checkbox-wrapper {
    padding: 8px 6px;
    min-width: auto;
    justify-content: center;
    height: 40px;
    display: flex;
    align-items: center;
  }
  
  .checkbox-wrapper label {
    font-size: 0.8rem;
    letter-spacing: normal;
  }
  
  .checkbox-wrapper input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 6px;
  }
  
  .container {
    padding: 2rem 0.75rem;
    border-radius: 8px;
  }
  
  .main-content {
    padding: 1rem 0.5rem;
  }
  
  input[type="url"],
  input[type="text"],
  input[type="password"],
  select {
    width: 95%;
    padding: 1rem 0.75rem;
    min-height: 55px;
    font-size: 1rem;
    margin: 0 auto;
    display: block;
  }
  
  select {
    padding-right: 3rem;
  }
  
  button {
    width: 95%;
    min-height: 55px;
    font-size: 1rem;
    margin: 0 auto;
    display: block;
  }
  
  .form-group {
    margin-bottom: 1.2rem;
    width: 100%;
    display: flex;
    justify-content: center;
  }
  
  .form-group button,
  .form-group input {
    width: 95%;
  }
  
  .generated-url {
    width: 100%;
    padding: 1.25rem 0.75rem;
  }
}

@media (max-width: 350px) {
  .checkbox-wrapper label {
    font-size: 0.75rem;
  }
  
  .checkbox-wrapper {
    padding: 6px 4px;
    height: 36px;
  }
  
  .checkbox-wrapper input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin-right: 4px;
  }
  
  .container {
    padding: 1.5rem 0.5rem;
  }
}

.photos-container {
  padding: 15px 0;
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.photo-item {
  background: rgba(30,30,30,0.8);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
  transition: transform 0.2s ease;
}

.photo-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.photo-img-container {
  height: 200px;
  overflow: hidden;
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.photo-details {
  padding: 12px;
}

.photo-timestamp {
  font-size: 0.85rem;
  color: #aaa;
  margin-bottom: 5px;
}

.photo-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.photo-ip {
  font-family: monospace;
  font-size: 0.85rem;
}

.photo-location {
  font-size: 0.85rem;
  color: #ccc;
}

.photo-actions {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
}

.photo-download {
  background: rgba(50,50,50,0.8);
  border: none;
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.photo-download:hover {
  background: rgba(70,70,70,0.8);
}

.photo-timestamp-abs {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 4px;
}

.no-photos {
  text-align: center;
  padding: 40px 20px;
  color: #aaa;
}

#raw-tab {
  height: calc(100% - 80px);
}

@media (max-width: 768px) {
  .analytics-content {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    padding: 16px;
    margin: 0;
  }
  
  #analytics-modal {
    padding: 0;
  }
  
  .analytics-header {
    padding-bottom: 10px;
    margin-bottom: 15px;
  }
  
  .analytics-title {
    font-size: 1.2rem;
  }
  
  .analytics-subtitle {
    font-size: 0.8rem;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .analytics-actions {
    gap: 10px;
    top: 6px;
    right: 6px;
  }
  
  #copy-json-btn {
    width: 36px !important;
    height: 36px !important;
    transform: scale(0.75) !important;
  }
  
  #close-analytics {
    width: 36px !important;
    height: 36px !important;
    font-size: 1.3rem !important;
  }
  
  .analytics-tab-nav {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-wrap: nowrap;
    gap: 4px;
    padding-bottom: 5px;
    margin-bottom: 15px;
    display: flex;
  }
  
  .analytics-tab-nav::-webkit-scrollbar {
    display: none;
  }
  
  .analytics-tab {
    padding: 8px 12px !important;
    font-size: 0.8rem !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    background: var(--surface) !important;
    border: 1px solid var(--accent) !important;
    color: var(--secondary) !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
  }
  
  .analytics-tab:hover {
    color: var(--primary) !important;
    background: var(--surface) !important;
    border-color: var(--highlight) !important;
  }
  
  .analytics-tab.active {
    color: var(--primary) !important;
    background: var(--surface) !important;
    border-color: var(--highlight) !important;
  }
  
  .stats-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  
  .stat-card {
    padding: 8px;
  }
  
  .stat-value {
    font-size: 1.2rem;
  }
  
  .stat-label {
    font-size: 0.7rem;
  }
  
  .timeline-item {
    padding: 12px;
    margin-bottom: 12px;
  }
  
  .timeline-item::before {
    left: -22px;
    top: 18px;
    width: 8px;
    height: 8px;
  }
  
  .timeline-date {
    font-size: 0.75rem;
  }
  
  .timeline-details {
    font-size: 0.8rem;
  }
  
  .timeline-agent {
    font-size: 0.75rem;
  }
  
  .data-table {
    font-size: 0.75rem;
  }
  
  .data-table th,
  .data-table td {
    padding: 8px 6px;
  }
  
  .data-table thead {
    display: none;
  }
  
  .data-table tbody tr {
    display: block;
    margin-bottom: 15px;
    border: 1px solid var(--accent);
    border-radius: var(--border-radius);
    background: rgba(26, 28, 46, 0.8);
  }
  
  .data-table tbody td {
    display: block;
    text-align: right;
    position: relative;
    padding: 8px 10px;
    padding-left: 45%;
    border-bottom: 1px solid var(--accent);
  }
  
  .data-table tbody td:before {
    content: attr(data-label);
    position: absolute;
    left: 10px;
    width: 40%;
    padding-right: 10px;
    text-align: left;
    font-weight: 500;
    color: var(--secondary);
  }
  
  .data-table tbody td:last-child {
    border-bottom: none;
  }
  
  .photos-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }
  
  .photo-img-container {
    height: 150px;
  }
  
  .photo-details {
    padding: 8px;
  }
  
  .photo-meta {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .photo-location {
    margin-top: 4px;
  }
  
  .geo-detail {
    gap: 5px;
  }
  
  .geo-item {
    padding: 3px 8px;
    font-size: 0.75rem;
  }
  
  .error-card {
    padding: 1.5rem;
  }

  .error-actions {
    gap: 0.75rem;
  }

  .btn-link {
    width: 100%;
    min-width: auto;
  }

  .error-details {
    font-size: 0.85rem;
    padding: 0.85rem 1rem;
  }

  .sidebar-links li {
    transition: transform 0.3s ease;
    touch-action: pan-y;
  }
  
  #sidebarToggle:active,
  #sidebarToggle:focus,
  #sidebarToggle:hover {
    color: var(--primary) !important;
    background: var(--surface) !important;
    border-color: var(--accent) !important;
    outline: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
  }
}

@media (max-width: 480px) {
  .analytics-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .analytics-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 8px;
    z-index: 20;
    align-items: center;
  }
  
  .analytics-subtitle {
    max-width: 250px;
  }
  
  .stats-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  
  .timeline {
    padding-left: 15px;
  }
  
  .timeline-item::before {
    left: -17px;
  }
  
  .timeline-ip {
    display: block;
    margin-bottom: 5px;
  }
  
  .photo-meta {
    gap: 4px;
  }

  .error-title {
    font-size: 1.5rem;
  }

  .error-code {
    font-size: 1rem;
  }

  .error-message {
    font-size: 0.9rem;
  }
}

.timeline-clipboard {
  background: rgba(15, 16, 27, 0.8);
  border-left: 3px solid var(--secondary);
  padding: 8px 10px;
  margin: 8px 0;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  overflow: hidden;
  border: 1px solid var(--accent);
  border-left: 3px solid var(--secondary);
}

.clipboard-label {
  font-size: 0.8rem;
  color: var(--secondary);
  margin-bottom: 4px;
  font-weight: 500;
}

.clipboard-content {
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--primary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 100px;
  overflow-y: auto;
  padding: 4px;
  background: rgba(15, 16, 27, 0.8);
  border-radius: 3px;
  border: 1px solid var(--accent);
}

.clipboard-content:hover {
  max-height: 200px;
}

@media (max-width: 768px) {
  .timeline-clipboard {
    padding: 6px 8px;
    margin: 6px 0;
  }
  
  .clipboard-label {
    font-size: 0.75rem;
  }
  
  .clipboard-content {
    font-size: 0.8rem;
    max-height: 80px;
  }
}

.clipboard-entries {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.clipboard-entry {
  background: rgba(26, 28, 46, 0.8);
  border-radius: var(--border-radius);
  border: 1px solid var(--accent);
  overflow: hidden;
}

.clipboard-entry-header {
  display: flex;
  justify-content: space-between;
  padding: 10px 15px;
  background: rgba(15, 16, 27, 0.8);
  border-bottom: 1px solid var(--accent);
}

.clipboard-entry-timestamp {
  font-size: 0.85rem;
  color: var(--secondary);
}

.clipboard-entry-ip {
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--secondary);
}

.clipboard-entry-content {
  padding: 15px;
  max-height: 300px;
  overflow-y: auto;
}

.clipboard-entry-content pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: monospace;
  font-size: 0.9rem;
  color: var(--primary);
  line-height: 1.5;
}

.clipboard-entry-footer {
  padding: 10px 15px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--accent);
}

.clipboard-copy-btn {
  background: rgba(26, 28, 46, 0.8);
  border: 1px solid var(--accent);
  color: var(--primary);
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  width: auto;
}

.clipboard-copy-btn:hover {
  background: rgba(40, 44, 70, 0.8);
  border-color: var(--highlight);
  transform: translateY(-1px);
}

.no-clipboard {
  text-align: center;
  padding: 40px 20px;
  color: var(--secondary);
}

.no-clipboard svg {
  opacity: 0.3;
  margin-bottom: 15px;
}

/* Scan Link Analytics Styling */
.scan-link-entries {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.scan-link-entry {
  background: rgba(26, 28, 46, 0.8);
  border-radius: var(--border-radius);
  border: 1px solid var(--accent);
  overflow: hidden;
}

.scan-link-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: rgba(15, 16, 27, 0.8);
  border-bottom: 1px solid var(--accent);
  transition: background 0.2s ease;
}

.scan-link-entry-header:hover {
  background: rgba(25, 26, 37, 0.9);
}

.scan-link-entry-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scan-link-entry-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scan-status-clean {
  color: #81c784;
  font-weight: 500;
}

.scan-status-threat {
  color: #f56565;
  font-weight: 500;
}

.scan-status-scanning {
  color: #64b5f6;
  font-weight: 500;
}

.scan-status-error {
  color: #ffa726;
  font-weight: 500;
}

.dropdown-arrow {
  color: var(--secondary);
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

.scan-link-entry-timestamp {
  font-size: 0.85rem;
  color: var(--secondary);
}

.scan-link-entry-ip {
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--secondary);
}

.scan-link-entry-content {
  padding: 15px;
}

.scan-link-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scan-detail {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.scan-detail:last-child {
  border-bottom: none;
}

.scan-label {
  font-weight: 600;
  color: var(--secondary);
  min-width: 120px;
  font-size: 0.9rem;
}

.scan-value {
  color: var(--primary);
  font-size: 0.9rem;
  word-break: break-all;
}

.no-scan-link {
  text-align: center;
  padding: 40px 20px;
  color: var(--secondary);
}

.no-scan-link svg {
  opacity: 0.3;
  margin-bottom: 15px;
}

.analytics-tab-nav-container {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  width: 100%;
}

.tab-nav-arrow {
  background: rgba(26, 28, 46, 0.9) !important;
  border: 1px solid var(--accent) !important;
  color: var(--secondary) !important;
  height: 34px !important;
  width: 28px !important;
  border-radius: 4px !important;
  font-size: 16px !important;
  cursor: pointer !important;
  display: none;
  flex-shrink: 0 !important;
  z-index: 10 !important;
  transition: all 0.2s ease !important;
  justify-content: center !important;
  align-items: center !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
  position: relative !important;
}

.tab-nav-arrow:hover {
  background: rgba(40, 44, 70, 0.9);
  color: var(--primary);
  border-color: var(--highlight);
}

.tab-nav-arrow:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.tab-prev {
  margin-right: 6px;
}

.tab-next {
  margin-left: 6px;
}

.analytics-tab-nav {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--accent);
  width: 100%;
}

/* Ultra-specific analytics tab selectors to override any purple styling */
#analytics-modal .analytics-tab,
.analytics-content .analytics-tab,
html body #analytics-modal .analytics-tab,
html body .analytics-content .analytics-tab {
  flex: 1;
  padding: 10px 16px !important;
  background: var(--surface) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  color: #aaa !important;
  cursor: pointer !important;
  font-size: 0.9rem !important;
  border-radius: 6px !important;
  margin-right: 4px !important;
  transition: all 0.2s ease !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  text-align: center !important;
}

#analytics-modal .analytics-tab:hover,
.analytics-content .analytics-tab:hover,
html body #analytics-modal .analytics-tab:hover,
html body .analytics-content .analytics-tab:hover {
  color: #fff !important;
  background: var(--surface) !important;
  border-color: rgba(255,255,255,0.15) !important;
}

#analytics-modal .analytics-tab.active,
.analytics-content .analytics-tab.active,
html body #analytics-modal .analytics-tab.active,
html body .analytics-content .analytics-tab.active {
  color: #fff !important;
  background: var(--surface) !important;
  border-color: rgba(255,255,255,0.2) !important;
}

@media (max-width: 768px) {
  .tab-nav-arrow.mobile-only {
    display: flex; /* Always visible in mobile */
  }
  
  .analytics-tab-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 5px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--accent);
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .analytics-tab-nav::-webkit-scrollbar {
    display: none;
  }
  
  .analytics-tab-nav-container {
    margin-bottom: 15px;
    padding-bottom: 5px;
  }
}

@media (max-width: 480px) {
  .tab-nav-arrow {
    width: 24px;
    height: 30px;
    font-size: 14px;
  }
  
  .stat-card {
    padding: 6px;
  }
  
  .stat-value {
    font-size: 1.1rem;
  }
  
  .stat-label {
    font-size: 0.65rem;
  }
}

#devices-list, 
#recent-activity, 
#top-locations {
  margin-bottom: 30px;
}

#devices-list h3,
#recent-activity h3,
#top-locations h3 {
  margin-bottom: 15px;
}

#top-locations-list,
#recent-timeline,
.device-types-list {
  margin-bottom: 10px;
}

@media (max-width: 768px) {
  #devices-list, 
  #recent-activity, 
  #top-locations {
    margin-bottom: 25px;
  }
  
  #devices-list h3,
  #recent-activity h3,
  #top-locations h3 {
    margin-bottom: 12px;
  }
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}


