// 선박 목록 관리자 스타일
// dark 프로젝트 패밀리 스타일 적용

.vessel-list-manager {
  width: 100%;
  border-radius: 0.6rem;
  transition: all 0.3s ease;
  background: var(--secondary1, rgba(255, 255, 255, 0.05));

  &.closed {
    .manager-content {
      display: none;
    }
  }

  // 헤더 토글
  .manager-header-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--tertiary2, rgba(255, 255, 255, 0.1));
    cursor: pointer;
    transition: background-color 0.2s;

    &:hover {
      background-color: var(--tertiary1, rgba(255, 255, 255, 0.03));
    }

    .header-title {
      font-size: var(--fs-m, 1.3rem);
      font-weight: var(--fw-bold, 700);
      color: var(--white, #fff);
    }

    .toggle-icon {
      transition: transform 0.2s;

      &.is-open {
        transform: rotate(180deg);
      }
    }
  }

  .manager-content {
    max-height: 50rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;

    // 탭 헤더
    .tab-header {
      display: flex;
      border-bottom: 1px solid var(--tertiary2, rgba(255, 255, 255, 0.1));
      margin-top: 0;

      .tab-item {
        flex: 1;
        height: 3.5rem;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: var(--fs-s, 1.2rem);
        font-weight: var(--fw-semibold, 600);
        color: var(--tertiary4, rgba(255, 255, 255, 0.6));
        background-color: transparent;
        border-bottom: 2px solid transparent;
        cursor: pointer;
        transition: all 0.2s ease;

        &:hover {
          color: var(--white, #fff);
          background-color: var(--tertiary1, rgba(255, 255, 255, 0.05));
        }

        &.active {
          color: var(--white, #fff);
          background-color: var(--primary1-alpha, rgba(74, 158, 255, 0.15));
          border-bottom-color: var(--primary1, #4a9eff);
        }
      }
    }

    .vessel-lists-container {
      display: flex;
      flex-direction: column;
      padding: 1.5rem;
      height: 32rem; // 고정 높이 (VesselListPanel 30rem + padding)
      min-height: 32rem;
      overflow: hidden; // 부모는 스크롤 없음 (자식 패널에서 스크롤)
    }

    .usage-hint {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.6rem;
      padding: 0.8rem 1.5rem;
      background: var(--tertiary1, rgba(0, 0, 0, 0.2));
      border-top: 1px solid var(--tertiary2, rgba(255, 255, 255, 0.1));
      color: var(--tertiary4, #999);
      font-size: var(--fs-xs, 1.1rem);
      font-style: italic;

      i {
        color: var(--primary1, #4a9eff);
      }
    }
  }

  // 레거시 스타일 (호환성)
  .manager-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--tertiary1, rgba(0, 0, 0, 0.2));
    border-radius: 0.6rem 0.6rem 0 0;
    border-bottom: 1px solid var(--tertiary2, rgba(255, 255, 255, 0.1));

    .header-left {
      display: flex;
      align-items: center;
      gap: 0.8rem;
      flex: 1;
    }

    .toggle-button {
      display: flex;
      align-items: center;
      gap: 0.6rem;
      background: none;
      border: none;
      color: var(--white, #fff);
      font-size: var(--fs-m, 1.3rem);
      font-weight: var(--fw-bold, 700);
      cursor: pointer;
      transition: all 0.2s ease;
      padding: 0.4rem 0.8rem;
      border-radius: 0.4rem;
      flex: 1;

      &:hover {
        background: var(--tertiary2, rgba(255, 255, 255, 0.1));
      }

      i {
        font-size: 1.2rem;
        transition: transform 0.2s ease;
      }

      span {
        white-space: nowrap;
      }
    }

    .vessel-counts {
      display: flex;
      align-items: center;
      gap: 1.2rem;

      .count-item {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        font-size: var(--fs-s, 1.2rem);
        font-weight: var(--fw-medium, 500);

        .icon {
          font-size: 1.1rem;
        }

        &.normal {
          color: #a8e6a3;
        }

        &.selected {
          color: #87ceeb;
        }

        &.deleted {
          color: #ffb3ba;
        }
      }
    }
  }

  &.open {
    .manager-header .toggle-button i {
      transform: rotate(0deg);
    }
  }

  &.closed {
    .manager-header .toggle-button i {
      transform: rotate(-90deg);
    }

    .manager-header {
      border-radius: 0.6rem;
    }
  }
}
