/* ================== Global Styles ================== */
body {
  margin: 0;
  font-family: Arial, "Noto Sans Tamil", "Latha", sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* allow scrolling */
  color: #2c3e50;
  background: #fafafa;
}

/* -------------------- Top banner -------------------- */
#top-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: #2c3e50;
  color: white;
  border-bottom: 1px solid #ddd;
}

.banner-left {
  display: flex;
  align-items: center;
}

.banner-left img {
  height: 48px;
  margin-right: 12px;
}

.banner-text h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: bold;
  color: #e96656;
}

.banner-text h4,
.banner-text p {
  margin: 0;
  font-size: 0.95rem;
  color: #ecf0f1;
}

.language-switcher select {
  padding: 6px 12px;
  font-size: 0.95rem;
  border-radius: 6px;
  border: 1px solid #34495e;
  background: #ecf0f1;
  color: #2c3e50;
  cursor: pointer;
  transition: all 0.3s ease;
}

.language-switcher select:hover {
  background: #dfe6e9;
}

/* -------------------- Main layout -------------------- */
.container {
  display: flex;
  flex: 1;
  flex-direction: row;
  overflow: auto; /* allow scrolling */
}

/* -------------------- Sidebar -------------------- */
#sidebar {
  width: 28%;
  min-width: 250px;
  background: #fdfdfd;
  border-right: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  padding: 14px;
  transition: left 0.3s ease;
  z-index: 1001;
}

#searchBox {
  padding: 10px;
  margin-bottom: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  outline: none;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#searchBox:focus {
  border-color: #2c3e50;
  box-shadow: 0 0 5px rgba(44, 62, 80, 0.3);
}

#topicList {
  overflow-y: auto;
  flex: 1;
  padding-right: 6px;
}

.topic-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.topic-btn:hover { background: #f0f0f0; }
.topic-btn:focus { outline: none; background: #e0e0e0; }

/* -------------------- Content -------------------- */
#content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  overflow-x: auto; /* allow horizontal scroll for tables */
  background: #fff;
  line-height: 1.6;
  font-size: 15px;
}

/* -------------------- Triage Table -------------------- */
.triage-table {
  width: 100%;
  display: block; /* horizontal scroll if needed */
  border-collapse: collapse;
  margin: 16px 0;
  box-shadow: 0px 2px 6px rgba(0,0,0,0.08);
  overflow-x: auto;
}

.triage-table th,
.triage-table td {
  border: 1px solid #ccc;
  padding: 12px;
  vertical-align: top;
  font-size: 14px;
}

.triage-table th {
  background: #34495e;
  color: white;
  text-align: center;
  font-weight: 600;
  font-size: 15px;
}

.green { background: #c8e6c9; }
.yellow { background: #fff9c4; }
.red { background: #ffcdd2; }

/* -------------------- Sub-lists -------------------- */
.sub-list {
  list-style-type: disc;
  margin: 6px 0 0 22px;
  padding-left: 18px;
}

.sub-item {
  margin: 6px 0;
}

.sub-link {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: #2c3e50;
  text-align: left;
}

.sub-link:hover { text-decoration: underline; }

/* -------------------- Footer -------------------- */
footer {
  background-color: #f5f5f5;
  text-align: center;
  padding: 5px 0;
  font-size: 14px;
  color: #555;
  border-top: 1px solid #ccc;
  line-height: 1.2;
}

footer a {
  color: #337ab7;
  text-decoration: none;
}

/* -------------------- Menu Toggle -------------------- */
#menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: white;
  margin-left: auto;
}

/* ================== Responsive Design ================== */

/* Mobile (<768px) */
@media (max-width: 768px) {

  /* Stack container vertically */
  .container {
    flex-direction: column;
  }

  /* Sidebar sliding menu */
  #sidebar {
    position: fixed;
    top: 0;
    left: -80%;
    width: 80%;
    height: 100%;
    min-width: 0;
    border-right: none;
    border-bottom: none;
    display: block;
    background: #fdfdfd;
    padding: 0px;
    overflow-y: auto;
  }

  #sidebar.active { left: 0; }

  #content { padding: 15px; }

  /* Sidebar buttons bigger */
  #topicList button { font-size: 16px; padding: 12px; }

  /* Top banner adjustments */
  #top-banner { flex-direction: column; align-items: flex-start; }
  .banner-text h1 { font-size: 1.8rem; }
  .banner-text h4 { font-size: 1rem; }
  .banner-text p { font-size: 0.85rem; }

  .language-switcher { margin-top: 8px; width: 100%; }
  .language-switcher select { width: 100%; }

  /* Show menu button */
  #menu-toggle { display: block; }
}

/* Very small screens (<480px) */
@media (max-width: 480px) {
  .banner-text h1 { font-size: 1.5rem; }
  #topicList button { font-size: 14px; padding: 10px; }
  .triage-table th, .triage-table td { font-size: 12px; padding: 6px; }
}

/* -------------------- Expand/Collapse -------------------- */

.sub-list {
  margin-left: 20px;
  padding-left: 10px;
  border-left: 1px dashed #ccc;
}

.hidden {
  display: none;
}

.topic-header {
  display: flex;
  align-items: center;
  gap: 5px;
}

.toggle-btn {
  background: none;
  border: none;
  font-weight: bold;
  cursor: pointer;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
}
