:root {
  --primary: #4361ee;
  --primary-hover: #3a56d4;
  --secondary: #64748b;
  --light: #f8fafc;
  --dark: #1e293b;
  --success: #22c55e;
  --error: #ef4444;
  --border: #e0e7ff;
  --background: #f9fafb;
  --card-bg: #ffffff;
  --text: #334155;
  --text-secondary: #64748b;
  --heading: #1e293b;
  --warning: #f59e0b;
  --gradient-start: #4361ee;
  --gradient-end: #3730a3;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--background);
  padding: 20px;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1400px;
  width: 90vw;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Modern Header Styles */
.modern-header {
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(67, 97, 238, 0.15);
  position: relative; /* Allow absolute-positioned header elements */
}

/* Navigation links */
.nav-links {
  display: flex;
  margin-top: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 10px;
}

.nav-link {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  margin-right: 25px;
  padding: 5px 0;
  font-weight: 500;
  font-size: 16px;
  transition: all 0.2s ease;
  position: relative;
}

.menu-icon {
  display: inline-flex;
  align-items: center;
  margin-right: 6px;
  font-size: 0.9em;
  opacity: 0.75;
}

.nav-link:hover {
  color: white;
}

.nav-link.active {
  color: white;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -11px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: white;
  border-radius: 3px 3px 0 0;
}

.modern-header .header-content {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
}

.modern-header .header-text {
  text-align: left;
  flex: 1;
  max-width: 600px;
}

.modern-header h1 {
  color: white;
  margin-bottom: 8px;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.modern-header p.subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.1rem;
  line-height: 1.5;
}

/* Compact hamburger navigation */
.header-nav {
  position: relative;
  display: inline-block;
  margin: 0 0 32px;
}

.hamburger-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(12, 19, 79, 0.18);
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  backdrop-filter: blur(6px);
}

.hamburger-label {
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}

.hamburger-button:hover,
.hamburger-button:focus {
  outline: none;
  background: rgba(12, 19, 79, 0.28);
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
}

.hamburger-icon {
  position: relative;
  width: 20px;
  height: 14px;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger-line {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hamburger-button[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.hamburger-button[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-button[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.hamburger-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  min-width: 220px;
  padding: 12px 0;
  border-radius: 16px;
  background: rgba(5, 10, 35, 0.85);
  box-shadow: 0 18px 35px rgba(10, 20, 60, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 20;
}

.hamburger-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.hamburger-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.hamburger-link:hover,
.hamburger-link:focus {
  background: rgba(67, 97, 238, 0.2);
  color: white;
}

.hamburger-link.active {
  color: white;
  background: rgba(67, 97, 238, 0.35);
}

@media (max-width: 768px) {
  .modern-header .header-content {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-nav {
    margin-bottom: 28px;
  }
}

/* Logo Container with Particle Animation */
.logo-container {
  position: relative;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  margin-right: 10px; /* Add some margin to separate from text */
}

.particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none; /* Allow clicks through to elements behind */
}

.header-icon {
  width: 65px;
  height: 65px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.7));
  position: relative;
  z-index: 3;
  animation: glow 3s ease-in-out infinite;
}

.icon-pulse {
  position: absolute;
  width: 80%;
  height: 80%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  transform-origin: center;
  animation: pulse-ring 3s ease-in-out infinite;
}

@keyframes glow {
  0% { filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.9)); transform: scale(1.05); }
  100% { filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6)); transform: scale(1); }
}

@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 0.4; }
  50% { transform: scale(1.1); opacity: 0.2; }
  100% { transform: scale(0.8); opacity: 0.4; }
}

/* Original header styles (keeping for reference) */
header {
  margin-bottom: 40px;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.header-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

h1 {
  color: var(--heading);
  margin-bottom: 16px;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

p.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.5;
}

.card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
  padding: 40px;
  margin-bottom: 30px;
  width: 100%;
}

/* Navigation links */
.nav-links {
  display: flex;
  margin-top: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 10px;
}

.nav-link {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  margin-right: 25px;
  padding: 5px 0;
  font-weight: 500;
  font-size: 16px;
  transition: all 0.2s ease;
  position: relative;
}

.nav-link:hover {
  color: white;
}

.nav-link.active {
  color: white;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -11px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: white;
  border-radius: 3px 3px 0 0;
}

/* Form Elements */
.form-group {
  margin-bottom: 24px;
}

.form-group-info {
  margin-bottom: 20px;
  padding: 12px 16px;
  background-color: #f0f9ff;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--heading);
  font-size: 0.95rem;
}

/* Form Elements - Clean and minimal appearance */
textarea, select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.2s ease;
  color: var(--text);
  background-color: var(--card-bg);
}

textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.6;
  font-family: inherit;
}

textarea:focus, select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

/* Slider Toggle Switch for Check Translation */
.switch-container {
  display: flex;
  align-items: center;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
  margin-right: 10px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e2e8f0;
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--primary);
}

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

.switch-label {
  font-weight: 500;
  color: var(--heading);
  font-size: 0.95rem;
}

button {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: block;
  width: 100%;
  margin-top: 16px;
}

button:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  background-color: #cbd5e1;
  cursor: not-allowed;
  transform: none;
}

/* Retro Audio Gauge Styles - Simplified */
.audio-gauge-container {
  width: 100%;
  margin: 15px 0;
  padding: 8px;
  background: #1a1a1a;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.gauge-display {
  position: relative;
  background: #111;
  height: 50px;
  border-radius: 6px;
  padding: 4px;
  display: flex;
  align-items: center;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
  overflow: hidden;
}

.gauge-value {
  position: absolute;
  font-family: monospace, 'Courier New', Courier;
  color: #0ff;
  font-size: 24px;
  font-weight: bold;
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.8);
  right: 15px;
  z-index: 3;
}

.gauge-label {
  position: absolute;
  left: 15px;
  color: #999;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: bold;
  z-index: 3;
  top: 18px;
}

.gauge-bars {
  display: flex;
  width: 100%;
  height: 28px;
  align-items: center;
  gap: 2px;
  padding: 0 60px;
}

.gauge-bar {
  flex: 1;
  background: #222;
  height: 100%;
  border-radius: 1px;
  transition: all 0.2s ease;
}

.gauge-bar.active {
  animation: pulse 1.5s infinite;
  box-shadow: 0 0 5px rgba(255,255,255,0.5);
}

/* Remove variation in bar heights */
.gauge-bar:nth-child(5n+1) {
  height: 100%;
}

.gauge-level-poor .gauge-bar.active {
  background: linear-gradient(to top, #f00, #f70);
}

.gauge-level-average .gauge-bar.active {
  background: linear-gradient(to top, #ff0, #fa0);
}

.gauge-level-good .gauge-bar.active {
  background: linear-gradient(to top, #0f0, #3f3);
}

.gauge-level-excellent .gauge-bar.active {
  background: linear-gradient(to top, #0f0, #0ff);
}

.gauge-ticks {
  position: absolute;
  bottom: 2px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 70px;
  color: #666;
  font-size: 9px;
}

.gauge-tick {
  position: relative;
}

.gauge-tick::before {
  content: '';
  position: absolute;
  height: 2px;
  width: 1px;
  background: #666;
  top: -4px;
  left: 50%;
}

@keyframes pulse {
  0% { opacity: 1; box-shadow: 0 0 5px rgba(255,255,255,0.5); }
  50% { opacity: 0.8; box-shadow: 0 0 8px rgba(255,255,255,0.7); }
  100% { opacity: 1; box-shadow: 0 0 5px rgba(255,255,255,0.5); }
}

/* Digital-7 font is not necessary for this application, using system fonts instead */

/* Loading */
.loading {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

.spinner {
  border: 3px solid rgba(67, 97, 238, 0.2);
  border-left: 3px solid var(--primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

/* Progress Bar Styles */
.progress-container {
  width: 100%;
  height: 12px;
  background-color: #e2e8f0;
  border-radius: 6px;
  margin-top: 20px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #3b82f6 100%);
  border-radius: 6px;
  transition: width 0.1s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

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

/* Result Display - Improved Visual Layout */
.result {
  display: none;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid #e2e8f0;
}

.result h3 {
  margin-bottom: 24px;
  color: var(--heading);
  font-size: 1.5rem;
  font-weight: 600;
}

/* Visual Results Summary */
.results-summary {
  margin-bottom: 30px;
}

.result-card {
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.result-card-header {
  padding: 16px 20px;
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-card-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--heading);
  margin: 0;
}

.result-card-body {
  padding: 20px;
}

/* Score Indicator */
.score-indicator {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.score-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.4rem;
  color: white;
  margin-right: 16px;
  flex-shrink: 0;
}

.score-excellent {
  background-color: var(--success);
}

.score-good {
  background-color: #3b82f6;
}

.score-average {
  background-color: var(--warning);
}

.score-poor {
  background-color: var(--error);
}

.score-details {
  flex: 1;
}

.score-label {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--heading);
}

.score-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Issues List */
.issues-list {
  margin-top: 16px;
  font-size: 0.95rem;
}

.issue-item {
  padding: 12px 16px;
  border-left: 3px solid var(--warning);
  background-color: #fffbeb;
  border-radius: 6px;
  margin-bottom: 10px;
}

.issue-item:last-child {
  margin-bottom: 0;
}

/* Language Results Tabs */
.result-language-tabs {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 20px;
}

.result-lang-tab {
  padding: 10px 20px;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.result-lang-tab:hover {
  color: var(--text);
}

.result-lang-tab.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

.result-lang-content {
  display: none;
}

.result-lang-content.active {
  display: block;
}

/* Raw JSON Toggle */
.raw-json-toggle {
  background-color: #f1f5f9;
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: all 0.2s ease;
  border: 1px solid #e2e8f0;
}

.raw-json-toggle:hover {
  background-color: #e2e8f0;
}

.raw-json-toggle span {
  font-weight: 500;
  color: var(--text-secondary);
}

.raw-json-toggle .toggle-icon {
  transition: transform 0.3s ease;
}

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

/* JSON Viewer Styles */
.json-container {
  display: none;
  background-color: #f8fafc;
  border-radius: 8px;
  padding: 20px;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  margin-top: 16px;
}

.json-container.visible {
  display: block;
}

.json-key {
  color: #8b5cf6;
}

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

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

.json-boolean {
  color: #ef4444;
}

.json-null {
  color: #94a3b8;
}

.json-holder {
  padding-left: 24px;
  border-left: 1px solid #e2e8f0;
  margin-left: 4px;
}

.json-collapsible {
  cursor: pointer;
  user-select: none;
}

.json-collapsible::after {
  content: "▼";
  color: #94a3b8;
  font-size: 10px;
  margin-left: 5px;
}

.json-collapsible.collapsed::after {
  content: "►";
}

.json-collapsible.collapsed + .json-holder {
  display: none;
}

.alert {
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 24px;
  display: none;
  font-size: 0.95rem;
  line-height: 1.5;
}

.alert-error {
  background-color: #fef2f2;
  border-left: 4px solid #ef4444;
  color: #b91c1c;
}

footer {
  text-align: center;
  margin-top: 40px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Input Language Tabs */
.input-language-tabs {
  display: flex;
  margin-bottom: 0;
  border-bottom: none;
}

.lang-tab {
  padding: 12px 20px;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  border-radius: 8px 8px 0 0;
  background-color: #f1f5f9;
  margin-right: 4px;
}

.lang-tab:hover {
  background-color: #e2e8f0;
  color: var(--text);
}

.lang-tab.active {
  background-color: var(--card-bg);
  color: var(--primary);
  font-weight: 500;
  border: 1px solid #e2e8f0;
  border-bottom: 1px solid white;
  position: relative;
  z-index: 1;
}

.input-language-contents {
  position: relative;
  top: -1px;
}

.input-language-contents .lang-content {
  padding: 20px;
  background-color: var(--card-bg);
  border: 1px solid #e2e8f0;
  border-radius: 0 8px 8px 8px;
  display: none;
}

.input-language-contents .lang-content.active {
  display: block;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .card {
    padding: 24px;
  }

  .input-language-tabs {
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
  }

  .input-language-tabs::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
  }
  
  .lang-tab {
    padding: 10px 16px;
    white-space: nowrap;
  }

  .score-indicator {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .score-circle {
    margin-bottom: 12px;
    margin-right: 0;
  }
  
  .result-language-tabs {
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .result-language-tabs::-webkit-scrollbar {
    display: none;
  }
}
