@import url("https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Nanum+Pen+Script&display=swap");

$blue: #007bff;
$blue-hover: #0056b3;
$gray-border: #e0e0e0;
$gray-tab: #495057;

body,
html {
  overflow-x: hidden;
}

.container {
  display: flex;
}

#page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 60px;
  margin: 0 auto;
  height: 60px;
  background-color: #fff;
  border-bottom: 1px solid $gray-border;
  box-sizing: border-box;

  .header-logo ul.logo {
    list-style: none;
    padding-left: 0;
  }

  .header-menu ul.menu {
    display: flex;
    align-items: center;
    list-style: none;
    padding-left: 0;
    margin: 0;
    gap: 12px;
  }

  .create-code-btn {
    background-color: #fff;
    border: 1px solid #000;
    border-radius: 25px;
    padding: 5px 15px;
    cursor: pointer;
    color: #000;

    &:hover {
      background-color: #000;
      color: #fff;
    }
  }

  .user-name-text {
    text-decoration: none;
    color: #000;
  }

  .login-btn {
    background-color: #fff;
    border: 1px solid #000;
    border-radius: 25px;
    padding: 5px 15px;
    cursor: pointer;
    color: #000;

    &:hover {
      background-color: #000;
      color: #fff;
    }
  }
  .logout-btn {
    cursor: pointer;
  }
}

body {
  font-family: "Inter", sans-serif;
  margin: 0;
  padding: 0;
  height: 100vh;
  max-height: 100vh;
  .tab-menu {
    padding: 0 60px 0 0;
    width: 68vw;
    justify-self: flex-end;
    ul {
      display: flex;
      list-style: none;
      margin: 0;
      padding: 0;
      gap: 10px;
      .tab-button {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 12px 6px 8px 0;
        text-decoration: none;
        color: $gray-tab;
        font-weight: 600;
        border-bottom: 3px solid transparent;
        transition: color 0.2s ease, border-color 0.2s ease;

        &:hover {
          color: $blue-hover;
        }

        &.active {
          color: $blue;
          border-bottom-color: $blue;
        }
      }
      .tab-icon {
        height: 1.8em;
        width: auto;
      }
    }
    .category-box {
      display: flex;
      margin-top: 20px;
      gap: 10px;
      .category {
        text-align: center;
        border-radius: 5px;
        height: 3vh;
        width: 8vh;
      }
    }
  }

  #main-content {
    display: flex;
    justify-content: flex-end;
    #post-list-container {
      width: 70vw;
      .detail-page {
        text-decoration: none;
        p {
          color: #000;
        }
      }
      display: grid;
      gap: 40px;
      padding: 12px 50px 50px 0;
      grid-template-columns: repeat(auto-fill, 318px);
      justify-content: center;
      @media screen and (min-width: 1920px) {
        padding: 12px 50px 0;
        grid-template-columns: repeat(auto-fill, 295px);
      }
      .post-list-box {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        overflow: hidden;
        width: 100%;
        min-height: 380px;
        background-color: #fff;
        box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
        border-radius: 5px;

        .code-text {
          padding: 10px;
          overflow-x: hidden;

          pre {
            margin: 0;
            padding: 0;
            overflow: hidden;
          }

          code {
            display: block;
            height: 270px;
            overflow: hidden;
            white-space: pre-wrap;
          }
        }
      }
      .code-information {
        display: flex;
        padding: 5px 20px 0 15px;
        border-top: 1px solid $gray-border;
        justify-content: space-between;
        gap: 10px;
        .info-box {
          display: flex;
          flex-direction: column;
          justify-content: center;
          gap: 2px;
          margin: 0;
          padding: 0;
          p {
            margin: 0;
            padding: 0;
          }
          .title {
            font-size: 1.15rem;
            font-weight: 400;
          }
          .student-info {
            font-size: 0.7rem;
          }
        }
        .like-box {
          display: flex;
          gap: 4px;
          #code-likes {
            cursor: default;
          }
        }
      }
    }
  }

  #page-footer {
    padding: 10px;
    text-align: center;
    font-size: 0.8em;
    margin-top: auto;
  }
}

.task-list-container {
  width: 24vw;
  margin: 0 auto;
  padding: 20px 20px 0 20px;
  text-align: center;
  border-right: 1px solid $gray-border;
  .task-list-title {
    font-size: 1rem;
    margin-bottom: 10px;
    border: 1px solid #000;
    border-radius: 5px;
    padding: 10px 20px;
    display: inline-block;
  }

  .task-list {
    list-style: none;
    margin: 0;
    padding: 0;

    .task-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 20px;
      margin-bottom: 10px;
      border: 1px solid #a9a9a9;
      border-radius: 5px;
      background-color: #fff;
      cursor: pointer;
      transition: background-color 0.3s, border-color 0.3s;

      &:hover {
        background-color: #f0f0f0;
      }

      &.selected {
        transition: all 0.05s;
        border: 2px solid $blue;
        .detail {
          .edit-icon:hover {
            fill: $blue;
          }
        }
      }

      .task-title {
        font-size: 1rem;
      }

      .detail {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        .task-type {
          font-size: 0.8rem;
          color: gray;
        }
        .edit-icon {
          min-width: 20px;
          width: 20px;
          fill: rgb(66, 66, 66);
          &:hover {
            fill: #ffc107;
          }
        }
        .delete-icon {
          min-width: 17px;
          width: 17px;
          fill: rgb(66, 66, 66);
          &:hover {
            fill: rgb(221, 2, 2);
          }
        }
      }
    }
  }

  .task-buttons {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    .task-button {
      flex: 1;
      padding: 10px;
      border: 1px solid #000;
      border-radius: 5px;
      background-color: #fff;
      cursor: pointer;
      transition: all 0.05s;

      &:hover {
        background-color: #898989;
        border-color: #fff;
        color: #fff;
      }
    }
  }
}
