/* ===== App Shell layout (ONLY for index.html) ===== */
body.app-shell{
  display:flex;
  flex-direction:column;
  min-height:100vh;
}

/* Layout principal */
.app-shell .container {
  display: flex;
  flex: 1;
  min-height: 0;
  height: calc(100vh - 50px);
}

.app-shell .sidebar {
  width: 20%;
  background-color: var(--sidebar-bg);
  padding: 20px;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  --fade-size: 16px;
  background:
    linear-gradient(var(--sidebar-bg), var(--sidebar-bg)) padding-box,
    linear-gradient(to bottom, rgba(0,0,0,0.12), rgba(0,0,0,0)) top / 100% var(--fade-size) no-repeat,
    linear-gradient(to top, rgba(0,0,0,0.12), rgba(0,0,0,0)) bottom / 100% var(--fade-size) no-repeat;
  background-attachment: local, scroll, scroll;
}

.app-shell .sidebar h2 { font-size: 18px; margin: 6px 0 8px; }
.app-shell .sidebar ul { list-style: none; }
.app-shell .sidebar li { margin: 12px 0; }

.app-shell .content {
  flex: 1;
  min-width: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.app-shell iframe { width: 100%; height: 100%; border: none; flex: 1; }

/* Sidebar links */
.app-shell .aula-title { font-weight: bold; font-size: 16px; line-height: 1.3; }

.app-shell .links {
  margin-top: 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: baseline;
}

/* esconde pipes manuais, se existirem */
.app-shell .links > span[aria-hidden="true"] { display: none !important; }

.app-shell .links a,
.app-shell .no-link {
  font-size: 15px;
  line-height: 1.3;
  display: inline-block;
}

.app-shell .links a { padding: 0 4px; border-radius: 0; }
.app-shell .no-link { color: #888; font-style: italic; }

/* separador automático (exceto no último), calibrado */
.app-shell .links > a::after,
.app-shell .links > .no-link::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 0.9em;
  background: rgba(0,0,0,0.28);
  margin-left: 12px;
  margin-right: 6px;
  vertical-align: middle;
}
.app-shell .links > *:last-child::after { content: none; }

/* Rodapé */
.app-shell footer {
  width: 100%;
  background-color: var(--sidebar-bg);
  padding: 10px 12px;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
  text-align: center;
  margin-top: auto;
}
.app-shell .footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.app-shell .cc-logo { width: 60px; height: auto; vertical-align: middle; }
.app-shell footer p { font-size: 14px; color: #333; margin: 0; }

/* Responsividade (mobile) */
@media (max-width: 768px) {
  .app-shell .container { flex-direction: column; }

  .app-shell .sidebar {
    width: 100%;
    padding: 10px 12px 14px;
    height: 50vh;
    max-height: 50vh;
    box-shadow: none;
    border-bottom: 1px solid #e0e0e0;
    --fade-size: 20px;
  }

  .app-shell .sidebar h2 { font-size: 16px; margin: 4px 0 6px; }
  .app-shell .aula-title { font-size: 14px; line-height: 1.2; }
  .app-shell .sidebar li { margin: 8px 0; }

  .app-shell .links a,
  .app-shell .no-link {
    font-size: 14px;
    line-height: 1.2;
  }

  .app-shell .links > a::after,
  .app-shell .links > .no-link::after {
    margin-left: 10px;
    margin-right: 6px;
    height: 0.85em;
  }

  .app-shell .content { min-height: 50vh; }
}

/* Desktop: replica exatamente o comportamento da versão que funciona */
@media (min-width: 769px) {
  .app-shell {
    height: 100vh;
    min-height: 100vh;
  }

  .app-shell .container { height: calc(100vh - 50px); }
  .app-shell .sidebar { height: 100%; overflow-y: auto; }
  .app-shell .content { height: 100%; overflow: hidden; }
  .app-shell iframe { height: 100%; }
}
