/* github_version.css */

/* Default Theme Variables */
:root {
  --primary-color: #2C3E50;
  --secondary-color: #34495E;
  --background-color: #f9f9f9;
  --section-background: #ffffff;
  --border-color: #ddd;
  --text-color: #333;
  --muted-color: #777;
  --logo-max-height: 70px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --transition: 0.3s ease;
}

/* Dark Theme Overrides */
body.dark {
  --primary-color: #f4f6f9;
  --secondary-color: #dfe4ea;
  --background-color: #1e272e;
  --section-background: #2f3640;
  --border-color: #444;
  --text-color: #f1f2f6;
  --muted-color: #aaa;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  transition: background-color var(--transition), color var(--transition);
  line-height: 1.6;
}

/* Navbar */
/* Navbar */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background-color: var(--section-background);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 999;
}

.nav-left {
  display: flex;
  align-items: center;
}

.nav-left img {
  height: 36px;
  margin-right: 10px;
}

.nav-left h1 {
  font-size: 1.4em;
  margin: 0;
  color: var(--primary-color);
}

nav button.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.4em;
  color: var(--primary-color);
  transition: transform 0.3s ease, color var(--transition);
}
nav button.theme-toggle:hover {
  transform: scale(1.2);
  color: var(--secondary-color);
}


header {
  text-align: center;
  margin: 30px auto;
}

h1 {
  margin: 10px 0 0 0;
  font-size: 2.2em;
  color: var(--primary-color);
}

.section {
  background-color: var(--section-background);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  margin: 20px auto;
  width: 85%;
  max-width: 1000px;
  box-shadow: var(--shadow);
  transition: background-color var(--transition), border-color var(--transition);
}

.section h2 {
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 6px;
  color: var(--secondary-color);
}

table.info, table.patterns, table.responsibilities {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 0.95em;
}

table th, table td {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
}

code.pattern {
  font-family: monospace;
  background-color: #f3f3f3;
  padding: 2px 5px;
  border-radius: 4px;
  word-break: break-all; /* Allow long strings to break */
}
body.dark code.pattern {
  background-color: #444;
}

ul.examples, ul.checklist {
  margin-top: 10px;
  padding-left: 20px;
}

ul li {
  margin-bottom: 8px;
}

footer {
  text-align: center;
  margin: 40px 0;
  font-size: 0.9em;
  color: var(--muted-color);
}

/* Banner styles */
.banner {
  width: 85%;
  max-width: 1000px;
  margin: 20px auto;
  border-radius: 8px;
  overflow: hidden; /* Ensures the image respects the border-radius */
  box-shadow: var(--shadow);
  line-height: 0; /* Removes extra space below the image */
}

.banner img {
  width: 100%;
  height: auto;
  display: block; /* Removes bottom margin/space under the image */
}

/* Card Grid for branch_management.html */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.card {
  background-color: var(--background-color);
  padding: 15px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.card h3 {
  margin-top: 0;
  color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
  .section, .banner {
    width: 95%;
    margin: 15px auto;
    padding: 15px;
  }

  .nav-left h1 {
    font-size: 1.1em;
  }

  h1 {
    font-size: 1.8em;
  }

  .section h2 {
    font-size: 1.3em;
  }

  table th, table td {
    padding: 8px;
    font-size: 0.9em;
  }

  /* Responsive Tables */
  table.patterns, table.responsibilities, table.info {
    display: block;
    width: 100%;
  }
  table thead, table tbody, table th, table td, table tr {
    display: block;
  }
  table thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  table tr { border: 1px solid var(--border-color); margin-bottom: 10px; }
  table td {
    border: none;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    padding-left: 50%;
    text-align: left;
    word-break: break-word; /* Allow long words to wrap in the cell */
  }
  table td:before {
    position: absolute;
    top: 8px;
    left: 10px;
    width: 45%;
    padding-right: 10px;
    white-space: nowrap;
    font-weight: bold;
  }

  /* Add data-label attributes via CSS */
  table.patterns td:nth-of-type(1):before { content: "Type"; }
  table.patterns td:nth-of-type(2):before { content: "Pattern"; }
  table.patterns td:nth-of-type(3):before { content: "Example"; }

  table.responsibilities td:nth-of-type(1):before { content: "Branch"; }
  table.responsibilities td:nth-of-type(2):before { content: "Responsible"; }

  table.info td:nth-of-type(1):before { content: "Version Part"; }
  table.info td:nth-of-type(2):before { content: "Meaning"; }
}
