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

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  background-color: #f5f5f5;
  min-height: 100vh;
  overflow-x: hidden;
}

#test-log {
  color: black;
  font-size: 2rem;
  position: absolute;
  z-index: 999;
  top: 50%;
  left: 20%;
}

/* Navbar Styles */
.navbar {
  width: 250px;
  height: 100vh;
  background-color: #1e2a3a;
  color: white;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.navbar-header {
  padding: 25px 20px;
  background-color: #1e2a3a;
  text-align: left;
  font-size: 24px;
  font-weight: bold;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.nav-items {
  list-style: none;
  font-size: 1.2rem;
  padding: 0;
  margin: 0;
  width: 100%;
}

.nav-item {
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background-color 0.2s;
  text-align: left;
}

.nav-item:hover {
  background-color: #34495e;
}

.nav-item.active {
  background-color: #3498db;
  position: relative;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background-color: white;
}

.fixed-mobile-navbar {
  display: none; /* hidden by default on desktop */
  position: sticky;
  background-color: #1e2a3a;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  z-index: 1000;
}

/* Hamburger Menu */
.hamburger-menu {
  display: none;
  position: fixed;
  left: 20px;
  z-index: 110;
  cursor: pointer;
  background-color: #1e2a3a;
  border-radius: 8px;
  padding: 10px;
}

.hamburger-menu div {
  width: 25px;
  height: 3px;
  background-color: white;
  margin: 5px 0;
  transition: 0.4s;
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  margin-left: 250px;
  width: calc(100% - 250px);
  height: 100vh;
  overflow-y: auto;
  padding: 30px;
  background-color: #f5f7fa;
}

#diagnostic {
  max-width: 1400px;
  margin: 0 auto;
}

#diagnostic h1 {
  font-size: 2.5rem;
  margin-bottom: 30px;
  color: #2c3e50;
  text-align: center;
}

/* Content Sections */
.content-section {
  display: none;
  padding: 0 0 30px 0;
}

.content-section.active {
  display: block;
}

/* Section headers */
.content-section h2 {
  font-size: 1.8rem;
  border-bottom: 2px solid #3498db;
  padding-bottom: 10px;
  margin-bottom: 25px;
  color: #2c3e50;
}

/* Info list container */
.info-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  /* gap: 20px; */
  margin-bottom: 30px;
}
/* Info items (cards) */
.info-item {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  border-left: 4px solid #3498db;
  margin: 20px;
}

/* Card headers */
.info-item-header {
  background-color: #f7f9fc;
  padding: 15px 20px;
  font-size: 1.2rem;
  font-weight: 600;
  color: #2c3e50;
  border-bottom: 1px solid #e1e5eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Card content area */
.info-item-content {
  padding: 0;
}

/* Data rows - much clearer format with table-like structure */
.data-row {
  display: flex;
  border-bottom: 1px solid #eef2f7;
}

.data-row:last-child {
  border-bottom: none;
}

/* Equal width columns for labels and values */
.data-label {
  flex: 0 0 40%;
  padding: 12px 15px;
  background-color: #f8fafc;
  font-weight: bold;
  font-size: 1.2rem;
  color: #4a5568;
  border-right: 1px solid #eef2f7;
}

.data-value {
  flex: 0 0 60%;
  padding: 12px 15px;
  font-size: 1.2rem;
  color: #2d3748;
}

/* Status indicators */
.status-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-left: 8px;
}

.status-good {
  background-color: #2ecc71;
  box-shadow: 0 0 5px #2ecc71;
}

.status-warning {
  background-color: #f39c12;
  box-shadow: 0 0 5px #f39c12;
}

.status-error {
  background-color: #e74c3c;
  box-shadow: 0 0 5px #e74c3c;
}

/* For very long text values like user agent */
.data-value.long-text {
  word-break: break-word;
}

/* Button styles (from your original CSS) */
button {
  padding: 1.5rem 2rem;
  border: 2px solid transparent;
  background-color: #555;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.5rem;
  transition: all 0.3s;
  opacity: 0.7;
  transform: scale(0.9);
}

button:hover {
  opacity: 0.85;
  transform: scale(0.97);
}

/* Style for the selected/focused button */
button:focus,
button.selected {
  background-color: #333;
  opacity: 1;
  transform: scale(1);
  border: 2px solid #4a90e2;
  box-shadow: 0 0 15px rgba(74, 144, 226, 0.5);
  outline: none;
}

/* Responsive Adjustments */
@media (min-width: 1200px) {
  #diagnostic h1 {
    font-size: 3rem;
  }

  button {
    padding: 2rem;
    font-size: 2rem;
  }
}

@media (max-width: 1024px) {
  .info-list {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .navbar {
    position: fixed;
    left: -250px;
    transition: transform 0.3s ease;
  }

  .navbar.active {
    transform: translateX(250px);
  }

  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 20px;
  }

  .hamburger-menu {
    display: block;
  }

  .close-menu {
    display: block;
  }

  .info-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .data-row {
    flex-direction: column;
  }

  .data-label {
    flex: 1 0 auto;
    border-right: none;
    border-bottom: 1px solid #eef2f7;
  }

  .data-value {
    flex: 1 0 auto;
  }

  #diagnostic h1 {
    font-size: 1.8rem;
  }

  .content-section h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 768px) {
  .fixed-mobile-navbar {
    display: flex;
    align-items: center;
  }

  .main-content {
    padding-top: 20px;
  }

  /* When mobile menu is active, make it appear below the permanent navbar */
  .navbar.active {
    top: 60px;
    height: calc(100vh - 60px);
  }
}

/* AD STYLES */

/* Ad zone styling */
.navbar-ad-zone {
  width: 160px;
  height: 600px;
  margin: 20px auto;
  background-color: rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner-ads-zone {
  width: 100%;
  height: 90px;
  margin: 15px 0;
  background-color: rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-ads-zone {
  width: 300px;
  height: 250px;
  margin: 20px auto;
  background-color: rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* FIXED TOGGLE SWITCH STYLES */

/* Base toggle container */
.switch {
  position: relative;
  display: inline-block;
  width: 70px;
  height: 40px;
  margin: 10px;
  border-radius: 40px;
}

/* Hide the default checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider (background track) */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 40px;
}

/* The handle/button on the slider */
.slider:before {
  position: absolute;
  content: "";
  height: 32px;
  width: 32px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Checked state styling */
input:checked + .slider {
  background-color: #2c3e50;
}

input:checked + .slider:before {
  transform: translateX(30px);
}

/* Focus styles for TV navigation */
.switch:focus-within {
  outline: 4px solid #3498db;
  box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.3);
}

/* When keyboard navigating, make it super obvious */
.switch input:focus + .slider {
  box-shadow: 0 0 10px #3498db;
}

/* Add ON/OFF text directly on the slider instead of using pseudo-elements */
.slider .switch-text-off,
.slider .switch-text-on {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-weight: bold;
  pointer-events: none;
}

.slider .switch-text-off {
  right: 8px;
  color: #555;
  opacity: 1;
}

.slider .switch-text-on {
  left: 10px;
  color: white;
  opacity: 0;
}

input:checked + .slider .switch-text-off {
  opacity: 0;
}

input:checked + .slider .switch-text-on {
  opacity: 1;
}

/* Enhanced interactive element focus styles for TV remote */
input[type="checkbox"]:focus,
input[type="radio"]:focus,
select:focus,
button:focus,
a:focus,
[tabindex="0"]:focus {
  outline: 3px solid #3498db;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.4);
}

/* Ensure options page elements are properly tab-indexable */
#Options-page input,
#Options-page select,
#Options-page button {
  /* This ensures they're properly focusable */
  tabindex: 0;
}

/* Make currently focused element more visible */
:focus {
  outline: 3px solid #3498db !important;
  outline-offset: 2px !important;
}

/* Responsive adjustments for the toggle */
@media (max-width: 768px) {
  .switch {
    width: 60px;
    height: 34px;
  }

  .slider:before {
    height: 26px;
    width: 26px;
  }

  input:checked + .slider:before {
    transform: translateX(26px);
  }
}

/* Options page layout */
.options-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  background-color: white;
  border-radius: 8px;
  margin-bottom: 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.option-label {
  font-size: 1.2rem;
  font-weight: 600;
  color: #2c3e50;
}
