/* static/css/base.css */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family) !important;
  font-size: var(--font-size-base) !important;
  margin: 0;
  padding: 0;
  background: var(--light-color) !important;
  color: var(--text-color) !important;
  height: 100vh;
}

h1,
h2,
h3,
h4,
h5 {
  font-weight: bold;
  margin-bottom: var(--spacing-medium);
  color: var(--primary-color);
}

a {
  color: var(--secondary-color);
  text-decoration: none !important;
}
a:hover {
  text-decoration: none;
}

/* Estilos da NavBar */
.navBar {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px;
  background: var(--light-color-50);
  box-shadow: var(--shadow-sm);
}

.navBar-itens {
  width: 100%;
  display: flex;
  justify-content: space-around;

  & > #menu-toggle {
    display: none;
  }
}

.navBar ul {
  margin-top: 20px;
  list-style: none;
  display: flex;
  gap: 20px;
}

.nav-option {
  background-color: var(--primary-color);
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  color: var(--secondary-color);
  font-size: var(--font-size-md);
  font-weight: bolder;
  padding: 5px 10px;
  width: 140px;
}

.nav-option:hover {
  background-color: var(--primary-color-700);
  cursor: pointer;
}

/* Estilos da SideBar */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  border-right: 1px solid #eaecf0;
  transition: margin-left 0.5s ease-in-out, width 0.5s ease-in-out;
}

.sidebar.collapsed {
  width: var(--sidebar-width-collapsed);
  transition: margin-left 0.5s ease-in, width 0.5s ease-in;
}

.sidebar-link {
  color: var(--text-color);
  font-size: 1rem;
  transition: margin-left 0.5s ease-in-out, width 0.5s ease-in-out;
  border-radius: var(--border-radius);
  padding: 0.625rem 0.75rem;
  margin: 4px 16px;
  white-space: nowrap;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.sidebar-link:hover {
  color: var(--primary-color);
  background: var(--primary-color-50);
  transform: translateX(5px);
}

.sidebar-link.active {
  color: var(--primary-color-700);
  background: var(--primary-color-50);
}

.logo-section { /* SIDE BAR*/
  border-bottom: 1px solid #eaecf0;
  margin-bottom: 10px;
  padding: 0 1rem;

  & > div {
    align-items: center;
    height: 4rem;
    width: max-content;
  }

  .logo-text {
    font-size: var(--font-size-heading-sm);
    font-weight: bold;
    color: var(--text-color-900);
  }
}

.logo-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--border-radius-md);
  background-color: var(--primary-color);
}


.logo-section-nav{ /* NAVBAR */
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;

  & .logo-icon {
    width: 2.5rem;
    height: 2.5rem;
  }

  & .logo-text  {
    color: var(--text-color-900);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    font-weight: 600;
    line-height: 24px;
    transition: opacity 0.3s ease;
  }
}


.profile-section {
  border-top: 1px solid #eaecf0;
  cursor: pointer;
}

.user-avatar {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 2rem;
  height: 2rem;
  background-color: var(--primary-color-700);
  color: #fff;
}

.profile-section .profile-info {
  max-width: 135px;
}

.profile-section .profile-info h6 {
  color: var(--text-color-900);
  font-size: var(--font-size-md);
}

.profile-section .profile-info p {
  color: var(--text-color-500);
  margin-bottom: 0;
  font-size: var(--font-size-sm);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.btn-user-options > button{
    padding: 0 12px; 
    border: none;
}

.btn-user-options > ul {
  padding: 10px 0px !important;
  width: 190px !important;

  & li.logout:hover {
    background-color: var(--danger-color-50);
  }
  
  & li:hover {
    background-color: var(--primary-color-50);
  }

  & hr {
    border-color: var(--text-color);
    margin: 10px 10px;
  }

  & li a {
    display: block;
    width: 100%;
    font-size: var(--font-size-md);
    color: var(--text-color-900);
    

    &:hover {
      color: var(--primary-color);
    }
  }

  & li.logout a {
    color: var(--danger-color-600);
  }

}

.toggle-btn {
  position: absolute;
  right: -15px;
  top: 50%;
  background: white;
  border-radius: 50%;
  width: 1.563rem;
  height: 1.563rem;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  z-index: 100;
  cursor: pointer;
  transition: transform 0.3s ease;
  font-size: 0.625rem;
}

.collapsed .toggle-btn {
  transform: rotate(180deg);
}

.collapsed .hide-on-collapse {
  display: none !important;
}

.collapsed .logo-text {
  display: none;
}

.collapsed .profile-info {
  display: none;
}

.collapsed .sidebar-link {
  justify-content: center;
  text-align: center;
  padding: 12px;
  margin: 4px auto;
  width: 80%;
}

.collapsed .sidebar-link i {
  margin: 0 !important;
}

/* BOTTOM NAVBAR */

.bottom-navbar {
  background-color: #fff;
  box-shadow: var(--shadow-sm);
}

.bottom-navbar .bottom-navbar-link {
  width: max-content;
  color: var(--text-color);
  font-size: 1rem;
  transition: margin-left 0.5s ease-in-out, width 0.5s ease-in-out;
  border-radius: 50%;
  padding: 0.75rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center; 

  & i {
    margin: 0 !important;
  }
}

.bottom-navbar-link.active {
  color: var(--primary-color-700);
  background: var(--primary-color-50);
}

/* Estilos do Header */

header {
  padding: 2rem 2rem 0 2rem;
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  /* background-color: #fff;
  border-bottom: 1px solid var(--light-color-200); */
  transition: margin-left 0.5s ease-in-out, width 0.5s ease-in-out;
}

header h1 {
  color: var(--text-color-900);
  font-size: var(--font-size-heading);
  font-weight: bolder;
  margin: 0;
}

header h1 > i {
  color: var(--text-color);
}

header h6 {
  margin: 0;
}

/* Estilos do Footer */
footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 2.5rem;

  & a {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    font-size: 1.125rem;
    color: var(--text-color-900);
    font-weight: 600;
  }

  & .hr {
    height: 1px;
    width: 100%;
    border-top: 1px solid var(--light-color-200);
  }
}

footer .copyright {
  color: var(--text-color-500);
}

.main-content {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  /* background-color: #fff; */
  min-height: 100vh;
  padding: 16px 32px;
  transition: margin-left 0.5s ease-in-out, width 0.5s ease-in-out;
}

.sidebar.collapsed ~ .main-content, .sidebar.collapsed ~ header {
  margin-left: var(--sidebar-width-collapsed);
  width: calc(100% - var(--sidebar-width-collapsed));
}

/* Estilos Paginação*/
.custom-pagination {
  justify-content: flex-end;
  gap: 5px;
  padding-right: 14px !important;
  margin-bottom: 0;
}

.custom-pagination .page-item .page-link {
  background-color: #fff;
  color: var(--text-color-500);
  height: 30px;
  font-size: var(--font-size-md);
  border: none;

  /* &.btn-previus, &.btn-next {
    color: var(--text-color-700);
    border: 1px solid var( --light-color-300);
    border-radius: 8px;
    margin: 0 10px;
    box-shadow: var(--shadow-sm);
  } */

  &:hover {
    cursor: pointer;
    background-color: var(--primary-color-50);
    border-radius: var(--border-radius-md);
  }
}

.custom-pagination .page-item.active .page-link {
  border-radius: var(--border-radius-md);
  background-color: var(--primary-color-50);
  color: var(--primary-color);
}

.custom-pagination .page-item.disabled .page-link {
  &.btn-previus,
  &.btn-next {
    color: var(--text-color-100);
  }
}

/* Estilos itens diversos*/
.custom-card {
  width: 100%;
  padding: 10px 0;
  background-color: #fff;
  border: 1px solid var(--light-color-200);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
}

.custom-card-header {
  padding: 15px 24px;
  border-bottom: 1px solid var(--light-color-200);
  color: var(--text-color-900);
  
  & .custom-card-title {
    font-size: var(--font-size-heading-sm);
    font-weight: 600;

  }
}

.custom-card-body {
  padding: 24px;
  color: var(--text-color-900);
  font-size: var(--font-size-md);
}

.featured-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-right: 5px;
  background-color: var(--primary-color-100);
  border: 8px solid var(--primary-color-50);
  border-radius: 50%;

  & i {
    color: var(--primary-color);
  }
}

.custom-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  background-color: var(--primary-color-50);
  color: var(--primary-color-700);
  padding: 3px 10px !important;
  border-radius: var(--border-radius-lg);

  & > i {
    color: var(--primary-color-700);
    font-size: 8px;
  }
}

.badge-success {
  background-color: var(--success-color-50);
  color: var(--success-color-700);

  & > i {
    color: var(--success-color-600);
  }
}

.badge-info {
  background-color: var(--info-color-50);
  color: var( --info-color-700);

  & > i {
    color: var(--info-color-600);
  }
}

.badge-warning {
  background-color: var(--warning-color-50);
  color: var( --warning-color-700);

  & > i {
    color: var(--warning-color-600);
  }
}

.badge-danger {
  background-color: var(--danger-color-50);
  color: var(--danger-color-700);

  & > i {
    color: var(--danger-color-600);
  }
}


/* Vertical Steps Style */
 .steps-vertical {
    padding: 0;
    /* overflow: auto;
    height: 500px; */
 }

 .step-vertical {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 0.6rem 0;
 }

 .step-vertical:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 14px;
    top: 55px;  
    bottom: 0;
    width: 2px;
    height: 24px;
    background: #e9ecef;
 }

 .step-vertical-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: white;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1rem;
    color: #6c757d;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
 }

 .step-vertical.active .step-vertical-icon {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
 }

.step-vertical.complete .step-vertical-icon {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
 }


/* Horizontal Steps Style */
.steps-horizontal {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    padding: 0;
    margin-bottom: 20px;
}

.steps-horizontal::before {
    content: '';
    position: absolute;
    top: 24px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e9ecef;
    z-index: 1;
}

.step-horizontal {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 2;
}

.step-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 20px;
    color: #6c757d;
    transition: all 0.3s ease;
}

.step-title {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 5px;
}

.step-description {
    font-size: 12px;
    color: #adb5bd;
    max-width: 150px;
    margin: 0 auto;
}

.step-horizontal.active .step-icon {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    /* box-shadow: 0 0 0 5px rgba(67, 97, 238, 0.2); */
}

.step-horizontal.complete .step-icon {
    background: var(--success-color-500);
    border-color: var(--success-color-500);
    color: white;
}

/* RESPONSIVDADE */

@media (max-width: 992px) {
  .main-content, header{
    width: 100% !important;
    margin-left: 0 !important;
  }

  #sidebar {
    display: none !important;

  }
  
  .collapsed .sidebar-link {
    width: max-content;
    border-radius: 50%;
  }

  
}

@media (max-width: 480px) {

  body {
    font-size: var(--font-size-md) !important;
  }

  .main-content {
      padding-bottom: 7rem; /* espaço para o bottom-navbar fixo */
  }  

  header h1 {
    font-size: 20px;
  }

  .custom-badge {
    font-size: var(--font-size-sm) !important;
  }

  .navBar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.25rem 1rem;
    font-size: 1rem !important;

    & .nav-option-container {
      display: none;
    }

    & .navBar-itens {
      display: flex;
      justify-content: space-between;
      width: 100%;
      align-items: center;

      & .logo > h1 {
        font-size: 1rem;
      }

      & > #menu-toggle {
        display: block;
      }
    }
  }

  #navbarToggleNavOptions {
    width: 100%;
    & > .options {
      display: flex;
      flex-direction: column;
      gap: 0.625rem;
      padding-top: 1rem;
    }
  }

  footer {
    gap: 5px;
    padding: 0 1.5rem;
  }

  footer > a{
    font-size: 1rem;
  }

  footer .copyright {
    font-size: var(--font-size-sm);
  }
}

/* Tabelas */
@media (max-width: 480px) {
  .custom-table .table-header .actions .input-search   {
    width: 100%;
  }

  .custom-table td:first-child, .custom-table th:first-child {
      padding-left: 0.875rem !important;
  }

  table th, td {
    white-space: nowrap;
  }

  td .featured-icon {
    width: 1.5rem;
    height: 1.5rem;
  }
}

#menu-toggle {
  width: 20px; /* reduzido */
  height: 16px; /* reduzido */
  position: relative;
  transform: rotate(0deg);
  transition: 0.5s ease-in-out;
  cursor: pointer;
}

#menu-toggle span {
  display: block;
  position: absolute;
  height: 2px; /* mais fino proporcionalmente */
  width: 100%;
  background: #4b5563;
  border-radius: 2px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: 0.25s ease-in-out;
}

/* Distribuição vertical proporcional */
#menu-toggle span:nth-child(1) {
  top: 0px;
}

#menu-toggle span:nth-child(2),
#menu-toggle span:nth-child(3) {
  top: 7px; /* centro da altura de 16px */
}

#menu-toggle span:nth-child(4) {
  top: 14px;
}

/* Animação quando abre */
#menu-toggle.open span:nth-child(1),
#menu-toggle.open span:nth-child(4) {
  top: 7px;
  width: 0%;
  left: 50%;
}

#menu-toggle.open span:nth-child(2) {
  transform: rotate(45deg);
}

#menu-toggle.open span:nth-child(3) {
  transform: rotate(-45deg);
}
