:root {
  --primary-color: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #dbeafe;
  --secondary-color: #3b82f6;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #0ea5e9;
  --dark-color: #1f2937;
  --light-color: #f9fafb;
  --gray-color: #6b7280;
  --gray-light: #e5e7eb;
}

/* Dark mode variables */
body.dark-mode {
  --primary-light: #1e3a8a;
  --light-color: #111827;
  --dark-color: #f9fafb;
  --gray-light: #374151;
  --gray-color: #9ca3af;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

body {
  background-color: var(--light-color);
  color: var(--dark-color);
  line-height: 1.6;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s, color 0.3s;
}

/* Skip to content link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

header {
  background-color: var(--primary-color);
  color: white;
  padding: 1.5rem 0;
  text-align: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.header-container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.dark-mode-toggle {
  position: absolute;
  right: 0;
  top: 0;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background-color 0.2s;
}

.dark-mode-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
}

.main-title {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 1.1rem;
  font-weight: 400;
  opacity: 0.9;
}

.ip-badge,
.fingerprint-badge {
  background-color: var(--primary-dark);
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  display: inline-block;
  margin-top: 1rem;
  font-size: 1.25rem;
  font-weight: bold;
}

.nav-links,
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  color: white;
}

.breadcrumb {
  gap: 0.5rem;
}

.nav-links a,
.breadcrumb a {
  color: white;
  text-decoration: none;
  padding: 0.3rem 0.7rem;
  border-radius: 0.25rem;
  transition: background-color 0.2s;
  opacity: 0.9;
}

.nav-links a:hover,
.breadcrumb a:hover {
  background-color: rgba(255, 255, 255, 0.2);
  text-decoration: underline;
  opacity: 1;
}

.breadcrumb-separator {
  margin: 0 0.25rem;
}

main.container {
  width: 90%;
  max-width: 1200px;
  margin: 2rem auto;
  flex: 1;
}

.intro-text {
  margin-bottom: 2rem;
  line-height: 1.7;
}

.intro-text h2 {
  color: var(--primary-dark);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.intro-text p {
  margin-bottom: 1rem;
  color: var(--dark-color);
}

.intro-text ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.intro-text li {
  margin-bottom: 0.5rem;
}

.section {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  overflow: hidden;
}

body.dark-mode .section {
  background-color: #1f2937;
}

.section-header {
  background-color: var(--primary-light);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--gray-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-icon {
  width: 1.5rem;
  height: 1.5rem;
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.75rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-dark);
  flex: 1;
}

.copy-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.copy-btn:hover {
  background-color: var(--primary-dark);
}

.copy-btn:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.search-box {
  display: flex;
  margin-bottom: 1.5rem;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-input {
  flex: 1;
  padding: 1rem;
  border: 1px solid var(--gray-light);
  border-right: none;
  border-radius: 0.5rem 0 0 0.5rem;
  font-size: 1rem;
  background-color: white;
  color: var(--dark-color);
}

body.dark-mode .search-input {
  background-color: #374151;
  color: white;
  border-color: #4b5563;
}

.search-button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 1rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.search-button:hover {
  background-color: var(--primary-dark);
}

.section-content {
  padding: 1rem 1.5rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.info-item {
  border: 1px solid var(--gray-light);
  border-radius: 0.375rem;
  padding: 0.75rem;
}

.info-label {
  font-size: 0.875rem;
  color: var(--gray-color);
  margin-bottom: 0.25rem;
}

.info-value {
  font-weight: 500;
  word-break: break-all;
  color: var(--dark-color);
}

.info-value-code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.875rem;
  background-color: var(--gray-light);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
}

.map-container {
  width: 100%;
  height: 400px;
  background-color: var(--gray-light);
  margin-top: 1rem;
  border-radius: 0.5rem;
  overflow: hidden;
  position: relative;
}

.map-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--gray-color);
}

.canvas-container {
  width: 100%;
  max-width: 400px;
  height: 200px;
  margin: 1rem auto;
  border: 1px solid var(--gray-light);
  border-radius: 0.5rem;
  overflow: hidden;
}

.fingerprint-result {
  background-color: var(--primary-light);
  padding: 1.5rem;
  border-radius: 0.5rem;
  text-align: center;
  margin: 1.5rem 0;
}

.fingerprint-hash {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.25rem;
  word-break: break-all;
  margin: 1rem 0;
  padding: 0.75rem;
  background-color: white;
  border-radius: 0.25rem;
  border: 1px solid var(--gray-light);
  display: inline-block;
  min-width: 50%;
}

body.dark-mode .fingerprint-hash {
  background-color: #374151;
  color: white;
}

.uniqueness-meter {
  width: 100%;
  max-width: 400px;
  margin: 1.5rem auto;
  position: relative;
}

.uniqueness-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-color);
}

.data-table,
.history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.data-table th,
.data-table td,
.history-table th,
.history-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-light);
}

.data-table th,
.history-table th {
  background-color: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}

.data-table tr:nth-child(even),
.history-table tbody tr:nth-child(even) {
  background-color: var(--gray-light);
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-success {
  background-color: var(--success-color);
  color: white;
}

.badge-warning {
  background-color: var(--warning-color);
  color: white;
}

.badge-danger {
  background-color: var(--danger-color);
  color: white;
}

.badge-info {
  background-color: var(--info-color);
  color: white;
}

.text-wrap {
  white-space: pre-wrap;
  word-break: break-all;
}

pre {
  background-color: var(--gray-light);
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.875rem;
}

.tab-container {
  margin-top: 1rem;
}

.tab-menu {
  display: flex;
  border-bottom: 1px solid var(--gray-light);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 0.5rem 1rem;
  border: none;
  background: none;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: var(--gray-color);
  transition: all 0.2s;
}

.tab-btn.active {
  border-bottom-color: var(--primary-color);
  color: var(--primary-color);
}

.tab-btn:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: -2px;
}

.tab-content {
  display: none;
}

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

.progress-container {
  width: 100%;
  height: 8px;
  background-color: var(--gray-light);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.progress-bar {
  height: 100%;
  background-color: var(--primary-color);
  border-radius: 4px;
  transition: width 1s ease-in-out;
}

/* FAQ Styles */
.faq-item {
  margin-bottom: 1.5rem;
  border: 1px solid var(--gray-light);
  border-radius: 0.5rem;
  overflow: hidden;
}

.faq-question {
  background-color: var(--primary-light);
  padding: 1rem;
  font-size: 1.1rem;
  color: var(--primary-dark);
  margin: 0;
  cursor: pointer;
  position: relative;
  font-weight: 600;
}

.faq-question:hover {
  background-color: rgba(219, 234, 254, 0.7);
}

.faq-question::after {
  content: "+";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: var(--primary-color);
}

.faq-answer {
  padding: 0 1rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-question::after {
  content: "-";
}

.faq-item.active .faq-answer {
  padding: 1rem;
  max-height: 2000px;
}

.faq-answer p {
  margin-bottom: 1rem;
}

.faq-answer ul {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.faq-answer li {
  margin-bottom: 0.5rem;
}

/* Protection methods and related tools */
.protection-methods,
.related-tools {
  margin-top: 2rem;
}

.protection-item {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-light);
}

.protection-item h3,
.related-tools h3 {
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.protection-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

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

.related-tool-card {
  border: 1px solid var(--gray-light);
  border-radius: 0.5rem;
  padding: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.related-tool-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.related-tool-card h4 {
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.related-tool-card p {
  color: var(--gray-color);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.related-tool-card a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  display: inline-block;
  margin-top: 0.5rem;
}

.related-tool-card a:hover {
  text-decoration: underline;
}

footer {
  background-color: var(--dark-color);
  color: white;
  text-align: center;
  padding: 1.5rem 0;
  margin-top: 2rem;
}

body.dark-mode footer {
  background-color: #0f1419;
}

.footer-text {
  opacity: 0.8;
  font-size: 0.875rem;
}

.footer-links {
  margin-top: 1rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links a {
  color: white;
  text-decoration: none;
  opacity: 0.8;
}

.footer-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--success-color);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.25rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 1000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.error-message {
  background-color: #fee2e2;
  border: 1px solid #ef4444;
  color: #991b1b;
  padding: 1rem;
  border-radius: 0.5rem;
  margin: 1rem 0;
}

body.dark-mode .error-message {
  background-color: #7f1d1d;
  border-color: #ef4444;
  color: #fee2e2;
}

.loading {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--gray-light);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
  .main-title {
    font-size: 1.75rem;
  }

  .subtitle {
    font-size: 0.875rem;
  }

  .ip-badge,
  .fingerprint-badge {
    font-size: 1rem;
  }

  .dark-mode-toggle {
    position: static;
    margin-top: 1rem;
  }

  .section-title {
    font-size: 1.125rem;
  }

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

  .map-container {
    height: 300px;
  }

  .search-box {
    flex-direction: column;
  }

  .search-input {
    border-radius: 0.5rem 0.5rem 0 0;
    border-right: 1px solid var(--gray-light);
    border-bottom: none;
  }

  .search-button {
    border-radius: 0 0 0.5rem 0.5rem;
    padding: 0.75rem;
  }

  .tab-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }

  .faq-question {
    font-size: 1rem;
    padding: 0.75rem;
  }

  .fingerprint-hash {
    font-size: 1rem;
    padding: 0.5rem;
  }

  .nav-links {
    gap: 0.5rem;
    margin-top: 0.75rem;
  }

  .nav-links a {
    font-size: 0.875rem;
    padding: 0.2rem 0.5rem;
  }

  .related-tools-grid {
    grid-template-columns: 1fr;
  }
}

/* Print styles */
@media print {
  header,
  footer,
  .nav-links,
  .copy-btn,
  .dark-mode-toggle,
  .toast,
  .search-box,
  .tab-menu {
    display: none;
  }

  .section {
    page-break-inside: avoid;
  }

  body {
    font-size: 12pt;
  }
}
