/* 
 * style.css
 * Arquivo de estilos principal do sistema
 * Versão atualizada com correções para menu lateral e responsividade
 */

:root {
  --primary-color: #0d6efd;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --info-color: #0dcaf0;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --sidebar-width: 300px;
  --header-height: 60px;
  --montar-horario-sidebar-width: 20vw; /* Nova variável para a barra lateral de montagem de horários */
}

body {
  font-family: "Open Sans", sans-serif;
  font-size: small;
  background: #bbc2ff;
  color: #444444;
}

.img-logo{
  width: 10%;
}

a#logo{
  margin-right: -90%;
  margin-left: -40%;
}

.justify-content-between {
  justify-content: space-between !important;
  width: 25%;
  margin-left: 10%;
}

#logoBar{
  display: flex;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  color: #717ff5;
  text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Nunito", sans-serif;
  font-size: medium;
}

/* ======= Header ======= */
.header {
  transition: all 0.5s;
  z-index: 997;
  height: var(--header-height);
  box-shadow: 0px 2px 20px rgba(1, 41, 112, 0.1);
  background-color: #dadeff;
  padding-left: 20px;
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
}

.header .toggle-sidebar-btn {
  font-size: 32px;
  padding-left: 10px;
  cursor: pointer;
  color: var(--primary-color);
}

.header .search-bar {
  min-width: 360px;
  padding: 0 20px;
}

.header .search-form {
  width: 100%;
}

.header .search-form input {
  border: 0;
  font-size: 14px;
  color: #012970;
  border: 1px solid rgba(1, 41, 112, 0.2);
  padding: 7px 38px 7px 8px;
  border-radius: 3px;
  transition: 0.3s;
  width: 100%;
}

.header .search-form button {
  border: 0;
  padding: 0;
  margin-left: -30px;
  background: none;
}

.header .search-form button i {
  color: #012970;
}

.header-nav ul {
  list-style: none;
}

.header-nav > ul {
  margin: 0;
  padding: 0;
}

.header-nav .nav-icon {
  font-size: 22px;
  color: #012970;
  margin-right: 25px;
  position: relative;
}

.header-nav .nav-profile {
  color: #012970;
}

.header-nav .nav-profile img {
  max-height: 36px;
}

.header-nav .nav-profile span {
  font-size: 14px;
  font-weight: 600;
}

.header-nav .profile {
  min-width: 240px;
  padding-bottom: 0;
  top: 8px !important;
}

.header-nav .profile .dropdown-header h6 {
  font-size: 18px;
  margin-bottom: 0;
  font-weight: 600;
  color: #444444;
}

.header-nav .profile .dropdown-header span {
  font-size: 14px;
}

.header-nav .profile .dropdown-item {
  font-size: 14px;
  padding: 10px 15px;
  transition: 0.3s;
}

.header-nav .profile .dropdown-item i {
  margin-right: 10px;
  font-size: 18px;
  line-height: 0;
}

.header-nav .profile .dropdown-item:hover {
  background-color: #f6f9ff;
}

/* ======= Sidebar ======= */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  z-index: 996;
  transition: all 0.3s;
  padding: 20px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #aab7cf transparent;
  box-shadow: 0px 0px 20px rgba(1, 41, 112, 0.1);
  background-color: #e8eaff;
}

.sidebar::-webkit-scrollbar {
  width: 5px;
  height: 8px;
  background-color: #fff;
}

.sidebar::-webkit-scrollbar-thumb {
  background-color: #aab7cf;
}

.sidebar-nav {
  padding: 0;
  margin: 0;
  list-style: none;
}

.sidebar-nav li {
  padding: 0;
  margin: 0;
  list-style: none;
}

.sidebar-nav .nav-item {
  margin-bottom: 5px;
}

.sidebar-nav .nav-heading {
  font-size: 11px;
  text-transform: uppercase;
  color: #899bbd;
  font-weight: 600;
  margin: 10px 0 5px 15px;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
  color: #4154f1;
  transition: 0.3s;
  background: #f6f9ff;
  padding: 10px 15px;
  border-radius: 4px;
}

.sidebar-nav .nav-link i {
  font-size: 16px;
  margin-right: 10px;
  color: #4154f1;
}

.sidebar-nav .nav-link.collapsed {
  color: #012970;
  background: #fff;
}

.sidebar-nav .nav-link.collapsed i {
  color: #899bbd;
}

.sidebar-nav .nav-link:hover {
  color: #4154f1;
  background: #f6f9ff;
}

.sidebar-nav .nav-link:hover i {
  color: #4154f1;
}

.sidebar-nav .nav-content {
  padding: 5px 0 0 0;
  margin: 0;
  list-style: none;
}

.sidebar-nav .nav-content a {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: #012970;
  transition: 0.3s;
  padding: 10px 0 10px 40px;
  transition: 0.3s;
}

.sidebar-nav .nav-content a i {
  font-size: 6px;
  margin-right: 8px;
  line-height: 0;
  border-radius: 50%;
}

.sidebar-nav .nav-content a:hover, .sidebar-nav .nav-content a.active {
  color: #4154f1;
}

.sidebar-nav .nav-content a.active i {
  background-color: #4154f1;
}

/* ======= Main ======= */
#main {
  margin-top: var(--header-height);
  padding: 20px 30px;
  transition: all 0.3s;
  margin-left: var(--sidebar-width);
}

.pagetitle {
  margin-bottom: 10px;
}

.pagetitle h1 {
  font-size: 24px;
  margin-bottom: 0;
  font-weight: 600;
  color: #012970;
}

/* ======= Footer ======= */
.footer {
  padding: 20px 0;
  font-size: 14px;
  transition: all 0.3s;
  border-top: 1px solid #cddfff;
  margin-left: var(--sidebar-width);
}

.footer .copyright {
  text-align: center;
  color: #012970;
}

.footer .credits {
  padding-top: 5px;
  text-align: center;
  font-size: 13px;
  color: #012970;
}

/* ======= Profile Circle ======= */
.profile-cicle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* ======= Cards ======= */
.card {
  margin-bottom: 30px;
  border: none;
  border-radius: 5px;
  box-shadow: 0px 0 30px rgba(1, 41, 112, 0.1);
}

.card-header, .card-footer {
  border-color: #ebeef4;
  background-color: #fff;
  color: #798eb3;
  padding: 15px;
}

.card-title {
  padding: 20px 0 15px 0;
  font-size: 18px;
  font-weight: 500;
  color: #012970;
  font-family: "Poppins", sans-serif;
}

.card-title span {
  color: #899bbd;
  font-size: 14px;
  font-weight: 400;
}

.card-body {
  padding: 0 20px 20px 20px;
}

.card-img-overlay {
  background-color: rgba(255, 255, 255, 0.6);
}

/* ======= Buttons ======= */
.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.row .col-md-6 .mb-3 .btn{
  width: 200px;
}

.btn-secondary {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.btn-success {
  background-color: var(--success-color);
  border-color: var(--success-color);
}

.btn-info {
  background-color: var(--info-color);
  border-color: var(--info-color);
}

.btn-warning {
  background-color: var(--warning-color);
  border-color: var(--warning-color);
}

.btn-danger {
  background-color: var(--danger-color);
  border-color: var(--danger-color);
}

/* ======= Forms ======= */
.form-control:focus {
  box-shadow: none;
  border-color: #4154f1;
}

.invalid-feedback {
  color: #dc3545;
}

.invalid-tooltip {
  color: #fff;
  background-color: #dc3545;
}

/* ======= Modal ======= */
.modal-header {
  border-bottom: 1px solid #dee2e6;
  background-color: #f8f9fa;
}

.modal-footer {
  border-top: 1px solid #dee2e6;
  background-color: #f8f9fa;
}

/* ======= DataTables ======= */
.dataTables_wrapper .dataTables_paginate .paginate_button {
  padding: 0.25rem 0.5rem;
  margin-left: 0.25rem;
  border-radius: 0.25rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background-color: #4154f1;
  border-color: #4154f1;
  color: #fff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background-color: #f6f9ff;
  border-color: #4154f1;
  color: #4154f1 !important;
}

/* ======= Barra Lateral de Montagem de Horários ======= */
/* Nova implementação para barra lateral fixa à direita */
.montar-horario-sidebar {
  position: fixed;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  width: var(--montar-horario-sidebar-width);
  z-index: 90;
  background-color: #fff;
  box-shadow: -2px 0 10px rgba(1, 41, 112, 0.1);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #aab7cf transparent;
}

.montar-horario-sidebar::-webkit-scrollbar {
  width: 5px;
  height: 8px;
  background-color: #fff;
}

.montar-horario-sidebar::-webkit-scrollbar-thumb {
  background-color: #aab7cf;
  border-radius: 4px;
}

.montar-horario-sidebar .card {
  margin-bottom: 15px;
  border: none;
  box-shadow: 0 0 15px rgba(1, 41, 112, 0.1);
}

.montar-horario-sidebar .card-body {
  padding: 15px;
}

.montar-horario-sidebar .card-title {
  padding: 10px 0;
  font-size: 16px;
  margin-bottom: 10px;
  border-bottom: 1px solid #ebeef4;
}

/* Conteúdo principal com largura limitada */
.montar-horario-content {
  padding-right: var(--montar-horario-sidebar-width);
  transition: all 0.3s;
}

/* Ajustes para os componentes, professores e combinações */
.componentes-lista,
.professores-lista,
.combinacoes-lista {
  max-height: 200px;
  overflow-y: auto;
  margin-top: 10px;
  padding-right: 5px;
}

.componente-item,
.professor-item,
.combinacao-item {
  padding: 8px;
  border-radius: 4px;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  cursor: pointer;
}

.componente-item:hover,
.professor-item:hover,
.combinacao-item:hover {
  background-color: #e9ecef;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.componente-item.selecionado,
.professor-item.selecionado {
  background-color: #cfe2ff;
  border-color: #9ec5fe;
}

/* Ajustes para o layout da página de montagem de horários */
.pagetitle-montagem {
  margin-bottom: 20px;
}

.row-horario {
  margin-top: 30px;
}

/* ======= Horizontal Scroll Container ======= */
.horizontal-scroll-container {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 15px;
}

.horizontal-turmas-container {
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  padding: 10px;
  min-width: 100%;
}

.turma-column {
  min-width: 300px;
  max-width: 400px;
  flex: 0 0 auto;
}

/* ======= Responsive ======= */
/* Telas grandes (desktops, 992px e acima) */
@media (min-width: 992px) {
  body {
    overflow-x: hidden;
  }
  
  .sidebar {
    left: 0;
  }
  
  #main, .footer {
    margin-left: var(--sidebar-width);
  }
  
  .toggle-sidebar .sidebar {
    left: -300px;
  }
  
  .toggle-sidebar #main, .toggle-sidebar .footer {
    margin-left: 0;
  }
  
  /* Ajustes para a barra lateral de montagem de horários */
  
  .montar-horario-sidebar {
    width: var(--montar-horario-sidebar-width);
  }
}

/* Telas extra grandes (desktops grandes, 1200px e acima) */
@media (min-width: 1200px) {
  .sidebar {
    width: var(--sidebar-width);
  }
  
  #main {
    margin-left: var(--sidebar-width);
  }
  
  .toggle-sidebar #main, .toggle-sidebar .footer {
    margin-left: 0;
  }
  
  .toggle-sidebar .sidebar {
    left: -300px;
  }
}

/* Telas médias (tablets, menos de 992px) */
@media (max-width: 991.98px) {
  .sidebar {
    left: -300px;
  }
  
  #main, .footer {
    margin-left: 0;
  }
  
  .toggle-sidebar .sidebar {
    left: 0;
  }
  
  .toggle-sidebar #main, .toggle-sidebar .footer {
    margin-left: 0;
    margin-right: 0;
  }
  
  /* Ajustes para a barra lateral de montagem de horários em telas médias */
  .montar-horario-content {
    width: 100%;
    padding-right: 0;
  }
  
  .montar-horario-sidebar {
    width: 100%;
    position: relative;
    top: 0;
    right: 0;
    padding: 10px;
  }
  
  .componentes-lista,
  .professores-lista,
  .combinacoes-lista {
    max-height: 150px;
  }
}

/* Telas pequenas (celulares em modo paisagem, menos de 768px) */
@media (max-width: 767.98px) {
  .header .search-bar {
    min-width: auto;
  }
  
  .sidebar {
    width: 250px;
  }
  
  /* Ajustes para a barra lateral de montagem de horários em telas pequenas */
  .montar-horario-sidebar {
    padding: 5px;
  }
  
  .montar-horario-sidebar .card-title {
    font-size: 14px;
  }
  
  .componentes-lista,
  .professores-lista,
  .combinacoes-lista {
    max-height: 120px;
  }
}

/* Telas muito pequenas (celulares em modo retrato, menos de 576px) */
@media (max-width: 575.98px) {
  .header .search-bar {
    display: none;
  }
}

/* Classe para controlar a visibilidade da sidebar */
body.sidebar-open .sidebar {
  left: 0;
}

body.sidebar-closed .sidebar {
  left: -300px;
}

body.sidebar-closed #main,
body.sidebar-closed .footer {
  margin-left: 0;
}
