/* YaTTI — Shared Styles
 * Extracted from common.php inline <style> block
 * Page-specific styles remain inline in each page
 */

/* === Base === */
body {
  font-family: monospace;
  line-height: 1.6;
  max-width: 900px;
  margin: 0 auto;
  padding: 120px 20px 40px 20px;
  color: #e0e0e0;
  background: #0a0a0a;
}

h1, h2 {
  font-weight: normal;
  color: #ffffff;
}

h1:not(body > h1:first-of-type) {
  margin-top: 0.5em;
}

body > h1:first-of-type {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #0a0a0a;
  border-bottom: none;
  padding: 0.5em 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8em;
  margin: 0;
  z-index: 1000;
}

h1 > * {
  max-width: 900px;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 1em;
  width: 100%;
  max-width: 900px;
  padding: 0 20px;
  flex-wrap: wrap;
}

h2 {
  margin-top: 1em;
  border-bottom: 1px solid #606060;
  padding-bottom: 0.3em;
}

.section:first-of-type h2:first-child {
  margin-top: 0.5em;
  margin-block-start: 0.5em;
}

a {
  color: #4db8ff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  color: #80ccff;
}

p {
  color: #808080;
}

/* === Logo & Title === */
.logo {
  height: 50px;
  width: auto;
}

.title-section {
  display: flex;
  align-items: center;
  gap: 0.4em;
}

.title-main {
  font-size: 0.99em;
  font-weight: normal;
  margin: 0;
  line-height: 1;
}

.title-subtitle {
  font-size: 0.55em;
  color: #808080;
  margin-top: 0.2em;
  line-height: 1.2;
}

/* === Breadcrumb === */
.breadcrumb {
  margin: 1em 0;
  padding: 0.5em 0;
  border-bottom: 1px solid #333;
  color: #808080;
}

.breadcrumb a {
  color: #4db8ff;
}

/* === Lists === */
ul {
  list-style-type: none;
  padding-left: 1em;
}

ul li:before {
  content: "- ";
  margin-left: -1em;
  color: #606060;
}

ul.repo-list {
  padding-left: 0;
}

ul.repo-list li:before {
  content: none;
}

/* === Code === */
pre {
  background: #1a1a1a;
  border: 1px solid #333;
  padding: 1em;
  overflow-x: auto;
}

code {
  background: #1a1a1a;
  padding: 0.2em 0.4em;
  border: 1px solid #333;
}

/* === Footer === */
.footer {
  margin-top: 4em;
  padding: 2em 0;
  border-top: 1px solid #333;
  color: #606060;
}

.footer-content {
  display: flex;
  align-items: center;
  gap: 1em;
  flex-wrap: wrap;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.footer-logo img {
  height: 25px;
  width: auto;
  opacity: 0.6;
}

.footer-logo span {
  font-size: 1.1em;
  color: #808080;
}

.footer-text {
  flex: 1;
  color: #808080;
}

/* === GitHub Link === */
.github-link {
  font-size: 1.2em;
  display: inline-block;
  margin: 1em 0;
  padding: 0.5em 1em;
  border: 2px solid #4db8ff;
  color: #4db8ff;
}

.github-link:hover {
  background: #1a1a1a;
  color: #80ccff;
}

/* === Section/Note === */
.section {
  margin: 2em 0;
  overflow: auto;
}

.note {
  color: #808080;
  font-style: italic;
}

/* === Tables === */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
}

th {
  text-align: left;
  padding: 0.5em 0.5em 0.5em 0;
  border-bottom: 2px solid #606060;
  font-weight: normal;
  color: #ffffff;
}

td {
  padding: 0.3em 0.5em 0.3em 0;
  border-bottom: 1px solid #1a1a1a;
}

tr:hover {
  background: #1a1a1a;
}

.type {
  color: #808080;
  text-transform: uppercase;
  font-size: 0.9em;
}

.size {
  text-align: right;
  color: #808080;
  white-space: nowrap;
}

.timestamp {
  font-size: 0.75em;
  white-space: nowrap;
}

/* === Directory Icons === */
.dir-icon::before {
  content: "[DIR] ";
  color: #606060;
}

.file-icon::before {
  content: "[FILE] ";
  color: #404040;
}

/* === Info Box === */
.info {
  background: #1a1a1a;
  padding: 1em;
  margin: 2em 0;
  border-left: 3px solid #606060;
  border: 1px solid #333;
}

.info p {
  margin: 0.5em 0;
}

/* === KB Items === */
.kb-item {
  margin: 0.5em 0;
}

/* === Repo List === */
.repo-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

li.repo-item {
  margin: 1em 0;
  padding: 1em;
  background: #1a1a1a;
  border: 1px solid #333;
  border-left: 3px solid #4db8ff;
  overflow: hidden;
  box-sizing: border-box;
  list-style: none;
}

li.repo-item:hover {
  border-left-color: #80ccff;
  background: #222;
}

.repo-header {
  display: flex;
  align-items: center;
  gap: 1em;
  margin-bottom: 0.5em;
  line-height: 1;
}

.repo-name {
  font-size: 1.1em;
  font-weight: bold;
  line-height: 1;
}

.repo-language {
  font-size: 0.9em;
  color: #808080;
  background: #2a2a2a;
  padding: 0.2em 0.6em;
  border-radius: 3px;
}

.repo-stars {
  font-size: 0.9em;
  color: #ffd700;
  margin-left: auto;
}

.repo-description {
  color: #b0b0b0;
  font-size: 0.95em;
  line-height: 1.4;
  margin: 0;
}

/* === Collapsible Sections === */
input[type="checkbox"].collapse-toggle {
  display: none;
}

.collapsible {
  display: none;
  margin-left: 1.5em;
  padding-left: 0.5em;
  border-left: 1px solid #333;
}

input[type="checkbox"].collapse-toggle:checked ~ .collapsible {
  display: block;
  margin-top: 0.5em;
}

.collapse-label {
  cursor: pointer;
  color: #4db8ff;
  display: inline-block;
  user-select: none;
  transition: color 0.2s;
}

.collapse-label:hover {
  color: #80ccff;
  text-decoration: underline;
}

.collapse-label::before {
  content: "\25B8 ";
  color: #606060;
  margin-right: 0.3em;
  display: inline-block;
  transition: transform 0.2s;
}

input[type="checkbox"].collapse-toggle:checked + .collapse-label::before {
  content: "\25BE ";
}

.collapsible ul {
  margin: 0.5em 0;
}

.collapsible > ul > li {
  margin: 0.3em 0;
}

/* === KB Cards === */
.kb-card {
  background: #1a1a1a;
  border: 1px solid #333;
  border-left: 3px solid #4db8ff;
  padding: 1.5em;
  margin: 1em 0;
  transition: all 0.2s ease;
}

.kb-card:hover {
  border-left-color: #80ccff;
  background: #222;
  transform: translateY(-2px);
}

.kb-card-title {
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 0.5em;
}

.kb-card-title a {
  color: #ffffff;
}

.kb-card-desc {
  color: #b0b0b0;
  margin: 0.5em 0;
  line-height: 1.5;
}

.kb-card-meta {
  font-size: 0.85em;
  color: #606060;
  margin-top: 1em;
  padding-top: 0.5em;
  border-top: 1px solid #2a2a2a;
}

.kb-card-status {
  display: inline-block;
  padding: 0.2em 0.6em;
  background: #2a2a2a;
  border-radius: 3px;
  font-size: 0.8em;
  margin-right: 0.5em;
}

.kb-card-status.enabled {
  color: #4db8ff;
  border: 1px solid #4db8ff;
}

.kb-card-status.disabled {
  color: #808080;
  border: 1px solid #606060;
}

/* === KB Mini Cards === */
.kb-mini-card {
  background: #1a1a1a;
  border: 1px solid #333;
  padding: 1em;
  margin: 0.5em 0;
  transition: all 0.2s ease;
}

.kb-mini-card:hover {
  border-color: #4db8ff;
  background: #222;
}

.kb-mini-card-title {
  font-weight: bold;
  margin-bottom: 0.3em;
}

.kb-mini-card-desc {
  font-size: 0.9em;
  color: #b0b0b0;
  line-height: 1.4;
}

/* === License Badges === */
.license-badges {
  display: flex;
  gap: 1em;
  align-items: center;
}

.license-badges img {
  opacity: 0.7;
  transition: opacity 0.2s;
  height: 31px;
  width: auto;
}

.license-badges a:hover img {
  opacity: 1;
}

/* === Language Toggle === */
.lang-toggle {
  font-size: 0.35em;
  display: flex;
  flex-direction: column;
  gap: 0.1em;
}

.lang-toggle label {
  display: flex;
  align-items: center;
  gap: 0.4em;
  cursor: pointer;
  color: #808080;
  margin: 0.2em 0;
}

.lang-toggle label:hover {
  color: #b0b0b0;
}

.lang-toggle input[type="radio"] {
  margin: 0;
  accent-color: #4db8ff;
}

.lang-toggle input[type="radio"]:checked + span {
  color: #e0e0e0;
}

/* === Site Navigation === */
.site-nav {
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  background: #0a0a0a;
  border-bottom: 1px solid #333;
  z-index: 999;
  display: flex;
  justify-content: center;
  padding: 0.4em 0;
}

.site-nav-inner {
  display: flex;
  align-items: center;
  gap: 0.3em;
  max-width: 900px;
  width: 100%;
  padding: 0 20px;
  font-size: 0.85em;
  flex-wrap: wrap;
}

.site-nav a {
  color: #808080;
  padding: 0.2em 0.4em;
  transition: color 0.2s;
}

.site-nav a:hover {
  color: #4db8ff;
  text-decoration: none;
}

.site-nav a.active {
  color: #4db8ff;
}

.site-nav .nav-sep {
  color: #333;
  user-select: none;
}

/* === Responsive === */
@media (max-width: 600px) {
  .header-content {
    justify-content: center;
    text-align: center;
  }

  .lang-toggle {
    width: 100%;
    align-items: center;
  }

  .site-nav-inner {
    justify-content: center;
    font-size: 0.8em;
  }
}
