/*  ---------------------------------------------- Global styles---------------------------------------------*/

a {
  color: inherit;
  text-decoration: none;
}

* {
  box-sizing: border-box;
}

li {
  list-style: none;
}

.mobile-only {
  display: none;
}

/* ---------------------------------------Top menu ----------------------------------------------------------*/

/* 1 rem = 16px, ex: 3.75rem = 3.75 * 16 = 60px*/

.container-top-menu {
  height: 3.75rem;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 1.25rem;
  border-bottom: 0.125rem solid #ccc;
  position: sticky;
  top: 0;
  background-color: #fff;
  z-index: 1000;
  align-items: center;
}

/* ----------------------------------Top menu left, the search bar ---------------------------------------------*/

.top-menu-left {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.desktop-search-container {
  display: flex;
  align-items: center;
  background-color: #f0f2f5;
  border-radius: 1.5rem;
  padding: 0 0.75rem;
  width: 16rem;
  height: 2.5rem;
}

.desktop-search-container i {
  color: #65676b;
  font-size: 0.95rem;
  margin-right: 0.625rem;
}

.top-menu-left-search {
  background-color: transparent;
  border: none;
  padding: 0;
  width: 100%;
  outline: none;
  font-size: 0.95rem;
}

/* ----------------------------------Top menu center, the main navigation ---------------------------------------------*/

.top-menu {
  width: 100%;
  height: 100%;
}

.top-menu-nav {
  width: 100%;
  height: 100%;
  margin: 0;
}

.top-menu-list {
  display: flex;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.top-menu-li {
  flex: 1;
  position: relative;
  border-bottom: 0.1875rem solid transparent; /* Añadir un borde transparente para luego utilizar un pseudo elemento*/
  transition: border-bottom-color 0.2s;
}

.top-menu-li a {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.top-menu-li a:hover {
  background-color: #f0f2f5;
}

.top-menu-li i {
  font-size: 1.5rem;
  color: #65676b;
}

.top-menu-li i:hover {
  color: #1877f2;
}

/* Como el focus no puede recibir foco, se utiliza el focus-within para que se detecte el <a> dentro del <li>
y este haga el efecto deseado */
.top-menu-li:focus-within {
  border-bottom-color: #1877f2; /* Cambia el color transparente a azul  */
}

.top-button:focus i {
  color: #1877f2;
}

/* ----------------------------------Top menu right, the user options ---------------------------------------------*/

.top-menu-r-list {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.top-menu-r-li a {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 2.5rem;
  height: 2.5rem;
  background-color: #e4e6eb;
  border-radius: 50%;
  font-size: 1.1rem;
  transition: background-color 0.2s;
}

.top-menu-r-li a:hover {
  background-color: #d8dadf;
}

#user-circle1 {
  color: #000;
}

/* ---------------------------------------Container of the main content ------------------------------------------*/

.container {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

/* ---------------------------------------Main content, left menu ------------------------------------------*/

.left-menu {
  position: sticky;
  top: 3.75rem;
  height: calc(100vh - 3.75rem);
  overflow-y: auto;
}

.left-menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem;
}

.left-menu-li a {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  transition: background 0.2s;
  font-size: 0.9rem;
  font-weight: 500;
}

.left-menu-li a:hover {
  background-color: #e4e6eb;
}

.left-menu-li i {
  min-width: 2rem;
  font-size: 1.5rem;
  text-align: center;
  margin-right: 0.75rem;
}

.fa-user-circle {
  color: #1877f2;
}
.fa-robot {
  color: #00c2cb;
}
.fa-user-group {
  color: #2abba7;
}
.fa-clock-rotate-left {
  color: #1877f2;
}
.fa-bookmark {
  color: #c058cf;
}
.fa-users-rectangle {
  color: #21a6ff;
}
#clapperboard2 {
  color: #f3425f;
}
.fa-chevron-down {
  color: #050505;
  background: #e4e6eb;
  border-radius: 50%;
  padding: 0.2rem;
  font-size: 0.8rem;
}

/* ---------------------------------------Main content, center content ------------------------------------------*/

.middle-menu {
  display: flex;
  flex-direction: column;
  background-color: #f0f2f5;
  min-height: calc(100vh - 3.75rem);
  width: 100%;
}

/* Publish  */

.create-post {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  padding: 0.75rem 1rem;
  width: 100%;
  max-width: 42.5rem;
  margin: 1rem auto;
}

.user-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  object-fit: cover;
}

.create-post-input {
  border: none;
  background-color: #f0f2f5;
  padding: 0.6rem 1rem;
  border-radius: 1.25rem;
  font-size: 0.93rem;
  flex: 1;
}

.create-post-input:hover {
  background-color: #e4e6eb;
}

.create-post-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.action-item {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.action-item:hover {
  background-color: #f2f2f2;
}

.action-item i {
  font-size: 1.4rem;
}

.video-icon {
  color: #f3425f;
}
.photos-icon {
  color: #45bd62;
}
.emoji-icon {
  color: #f7b928;
}

/* histories */

.histories {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 0;
  width: 100%;
  max-width: 42.5rem;
  margin: 0 auto;
}

.history {
  flex: 1;
  height: 12.5rem;
  position: relative;
  border-radius: 0.625rem;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  border: none;
}

.history img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.history:hover img {
  transform: scale(1.05);
}

.history-name {
  position: absolute;
  bottom: 0;
  left: 0;
  color: white;
  margin: 0.625rem;
  font-weight: 600;
  font-size: 0.8125rem;
}

/* Post header */

.post {
  background-color: #fff;
  margin: 0.625rem auto;
  width: 90%;
  max-width: 42.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  padding: 0.75rem;
}

.post-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.post-header i {
  font-size: 2rem;
}

/* Photo */

.post-photo {
  height: 25rem;
  width: 100%;
  margin: 0.625rem 0;
  overflow: hidden;
  background-color: #000;
}

.post-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}

.post-photo img:hover {
  transform: scale(1.02);
}

/* likes and shares */

.post-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.post-footer-nav {
  width: 100%;
}

.post-footer-list {
  display: flex;
  justify-content: flex-end;
  gap: 0.9375rem;
  width: 100%;
  margin: 0;
  padding: 0 0.625rem;
}

/* post reactions */

.post-reactions {
  width: 100%;
  border-top: 0.125rem solid #ccc;
  border-bottom: 0.125rem solid #ccc;
  padding: 0.3125rem 0;
  margin-top: 0.625rem;
}

.post-reactions-list {
  display: flex;
  width: 100%;
  margin: 0;
  padding: 0;
}

.post-reactions-li {
  flex: 1;
  text-align: center;
  padding: 0.625rem 0;
  border-radius: 5px;
}

.post-reactions-li:hover {
  background-color: #f0f2f5;
}

/* ---------------------------------------Main content, right menu ------------------------------------------*/

.menu-right {
  position: sticky;
  top: 3.75rem;
  height: calc(100vh - 3.75rem);
}

.friends-list {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.5rem;
  height: calc(100vh - 4.75rem);
  overflow-y: auto;
}

.friends-li a {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  transition: background 0.2s;
  font-size: 0.9rem;
  font-weight: 500;
}

.friends-li i {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2.2rem;
  margin-right: 0.75rem;
  color: #1877f2;
}

.friends-li a:hover {
  background-color: #e4e6eb;
}

/* ---------------------------------------Responsive Tablet ------------------------------------------*/

@media (max-width: 1024px) {
  .container {
    grid-template-columns: 1fr;
  }

  .left-menu,
  .menu-right {
    display: none;
  }

  .desktop-search-container {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }

  .desktop-search-container i {
    margin-right: 0;
    font-size: 1.1rem;
  }

  .top-menu-left-search {
    display: none;
  }
}

/* ---------------------------------------Responsive Mobile ------------------------------------------*/

@media (max-width: 767px) {
  .container-top-menu {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: flex;
    flex-wrap: wrap;
    padding: 0.3125rem 0.625rem 0 0.625rem;
    gap: 0;
  }

  .top-menu-left {
    width: auto;
    flex: 1;
    justify-content: flex-start;
    gap: 0.5rem;
  }

  .mobile-bars i {
    font-size: 1.6rem;
    color: #000;
  }

  .mobile-logo {
    color: #0866ff;
    font-size: 1.7rem;
    font-weight: 700;
    margin: 0;
  }

  .top-menu {
    width: 100%;
    order: 3;
    margin-top: 0.625rem;
  }

  .top-menu-list {
    justify-content: space-between;
  }

  .top-menu-li i {
    font-size: 1.5rem;
  }

  /* Quitar el fondo que venia del escritorio, queda el fondo gris*/
  .top-menu-li a:hover {
    background-color: transparent;
  }

  .top-menu-right {
    width: auto;
  }

  .top-menu-r-list {
    gap: 0.9375rem;
  }

  .top-menu-r-li.mobile-only {
    display: list-item;
  }

  .top-menu-li a {
    padding: 0.625rem 0;
    border-radius: 0;
    width: 100%;
  }

  .top-menu-r-li a {
    width: auto;
    height: auto;
    background-color: transparent;
    font-size: 1.3rem;
    color: #000;
    padding: 0.125rem;
  }

  .top-menu-r-li a:hover {
    background-color: transparent;
  }

  .mobile-only {
    display: block;
  }

  /* Ocultar elementos de escritorio, !important hace que esto se aplique por encima de todo*/
  .desktop-only,
  .desktop-only-icon {
    display: none !important;
  }

  .container {
    grid-template-columns: 1fr;
    gap: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .left-menu,
  .menu-right {
    display: none;
  }

  .middle-menu {
    min-width: 0;
    width: 100%;
    max-width: 100vw;
  }

  .create-post {
    width: 100%;
    border-radius: 0;
    margin: 0;
    padding: 0.625rem;
    box-shadow: none;
    border-bottom: 0.5rem solid #c9ccd1;
  }

  .create-post-input {
    min-width: 0;
  }

  .hide-icon-mobile {
    display: none;
  }

  .histories {
    justify-content: flex-start;
    overflow-x: auto;
    padding: 0.625rem;
    gap: 0.625rem;
    width: 100%;
    scrollbar-width: none;
  }

  .history {
    min-width: 6.25rem;
    flex: 0 0 auto;
  }

  .post {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    margin: 0.625rem 0 0 0;
  }

  .post-reactions-li a {
    font-size: 0.9rem;
  }
}
