:root {
  --primary-color: #8a691a;
  --secondary-color: #ae8226;
  --accent-color: #8a691a;
  --text-color: #f8fafc;
  --card-bg: rgba(255, 255, 255, 0.1);
  --button-text: #ffffff;
  --section-highlight: rgba(138, 105, 26, 0.2);
  --transition-speed: 0.25s;
  --border-radius: 12px;
  --box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  --subtitle-color: #fff;
}

/* Base Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: var(--text-color);
  min-height: 100vh;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Main Container */
.license-container {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border-radius: var(--border-radius);
  padding: 2rem;
  max-width: 680px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--box-shadow);
  animation: fadeIn 0.5s ease-out;
  max-height: 90vh;
  overflow-y: auto;
}

/* Fade In Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Logo */
.logo {
  width: 100px;
  height: 100px;
  margin: 0 auto 1.5rem;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
  transition: transform var(--transition-speed);
}
.logo:hover { transform: scale(1.05); }

/* Header */
.title-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem; 
  margin-bottom: 1.5rem;
  text-align: center;
}

/* Typography */
h1, h2 {
  text-align: center;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.95);
}
h1 {
  font-size: clamp(1.5rem, 6vw, 2rem);
  font-weight: 600;
}
h2 {
  font-size: clamp(1.1rem, 4.5vw, 1.5rem);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.verified-badge {
  width: 24px;
  height: 24px;
  vertical-align: middle;
  transition: transform var(--transition-speed);
}
.verified-badge:hover { transform: scale(1.1); }

/* License Content */
.license-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.license-section {
  background: var(--card-bg);
  padding: 1.25rem;
  border-radius: var(--border-radius);
  transition: all var(--transition-speed);
  border-left: 3px solid transparent;
  cursor: pointer;
}
.license-section:hover,
.license-section:focus-within {
  border-left-color: var(--accent-color);
  transform: translateX(4px);
}
.license-section.active {
  background: var(--section-highlight);
  border-left-color: var(--accent-color);
}

/* Text */
p, ul {
  font-size: clamp(0.95rem, 4vw, 1.05rem);
  opacity: 0.9;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}
ul {
  padding-left: 1.5rem;
  text-align: left;
  list-style-type: square;
}
li {
  margin-bottom: 0.5rem;
  transition: transform var(--transition-speed);
}
li:hover {
  transform: translateX(4px);
}

/* TTS Controls */
.tts-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tts-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.tts-buttons button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card-bg);
  color: var(--text-color);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed);
}
.tts-buttons button:hover,
.tts-buttons button:focus {
  background: var(--section-highlight);
  transform: scale(1.1);
}
.tts-buttons button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.tts-buttons button#toggle {
  background: var(--accent-color);
}
.tts-buttons button#toggle:hover {
  background: #6a4f14;
}
.tts-buttons svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Read All Button */
#read-all {
  margin-top: 0.5rem;
  padding: 0.8rem 1.5rem;
  background: var(--secondary-color);
  border: none;
  border-radius: 50px;
  color: var(--text-color);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all var(--transition-speed);
}
#read-all:hover,
#read-all:focus {
  background: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Volume Slider */
.tts-volume {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.tts-volume input[type="range"] {
  width: 100%;
  max-width: 250px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  transition: all var(--transition-speed);
}
.tts-volume input[type="range"]:hover {
  background: rgba(255, 255, 255, 0.3);
}
.tts-volume input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-color);
  cursor: pointer;
  transition: transform var(--transition-speed);
}
.tts-volume input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.subtitle {
  font-size: 0.95rem;
  color: #fff !important;
  margin-top: 0.5rem;
  font-weight: 400;
  letter-spacing: 0.3px;
  line-height: 1.4;
  text-align: center;
  opacity: 0.85;
}

@media (prefers-color-scheme: dark) {
  :root {
    --subtitle-color: #aaa;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: #6a4f14;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .license-container {
    padding: 1.5rem;
    border-radius: 8px;
  }
  .license-section {
    padding: 1rem;
  }
  .tts-buttons button {
    width: 40px;
    height: 40px;
  }
}
@media (max-width: 480px) {
  body {
    padding: 0.5rem;
  }
  .logo {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
  }
  .verified-badge {
    width: 20px;
    height: 20px;
  }
  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.2rem; }
  #read-all {
    padding: 0.7rem 1.2rem;
    font-size: 0.9rem;
  }
}
@media (max-width: 360px) {
  .license-container {
    padding: 1rem;
  }
  .tts-buttons {
    gap: 0.5rem;
  }
  .tts-buttons button {
    width: 36px;
    height: 36px;
  }
  .tts-buttons svg {
    width: 18px;
    height: 18px;
  }
  #read-all span {
    display: none;
  }
  #read-all {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
}

/* Style for responsive code container */
.code-container {
    max-width: 100%;
    overflow-x: auto;
    padding: 15px;
    background-color: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin: 20px 0;
}

/* Style for code block */
pre code {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.highlighted-section {
    padding: 15px;
    margin-top: 15px;
    border-left: 3px solid #845d00; /* Blue left border */
}

.highlighted-section h3 {
    color: #6c4c00; /* Blue color for the headings */
    font-size: 1.2em;
}
