/* =========================================
= Variables
========================================= */
:root {
  --babypowder: rgba(253, 255, 252, 1);
  --raisinblack: rgba(33, 26, 29, 1);

  --lightgray: rgba(233, 238, 246, 1);
  --gray: rgba(175, 180, 191, 1);
  --darkgray: rgba(139, 144, 151, 1);

  --primary: rgba(1, 50, 152, 1);

  --first-secondary: rgba(0, 129, 230, 1);
  --second-secondary: rgba(93, 0, 195, 1);
  --third-secondary: rgba(191, 125, 0, 1);
  --fourth-secondary: rgba(0, 255, 255, 1);

  --first-tertiary: rgba(0, 179, 255, 1);
  --second-tertiary: rgba(91, 75, 255, 1);

  --first-secondary-light: color-mix(in srgb, var(--first-secondary), white 60%);
  --second-secondary-light: color-mix(in srgb, var(--second-secondary), white 60%);
  --third-secondary-light: color-mix(in srgb, var(--third-secondary), rgba(255, 255, 0, 1) 60%);
  --fourth-secondary-light: color-mix(in srgb, var(--fourth-secondary), rgba(0, 255, 255, 1));

  --green: rgba(107, 197 ,107 , 1);
  --yellow: rgba(245, 240, 103, 1);
  --orange: rgba(238, 151, 89, 1);
  --red: rgba(230, 68, 68, 1);

  --shadow-raisinblack: 1px 4px 6px rgba(33, 26, 29, .3);
  --shadow-gradient: -1px -1px 4px 0 var(--first-secondary), 2px 2px 8px 1px var(--second-secondary);
}

/* =========================================
= Animaciones
========================================= */
@keyframes popupFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideBottom {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popupSlideIn {
  from { transform: translateY(-30px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

@keyframes bounceAlert {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.1); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateX(-20%); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

/* =========================================
= Popups
========================================= */
.popup.hidden {
  opacity: 0;
  pointer-events: none;
}

.popup {
  align-items: center;
  animation: popupFadeIn 0.3s ease-in-out forwards;
  background-color: rgba(33, 26, 29, 0.8);
  display: flex;
  height: 100%;
  justify-content: center;
  left: 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1300;
}

.popupContent {
  align-items: center;
  animation: popupSlideIn 0.5s ease-in-out forwards;
  background-color: var(--babypowder);
  border-radius: 2rem;
  box-shadow: var(--shadow-raisinblack);
  color: var(--raisinblack);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  opacity: 0;
  padding: 3rem;
  position: relative;
  text-align: center;
  transform: translateY(-20px);
  width: 50%;
}

/* =========================================
= Video
========================================= */
.video-container iframe {
  border-radius: 1rem;
  box-shadow: var(--shadow-raisinblack);
  height: 360px;
  transition: all .3s ease;
  width: 100%;
  width: 640px; /* nota: declarado dos veces en el original */
}

.video-container iframe:hover {
  transform: scale(1.05);
}

/* =========================================
= Botón de cierre
========================================= */
.closePopup {
  align-items: center;
  background-color: var(--lightgray);
  border: none;
  border-radius: 50%;
  color: var(--raisinblack);
  cursor: pointer;
  display: flex;
  font-size: 32px;
  font-weight: bold;
  height: 40px;
  justify-content: center;
  position: absolute;
  right: 1rem;
  top: 1rem;
  transition: all .3s ease;
  width: 40px;
}

.closePopup:hover {
  background-color: var(--primary);
  color: var(--babypowder);
  transform: scale(1.1);
}

/* =========================================
= Iconos / Alertas
========================================= */
.alertPopup {
  animation: bounceAlert 0.8s infinite ease-in-out;
  height: 36px;
  width: 36px;
}

/* =========================================
= Edición de perfil
========================================= */
.editprofile {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  height: auto;
  justify-content: center;
  text-align: left;
  width: 100%;
}

.headerphoto {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.edit-photo {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 1rem;
  justify-content: flex-start;
  width: 100%;
}

.edit-text {
  align-items: center;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
  justify-content: center;
  width: 100%;
}

.photobtns {
  display: flex;
  flex-direction: row;
  gap: .5rem;
}

.photobtns img {
  height: 18px;
  width: 18px;
}

.photobtns .clearbtn {
  border-radius: .8rem;
  padding: .5rem;
  transition: all .3s ease;
}

.photobtns .clearbtn:hover {
  transform: scale(1.05);
}

.edit {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  width: 100%;
}

.edit input {
  background-color: rgb(240, 240, 240);
  border: 1px solid rgb(220, 220, 220);
  border-radius: 1rem;
  font-size: 16px;
  padding: 0.5rem .8rem;
  transition: all .3s ease;
}

.edit input:focus {
  background-color: rgb(230, 230, 230);
  border-color: var(--primary);
  box-shadow: 0 0 5px var(--primary);
  outline: none;
}

.edit input:disabled {
  background-color: #f5f5f5;
  border-color: #ccc;
  color: #9e9e9e;
  cursor: not-allowed;
}

#saveButton {
  padding: 0.8rem 1.2rem;
  transition: all .3s ease;
}

#saveButton:hover {
  transform: scale(1.05);
}

/* =========================================
= Foto de perfil
========================================= */
#profilephoto {
  align-items: center;
  background: linear-gradient(to left, var(--first-secondary), var(--primary));
  border-radius: 50%;
  color: var(--babypowder);
  display: flex;
  justify-content: center;
  width: 100px;
}

#profilephoto img {
  border-radius: 50%;
  height: auto;
  max-width: 100%;
}

/* =========================================
= Botones flotantes: Training / Download
========================================= */
.training {
  bottom: 2rem;
  position: fixed;
  right: 2rem;
  z-index: 1000;
}

.training button {
  align-items: center;
  border: none;
  border-radius: 50%;
  box-shadow: var(--shadow-raisinblack);
  color: var(--babypowder);
  cursor: pointer;
  display: flex;
  font-size: 1rem;
  font-weight: bold;
  height: 60px;
  justify-content: center;
  overflow: hidden;
  position: relative;
  transition: all .3s ease;
  width: 60px;
}

.training button img {
  height: 32px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: all .3s ease;
  width: 32px;
  z-index: 2;
}

.training button span {
  color: var(--babypowder);
  font-size: 1rem;
  left: 50%;
  opacity: 0;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: all .3s ease;
  visibility: hidden;
  white-space: nowrap;
  z-index: 1;
}

.training button:hover {
  border-radius: 2rem;
  width: 220px;
}

.training button:hover span {
  opacity: 1;
  visibility: visible;
}

.training button:hover img {
  opacity: 0;
}

.download {
  position: fixed;
  right: 2rem;
  top: 6rem;
  z-index: 1000;
}

.download button {
  align-items: center;
  border: none;
  border-radius: 50%;
  box-shadow: var(--shadow-raisinblack);
  color: var(--babypowder);
  cursor: pointer;
  display: flex;
  font-size: 1rem;
  font-weight: bold;
  height: 60px;
  justify-content: center;
  overflow: hidden;
  position: relative;
  transition: all .3s ease;
  width: 60px;
}

.download button img {
  height: 32px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: all .3s ease;
  width: 32px;
  z-index: 2;
}

.download button span {
  color: var(--babypowder);
  font-size: 1rem;
  left: 50%;
  opacity: 0;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: all .3s ease;
  visibility: hidden;
  white-space: nowrap;
  z-index: 1;
}

.download button:hover {
  border-radius: 2rem;
  width: 150px;
}

.download button:hover span {
  opacity: 1;
  visibility: visible;
}

.download button:hover img {
  opacity: 0;
}

.share {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
}

.share button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--babypowder);
  font-weight: bold;
  font-size: 1rem;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-raisinblack);
  overflow: hidden;
  width: 60px;
  height: 60px;
  transition: all .3s ease;
}

.share button img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  z-index: 2;
  transition: all .3s ease;
}

.share button span {
  font-size: 1rem;
  color: var(--babypowder);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all .3s ease;
  z-index: 1;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.share button:hover {
  width: 150px;
  border-radius: 2rem;
}

.share button:hover span {
  opacity: 1;
  visibility: visible;
}

.share button:hover img {
  opacity: 0;
}

.share button.copied {
  background: var(--green) !important;
}

/* =========================================
= Sidebar / Layout (base)
========================================= */
.sidebar {
  align-items: center;
  animation: slideIn 1s ease-out;
  border-radius: 0 2rem 2rem 0;
  box-shadow: var(--shadow-raisinblack);
  box-sizing: border-box;
  color: var(--babypowder);
  background: linear-gradient(to bottom, var(--primary), var(--first-secondary));
  display: flex;
  flex-direction: column;
  gap: 2rem;
  height: 100vh;
  overflow: hidden;
  padding: 1rem;
  position: fixed;
  top: 0;
  z-index: 1001;
}

.sidebar[data-collapsible]{
  width: 16rem;
  transition: all .3s ease;
}

.sidebar[data-collapsible].is-collapsed{
  width: 4rem;
}

.sidebar img#establishmentlogo {
  background-color: var(--babypowder);
  border-radius: 50%;
  height: calc(100% - .3rem - 2rem);
  width: calc(100% - .3rem - 2rem);
  padding: .3rem;
  /* margin: 2rem; */
}

.sidebar.is-collapsed img#establishmentlogo {
  height: calc(100% - .1rem - .5rem);
  width: calc(100% - .1rem - .5rem);
  padding: .1rem;
  /* margin: 1rem; */
}

.sidebar .toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  cursor: pointer;
  border: none;
  position: absolute;
  top: 5rem;
  right: 1rem;
}

.sidebar:hover .toggle {
  display: flex;
}

.hamburger {
  height: 26px;
  width: 26px;
}

.sidebar.is-collapsed .toggle {
  position: relative;
  top: 0;
  right: 0;
}

.sidebar .menu {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  height: 100%;
  justify-content: center;
  width: 100%;
}

.sidebar .menu a {
  align-items: center;
  border-radius: 1.5rem;
  color: var(--babypowder);
  display: flex;
  padding: .5rem 2rem;
  position: relative;
  transition: all .3s ease;
  width: calc(100% - 4rem);
  gap: .5rem;
  justify-content: start;
}

.sidebar.is-collapsed .menu a {
  padding: .5rem 0;
  width: 100%;
  justify-content: center;
}

.sidebar.is-collapsed .menu a p {
  display: none;
}

.sidebar .menu a::after {
  border-radius: 2rem 0 0 2rem;
  background: var(--first-tertiary);
  content: "";
  height: 100%;
  pointer-events: none;
  position: absolute;
  right: -1rem;
  transform: scaleX(0);
  transform-origin: right;
  transition: all .3s ease;
  width: 14.5rem;
  z-index: -1;
}

.sidebar .menu a.active::after {
  background: var(--first-tertiary);
}

.sidebar.is-collapsed .menu a::after {
  width: 3.5rem;
}

.sidebar .menu a:hover::after,
.sidebar .menu a.active::after {
  transform: scaleX(1);
}

.menu li img {
  height: 18px;
  width: 18px;
}

.page-title {
  color: var(--primary);
}

.content {
  display: flex;
  flex-direction: column;
  margin-left: 16rem;
  margin-top: 4rem;
  padding: 2rem;
  gap: 1rem;
  text-align: center;
  padding: 2rem;
  gap: 1rem;
  transition: all .3s ease;
}

.content.collapsed {
  margin-left: 4rem;
}

.content.report {
  margin: 0;
  gap: 2rem;
}

.dashboardheader {
  align-items: center;
  animation: fadeIn 1s ease-out;
  box-shadow: var(--shadow-raisinblack);
  color: var(--babypowder);
  background: linear-gradient(to left, var(--primary), var(--first-secondary));
  display: flex;
  height: 3.5rem;
  justify-content: end;
  padding: 0 2rem;
  position: fixed;
  top: 0;
  width: calc(100% - 4rem);
  z-index: 1000;
}

.dashboardheader .menuToggle {
  cursor: pointer;
  display: none;
}

.dashboardheader .menuToggle img {
  height: auto;
  width: 30px;
}

.dashboardheader .logo {
  display: flex;
}

.dashboardheader .logo img {
  height: auto;
  width: 150px;
}

/* =========================================
= Personalizados (professor / manager)
========================================= */
.clearbtn.professor {
  background: linear-gradient(to left, var(--primary), var(--first-secondary)) !important;
}

.clearbtn.professor::before {
  background-color: var(--first-secondary) !important;
}

.clearbtn.manager {
  background: linear-gradient(to left, var(--primary), var(--second-secondary)) !important;
}

.clearbtn.manager::before {
  background-color: var(--second-secondary) !important;
}

.sidebar.professor {
  background: linear-gradient(to bottom, var(--primary), var(--first-secondary)) !important;
}

.sidebar.manager {
  background: linear-gradient(to bottom, var(--primary), var(--second-secondary)) !important;
}

.sidebar.professor .menu a::after {
  background: var(--first-tertiary) !important;
}

.sidebar.manager .menu a::after {
  background: var(--second-tertiary) !important;
}

.sidebar.professor .menu a.active::after {
  background: var(--first-tertiary) !important;
}

.sidebar.manager .menu a.active::after {
  background: var(--second-tertiary) !important;
}

.dashboardheader.professor {
  background: linear-gradient(to left, var(--primary), var(--first-secondary)) !important;
}

.dashboardheader.manager {
  background: linear-gradient(to left, var(--primary), var(--second-secondary)) !important;
}

.sidebar.professor .establishment .logo {
  border: 4px solid var(--fourth-secondary) !important;
}

.sidebar.manager .establishment .logo {
  border: 4px solid var(--third-secondary) !important;
}

.userMenu.professor .logo {
  border: 4px solid var(--fourth-secondary) !important;
}

.userMenu.manager .logo {
  border: 4px solid var(--third-secondary) !important;
}

.sidebar.professor .userInfoText h6 {
  color: var(--fourth-secondary-light) !important;
}

.sidebar.manager .userInfoText h6 {
  color: var(--third-secondary-light) !important;
}

.page-title.professor {
  color: var(--first-secondary) !important;
}

.page-title.manager {
  color: var(--second-secondary) !important;
}

.training.professor button {
  background-color: var(--first-secondary) !important;
}

.download.professor button {
  background-color: var(--first-secondary) !important;
}

.share.professor button {
  background-color: var(--first-secondary) !important;
}

.training.manager button {
  background-color: var(--second-secondary) !important;
}

.download.manager button {
  background-color: var(--second-secondary);
}

.share.manager button {
  background-color: var(--second-secondary);
}

input[type="checkbox"].professor {
  border: var(--primary) 2px solid !important;
}

input[type="checkbox"].professor:hover:not(:disabled) {
  border-color: var(--first-secondary) !important;
  box-shadow: 0 0 5px var(--first-secondary) !important;
  background-color: var(--first-secondary) !important;
}

input[type="checkbox"].professor:checked {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
}

input[type="checkbox"].manager {
  border: var(--second-secondary) 2px solid !important;
}

input[type="checkbox"].manager:hover:not(:disabled) {
  border-color: var(--primary) !important;
  box-shadow: 0 0 5px var(--primary) !important;
  background-color: var(--primary) !important;
}

input[type="checkbox"].manager:checked {
  background-color: var(--second-secondary) !important;
  border-color: var(--second-secondary) !important;
}

.info-icon.professor {
  border: .15rem solid var(--primary) !important;
  color: var(--primary) !important;
}

.info-icon.professor:hover {
  border-color: var(--first-secondary) !important;
  color: var(--first-secondary) !important;
}

.info-icon[data-tooltip].professor:hover::after {
  background: var(--first-secondary) !important;
}

.info-icon.manager {
  border: .15rem solid var(--second-secondary) !important;
  color: var(--second-secondary) !important;
}

.info-icon.manager:hover {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

.info-icon[data-tooltip].manager:hover::after {
  background: var(--primary) !important;
}

/* =========================================
= Tarjeta establecimiento / Usuario
========================================= */
.establishment {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.establishment .info h3 {
  color: var(--babypowder);
  font-weight: 700;
}

.establishment .logo {
  align-items: center;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  width: 150px;
  height: 150px;
  position: relative;
}

.sidebar.is-collapsed .establishment .logo {
  width: 40px;
  height: 40px;
}

.sidebar.is-collapsed .establishment .info {
  display: none;
}

.userMenu .logo {
  align-items: center;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  padding: .2rem;
  position: relative;
}

.establishment .info {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 100%;
}

.userinfo {
  align-items: center;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  gap: 1rem;
  width: 100%;
}

.sidebar.is-collapsed .userinfo {
  padding: 0;
  width: 100%;
}

.sidebar.is-collapsed .userinfo .userInfoText {
  display: none;
}

.userinfo.hidden {
  display: none;
}

.userinfo .useravatar {
  border-radius: 50%;
  height: 32px;
  width: 32px;
}

.userInfoText {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  text-align: start;
}

/* =========================================
= Menú de usuario
========================================= */
.userMenu {
  animation: slideBottom 0.5s ease-out;
  background: var(--lightgray);
  border-radius: 1rem;
  box-shadow: var(--shadow-raisinblack);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  text-align: center;
  left: 1rem;
  top: 4rem;
  z-index: 1001;
  padding: .5rem;
  gap: .5rem;
  width: calc(14rem - 1rem);
  color: var(--primary);
}

.logo .useravatar {
  border-radius: 50%;
  height: 50px;
  width: 50px;
  margin: .2rem;
}

.userMenu ul {
  display: flex;
  flex-direction: column;
  width: calc(100% - 1rem);
  padding: 0 .5rem;
  gap: .5rem;
}

.userMenu ul li {
  background-color: var(--babypowder);
  border-radius: 1rem;
}

.userMenu ul li:last-child {
  border-bottom: none;
}

.userMenu ul li a {
  align-items: center;
  color: var(--raisinblack);
  cursor: pointer;
  display: flex;
  padding: .3rem 1rem;
  transition: all .3s ease;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  gap: 1rem;
}

.userMenu ul li img {
  height: 14px;
  width: 14px;
}

.userMenu::before {
  content: "";
  position: absolute;
  top: -.5rem;
  left: .5rem;
  width: 0;
  height: 0;
  border-left: 8px solid transparent; 
  border-right: 8px solid transparent;
  border-bottom: 11px solid var(--lightgray);
}

/* =========================================
= Icono de información / Tooltip
========================================= */
.info-icon {
  align-items: center;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  font-family: 'Times New Roman', Times, serif;
  font-size: 12px;
  font-weight: bolder;
  height: 15px;
  justify-content: center;
  padding: 2px;
  transition: all .3s ease;
  width: 15px;
}

.info-icon[data-tooltip]:hover::after {
  border-radius: 1rem;
  color: var(--babypowder);
  content: attr(data-tooltip);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: bold;
  padding: .5rem .8rem;
  position: absolute !important;
  transform: translateY(-100%);
  white-space: nowrap;
  z-index: 1001 !important;
}

/* =========================================
= Menú móvil (extra)
========================================= */
.mobileMenu {
  display: none;
  padding-top: 1rem;
  margin-top: 1rem;
  text-align: start;
  border-top: 3px solid var(--babypowder);
}

.mobileMenu a {
  align-items: center;
  display: flex;
  justify-content: center;
  color: var(--primary);
}

.mobileMenu a img {
  filter: brightness(0) invert(1);
}

/* =========================================
= Media Queries
========================================= */
@media screen and (max-width: 768px) {
  .menu li img { height: 18px; width: 18px; }

  .dashboardheader {
    padding: 0 1rem;
    width: calc(100% - 2rem);
  }

  .dashboardheader .menuToggle { display: block; }
  .dashboardheader .logo, .userinfo { display: none; }

  .sidebar {
    background: linear-gradient(to top, var(--primary), var(--first-secondary));
    border-radius: 0 0 0 2rem;
    position: fixed;
    right: -16rem;
    top: 3.5rem;
    transition: all .3s ease;
    width: 16rem;
    height: calc(100vh - 3.5rem);
  }

  .sidebar .menu {
    gap: .5rem;
  }

  .sidebar.active { transform: translateX(-16rem); }

  .content { 
    margin-left: 0;
    padding: 1rem;
  }

  .popupContent { width: 70%; }

  .video-container iframe {
    height: 180px;
    width: 320px;
  }

  .training { bottom: 1rem; right: 1rem; }

  .mobileMenu { display: block !important; }

  .edit-text { grid-template-columns: repeat(1, 1fr); }

  .sidebar:hover .toggle {
    display: none;
  }
}