@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@500;700;800&display=swap');

:root {
  --bg-dark: #07070a;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-card-hover: rgba(255, 255, 255, 0.15);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --primary-glow: #3b82f6;
  --secondary-glow: #8b5cf6;
  --accent-color: #06b6d4;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Background Gradients */
body::before,
body::after {
  content: '';
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  z-index: -1;
  filter: blur(100px);
  opacity: 0.15;
  pointer-events: none;
}

body::before {
  top: -100px;
  left: -100px;
  background: var(--primary-glow);
}

body::after {
  bottom: -100px;
  right: -100px;
  background: var(--secondary-glow);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary-glow), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.text-danger {
  color: var(--danger);
}

.highlight-text {
  color: var(--accent-color);
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
}

/* Layout */
header {
  padding: 1.5rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-card);
  background: rgba(7, 7, 10, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.5rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  text-decoration: none;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo svg {
  width: 28px;
  height: 28px;
  color: var(--primary-glow);
}

.controls {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

/* Language Dropdown */
.lang-dropdown {
  position: relative;
  display: inline-block;
}

.lang-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.lang-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-card-hover);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: rgba(15, 15, 20, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--border-card);
  border-radius: 15px;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  z-index: 1000;
}

.lang-dropdown:hover .lang-menu,
.lang-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-item {
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
  font-weight: 500;
  font-size: 0.95rem;
}

.lang-item:hover,
.lang-item.active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.lang-flag {
  font-size: 1.2rem;
}

main {
  flex-grow: 1;
  padding: 4rem 5% 6rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Hero Section */
.hero {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 5rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
}

.hz-indicator {
  display: inline-block;
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  margin-bottom: 2.5rem;
  font-size: 1.1rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-glow), var(--secondary-glow));
  border: none;
  border-radius: 30px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
}

/* Tests Section */
.section-title {
  font-size: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-card);
  color: var(--text-main);
}

.tests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.test-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 2rem;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
}

.test-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-glow), var(--accent-color));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.test-card:hover {
  transform: translateY(-5px);
  background: var(--bg-card-hover);
  border-color: var(--border-card-hover);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.test-card:hover::before {
  transform: scaleX(1);
}

.fixer-card::before {
  background: linear-gradient(90deg, var(--danger), #f97316);
}

.fixer-card:hover {
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.2);
}

.fixer-card .test-icon {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.test-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--accent-color);
}

.test-icon svg {
  width: 24px;
  height: 24px;
}

.test-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.test-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* FAQ Accordion */
.faq-section {
  margin-top: 5rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.faq-item {
  border: 1px solid var(--border-card);
  border-radius: 12px;
  margin-bottom: 10px;
  background: var(--bg-card);
  overflow: hidden;
}

.faq-btn {
  width: 100%;
  text-align: left;
  padding: 1.25rem;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-btn::after {
  content: '+';
  font-size: 1.5rem;
  color: var(--primary-glow);
  transition: transform 0.3s;
}

.faq-btn.active::after {
  transform: rotate(45deg);
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 1.25rem;
}

.faq-content p {
  padding-bottom: 1.25rem;
  color: var(--text-muted);
}

/* Footer */
footer {
  border-top: 1px solid var(--border-card);
  padding: 2rem 5%;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: rgba(7, 7, 10, 0.8);
}

/* Fullscreen Test Overlay */
#test-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: #000;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #fff;
  cursor: none;
}

#test-overlay.active {
  display: flex;
}

#test-overlay.show-cursor {
  cursor: default;
}

.test-instructions {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  padding: 2.5rem;
  border-radius: 20px;
  text-align: center;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  opacity: 1;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 2;
}

.test-instructions.fade-out {
  opacity: 0;
}

.test-instructions h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.test-instructions p {
  font-size: 1.2rem;
  color: #ddd;
}

/* Interactive Control Panel Inside Tests */
.test-controls-panel {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: rgba(15, 15, 20, 0.85);
  padding: 10px 20px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10000;
  transition: opacity 0.3s, transform 0.3s;
}

.test-controls-panel.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(20px);
}

.control-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  transition: all 0.2s;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.4);
}

/* Epilepsy Warning Modal */
#epilepsy-warning {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
}

#epilepsy-warning.hidden {
  display: none;
}

#epilepsy-warning h2 {
  color: var(--danger);
  font-size: 3rem;
  margin-bottom: 20px;
}

/* Footer and Navigation Links */
footer {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: auto;
  border-top: 1px solid var(--border-card);
}

.footer-links {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--primary-glow);
}

/* Base Content Page Constraints */
.content-page {
  max-width: 800px;
  margin: 4rem auto;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  padding: 3rem;
  border-radius: 20px;
  color: var(--text-muted);
  line-height: 1.7;
}

.content-page h1 {
  color: var(--text-main);
  font-size: 2.2rem;
  margin-bottom: 2rem;
  text-align: center;
}

.content-page h2 {
  color: var(--text-main);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.content-page p {
  margin-bottom: 1.5rem;
}

.content-page ul {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.content-page li {
  margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.2rem;
  }

  .tests-grid {
    grid-template-columns: 1fr;
  }
}