@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-color: #0d1117;
  --panel-bg: rgba(22, 27, 34, 0.7);
  --panel-border: rgba(255, 255, 255, 0.1);
  --text-primary: #c9d1d9;
  --text-secondary: #8b949e;
  --accent-color: #58a6ff;
  --accent-hover: #1f6feb;
  --danger-color: #f85149;
  --success-color: #2ea043;
  --card-bg: #161b22;
  --input-bg: #0d1117;
  --toolbar-bg: rgba(13, 17, 23, 0.95);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Glassmorphism Panel */
.glass-panel {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: none;
  /* Removed border to eliminate grey line */
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 3rem;
  /* Default desktop padding */
}

@media (max-width: 768px) {
  .glass-panel {
    padding: 1.5rem !important;
    /* Force smaller padding on mobile */
    border-radius: 12px;
  }
}

.glass-panel:hover {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
}

/* Typography */
h1,
h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

p {
  font-size: 1.1rem;
}

@media (max-width: 768px) {
  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.6rem;
  }

  h3 {
    font-size: 1.3rem;
  }

  p {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  h3 {
    font-size: 1.2rem;
  }

  p {
    font-size: 0.95rem;
  }
}

h1 {
  font-size: 2.5rem;
  letter-spacing: -0.05em;
  background: linear-gradient(90deg, #58a6ff, #a371f7);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@media (max-width: 768px) {
  h1 {
    font-size: 1.8rem;
  }
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-hover);
}

/* Layout */
.hero-subheading {
  font-size: 1.2rem;
  max-width: 800px;
}

@media (max-width: 768px) {
  .hero-subheading {
    font-size: 1rem;
    padding: 0 1rem;
  }
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 4rem 2rem;
  text-align: center;
}

@media (max-width: 768px) {
  .main-content {
    padding: 2rem 1rem;
  }
}

/* Header/Nav */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  max-width: 100%;
  /* Fully span the top layer */
  margin: 0 auto;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(13, 17, 23, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: nowrap;
  gap: 1rem;
}

@media (max-width: 768px) {
  header {
    padding: 0.8rem 1rem;
    flex-direction: column;
    gap: 0.5rem;
  }

  .logo {
    font-size: 1.2rem;
  }

  .nav-links {
    font-size: 0.85rem;
    gap: 0.8rem;
    width: 100%;
    justify-content: center;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 101;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  transition: 0.3s;
}

.settings-btn {
  display: none;
  font-size: 1.2rem;
  color: var(--text-primary);
}

.desktop-settings {
  margin-left: 1rem;
}

.nav-links a {
  color: var(--text-primary);
  font-weight: 500;
}

.nav-links a:hover {
  color: #fff;
}

/* Forms & Inputs */
.url-bar-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  position: relative;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
  /* Very subtle outer edge */
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.url-bar-container:focus-within {
  transform: scale(1.02);
  border-color: var(--accent-color);
  box-shadow: 0 4px 25px rgba(88, 166, 255, 0.2);
}

.url-input {
  flex: 1;
  padding: 1.2rem 1.5rem;
  font-size: 1.1rem;
  background: var(--input-bg);
  border: none;
  /* Removed internal border */
  color: #fff;
  border-radius: 30px 0 0 30px;
  outline: none;
  transition: background 0.2s;
}

.url-input:focus {
  background: rgba(255, 255, 255, 0.05);
}

.go-btn {
  padding: 1.2rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  background: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 0 30px 30px 0;
  cursor: pointer;
  transition: all 0.2s;
}

.go-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 15px rgba(88, 166, 255, 0.4);
}

/* Server Selector Chips */
.server-selector {
  width: 100%;
  max-width: 900px;
  margin: 2rem auto 0;
}

.server-label {
  display: block;
  margin-bottom: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
}

.chip {
  padding: 0.6rem 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .chip {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 8px;
  }

  .chips-container {
    gap: 0.5rem;
    justify-content: center;
  }
}

.chip:hover {
  background: var(--panel-border);
  transform: translateY(-2px);
}

.chip.active {
  background: rgba(88, 166, 255, 0.1);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

/* Settings Page */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.settings-card {
  padding: 2rem;
  text-align: left;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #fff;
}

select.form-control,
input.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--input-bg);
  border: 1px solid var(--panel-border);
  color: #fff;
  border-radius: 8px;
  outline: none;
  font-size: 1rem;
}

select.form-control:focus,
input.form-control:focus {
  border-color: var(--accent-color);
}

/* Custom Checkbox / Toggle */
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
}

.toggle-switch input {
  display: none;
}

.slider {
  min-width: 50px;
  height: 26px;
  background-color: var(--card-bg);
  border: 1px solid var(--panel-border);
  border-radius: 26px;
  position: relative;
  transition: 0.3s;
  display: inline-block;
}

.slider:before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: 0.3s;
}

.toggle-switch input:checked+.slider {
  background-color: var(--success-color);
  border-color: var(--success-color);
}

.toggle-switch input:checked+.slider:before {
  transform: translateX(24px);
  background-color: #fff;
}

/* Tables (Cookies) */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th,
td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--panel-border);
}

th {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.btn-danger {
  background: transparent;
  color: var(--danger-color);
  border: 1px solid var(--danger-color);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.85rem;
}

.btn-danger:hover {
  background: var(--danger-color);
  color: #fff;
}

/* Toolbar Injected into Proxied Pages */
#proxy-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 48px;
  background: var(--toolbar-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--panel-border);
  z-index: 2147483647;
  /* Max z-index */
  display: flex;
  align-items: center;
  padding: 0 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  font-family: 'Inter', sans-serif;
  color: #fff;
}

#proxy-toolbar .tb-logo {
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 1.5rem;
}

#proxy-toolbar form {
  flex: 1;
  display: flex;
  max-width: 600px;
  height: 32px;
}

#proxy-toolbar input {
  flex: 1;
  background: var(--input-bg);
  border: 1px solid var(--panel-border);
  border-right: none;
  border-radius: 16px 0 0 16px;
  color: #fff;
  padding: 0 1rem;
  outline: none;
  font-size: 0.9rem;
}

#proxy-toolbar button {
  background: var(--accent-color);
  border: none;
  color: #fff;
  padding: 0 1rem;
  border-radius: 0 16px 16px 0;
  font-weight: 600;
  cursor: pointer;
}

#proxy-toolbar button:hover {
  background: var(--accent-hover);
}

#proxy-toolbar .tb-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

#proxy-toolbar .tb-badge {
  background: rgba(46, 160, 67, 0.2);
  color: var(--success-color);
  border: 1px solid rgba(46, 160, 67, 0.4);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

#proxy-toolbar .tb-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
}

#proxy-toolbar .tb-link:hover {
  color: #fff;
}

/* Error page */
.error-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade {
  animation: fadeIn 0.5s ease forwards;
}

/* SEO and FAQ Sections */
.seo-section .glass-panel {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
}

.faq-item {
  transition: all 0.3s ease;
}

.faq-item:hover {
  transform: translateX(5px);
}

/* Consolidated Mobile Overrides */
@media (max-width: 768px) {
  h1 {
    font-size: 1.6rem !important;
  }

  h2 {
    font-size: 1.4rem !important;
  }

  h3 {
    font-size: 1.2rem !important;
  }

  p,
  li {
    font-size: 0.95rem !important;
  }

  header {
    padding: 1rem !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    flex-wrap: wrap;
    /* Allow for dropdown */
  }

  .header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .hamburger {
    display: block !important;
  }

  .settings-btn {
    display: block !important;
  }

  .desktop-settings {
    display: none !important;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100% !important;
    background: rgba(13, 17, 23, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    flex-direction: column !important;
    align-items: center !important;
    padding: 2rem !important;
    gap: 1.5rem !important;
    border-bottom: 1px solid var(--panel-border);
    display: none !important;
    z-index: 99;
  }

  .nav-links.active {
    display: flex !important;
  }

  .hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
  }

  .main-content {
    padding: 2rem 1rem !important;
  }

  /* STACKING URL BAR */
  .url-bar-container {
    flex-direction: column !important;
    gap: 0.8rem !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  .url-input {
    width: 100% !important;
    border-radius: 12px !important;
    border: 1px solid var(--panel-border) !important;
    height: 54px !important;
    text-align: center !important;
  }

  .go-btn {
    width: 100% !important;
    border-radius: 12px !important;
    height: 54px !important;
    justify-content: center !important;
  }

  .glass-panel {
    padding: 1.5rem !important;
  }

  .chips-container {
    gap: 0.5rem !important;
  }

  .chip {
    padding: 0.5rem 0.8rem !important;
    font-size: 0.8rem !important;
  }

  .footer-address {
    font-size: 0.65rem !important;
    opacity: 0.6;
    display: block;
    margin-top: 0.4rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.4rem !important;
  }

  h2 {
    font-size: 1.3rem !important;
  }

  .logo {
    font-size: 1.1rem !important;
  }
}